-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix wrong names being shown in team 2 column of results detail view (#12
) fixes #10 move test result processing to post_ci Signed-off-by: John Burns <[email protected]>
- Loading branch information
1 parent
f605d1d
commit 561e45a
Showing
7 changed files
with
82 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
src/test/kotlin/com/github/wakingrufus/eloleague/results/ResultsDetailsViewTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package com.github.wakingrufus.eloleague.results | ||
|
||
import com.github.wakingrufus.eloleague.TornadoFxTest | ||
import com.github.wakingrufus.eloleague.player.PlayerItem | ||
import com.github.wakingrufus.eloleague.printNodes | ||
import com.github.wakingrufus.eloleague.waitFor | ||
import javafx.collections.FXCollections | ||
import javafx.collections.ObservableList | ||
import javafx.scene.Node | ||
import javafx.scene.Parent | ||
import mu.KLogging | ||
import org.junit.Test | ||
import org.testfx.api.FxAssert | ||
import org.testfx.matcher.base.NodeMatchers | ||
import java.time.Instant | ||
import java.time.ZoneOffset | ||
import java.time.format.DateTimeFormatter | ||
import java.util.* | ||
|
||
class ResultsDetailsViewTest : TornadoFxTest() { | ||
companion object : KLogging() | ||
|
||
@Test | ||
fun test() { | ||
val result1 = GameResultItem( | ||
id = UUID.randomUUID().toString(), | ||
player = PlayerItem(id = UUID.randomUUID().toString(), name = "Adam"), | ||
ratingAdjustment = 1, | ||
entryDate = DateTimeFormatter.ISO_DATE_TIME.format(Instant.now().atOffset(ZoneOffset.UTC)), | ||
win = true, | ||
startingRating = 1500, | ||
team1Score = 5, | ||
team2Score = 3, | ||
team1Players = listOf( | ||
PlayerItem(id = UUID.randomUUID().toString(), name = "Adam"), | ||
PlayerItem(id = UUID.randomUUID().toString(), name = "Beth")), | ||
team2Players = listOf( | ||
PlayerItem(id = UUID.randomUUID().toString(), name = "Alice"), | ||
PlayerItem(id = UUID.randomUUID().toString(), name = "Bob")) | ||
) | ||
val resultDetails: ObservableList<GameResultItem> = FXCollections.observableArrayList( | ||
result1 | ||
) | ||
showViewWithParams<ResultsDetailsView>(mapOf( | ||
"gameResults" to resultDetails | ||
)) | ||
waitFor({scene!!.root.childrenUnmodifiable[0].isVisible}) | ||
FxAssert.verifyThat("#result-details-wrapper", NodeMatchers.isVisible()) | ||
printNodes(scene!!.root) | ||
FxAssert.verifyThat("#result-details-wrapper .table-view .table-row-cell #team-1", | ||
NodeMatchers.hasText("Adam, Beth")) | ||
FxAssert.verifyThat("#result-details-wrapper .table-view .table-row-cell #team-2", | ||
NodeMatchers.hasText("Alice, Bob")) | ||
} | ||
} |