Skip to content

Commit

Permalink
Merge pull request #294 from alyssaruth/fix-tests-windows
Browse files Browse the repository at this point in the history
Fix a few failing unit tests on Windows
  • Loading branch information
alyssaruth authored Jan 13, 2024
2 parents 0c8bb6d + 15a72d1 commit a692abb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/test/kotlin/dartzee/TestUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import io.mockk.MockKMatcherScope
import java.awt.Color
import java.awt.Component
import java.awt.Point
import java.io.File
import java.time.Instant
import java.time.LocalDate
import java.time.ZoneId
Expand Down Expand Up @@ -222,7 +223,7 @@ fun FileUploader.uploadFileFromResource(resourceName: String) {
chooserDialog.clickChild<JButton>(text = "Open")
flushEdt()

getChild<JTextField>().text shouldBe rsrcPath
getChild<JTextField>().text shouldBe File(rsrcPath).path
clickChild<JButton>(text = "Upload")
flushEdt()
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/kotlin/dartzee/bean/TestFileUploader.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class TestFileUploader : AbstractTest() {
@Test
fun `Should be able to upload a file`() {
val rsrc = javaClass.getResource("/outer-wilds.jpeg")!!
val path = rsrc.path
val path = File(rsrc.path).path

val uploader = FileUploader(FileNameExtensionFilter("all", "*"))
val listener = makeFileListener(true)
Expand All @@ -65,7 +65,7 @@ class TestFileUploader : AbstractTest() {
@Test
fun `Should not clear text if file listener reports failure`() {
val rsrc = javaClass.getResource("/outer-wilds.jpeg")!!
val path = rsrc.path
val path = File(rsrc.path).path

val uploader = FileUploader(FileNameExtensionFilter("all", "*"))
val listener = makeFileListener(false)
Expand Down

0 comments on commit a692abb

Please sign in to comment.