Modern Apps git

← Modern-Apps.git

games-arrows: assert retry on generation-failure test

Commit
e6c5fb20f1dc42678a77c6cf90bbd58fea16c1e3
Author
Vayun Mathur <[email protected]>
When
2026-11-07 20:11 UTC (29 days ago)
Parents
666d10d
The generation-failed screen test pinned the old wiring, where
Try again restarted the level. It now records retryGeneration()
and asserts the retry action fires (and restart does not),
matching the dead-retry fix.

Diff

games/arrows/src/test/java/com/vayunmathur/games/arrows/ui/ArrowsScreensTest.kt
diff --git a/games/arrows/src/test/java/com/vayunmathur/games/arrows/ui/ArrowsScreensTest.kt b/games/arrows/src/test/java/com/vayunmathur/games/arrows/ui/ArrowsScreensTest.ktindex f73aff2de2..3e87cf617b 100644--- a/games/arrows/src/test/java/com/vayunmathur/games/arrows/ui/ArrowsScreensTest.kt+++ b/games/arrows/src/test/java/com/vayunmathur/games/arrows/ui/ArrowsScreensTest.kt@@ -35,11 +35,13 @@ class ArrowsScreensTest {         var commits = 0         var nexts = 0         var restarts = 0+        var retries = 0         val modes = mutableListOf<GameMode>()         override fun tapArrow(pieceId: Int) { tapped += pieceId }         override fun commitMove() { commits++ }         override fun nextLevel() { nexts++ }         override fun restartLevel() { restarts++ }+        override fun retryGeneration() { retries++ }         override fun setGameMode(mode: GameMode) { modes += mode }     } @@ -85,7 +87,10 @@ class ArrowsScreensTest {         }         rule.onNodeWithText(str(R.string.generation_failed)).assertIsDisplayed()         rule.onNodeWithText(str(R.string.try_again)).performClick()-        assertEquals(1, actions.restarts)+        // Retrying generation, not restarting: a restart only resets progress and+        // could never bring back a board that failed to generate.+        assertEquals(1, actions.retries)+        assertEquals(0, actions.restarts)     }      @Test