Restrict shell route and Back handling to the current entry

This commit is contained in:
justinzeus 2026-11-06 12:03:20 +01:00
parent afff383b75
commit 22850632ec
3 changed files with 18 additions and 5 deletions

View file

@ -105,9 +105,17 @@ class FirstSignInNavigationTest {
assertEquals(6, session.state!!.view.library!!.source.size)
assertFalse(session.state!!.person.hasAnime)
rule.onNodeWithText("Shows").performClick()
rule.waitUntil(10_000) {
Shadows.shadowOf(Looper.getMainLooper()).idle()
session.state!!.view.library?.source?.size == 29
try {
rule.waitUntil(10_000) {
Shadows.shadowOf(Looper.getMainLooper()).idle()
session.state!!.view.library?.source?.size == 29
}
} catch (timeout: ComposeTimeoutException) {
val shell = session.state!!
throw AssertionError("Active=${navigation.backStack.last()}, shell=${shell.route}, " +
"movies=${shell.rememberedView("movies").library?.source?.size}, " +
"shows=${shell.rememberedView("shows").library?.source?.size}/" +
"${shell.rememberedView("shows").library?.status}", timeout)
}
rule.onNodeWithTag("library-grid").assertIsDisplayed()
rule.onAllNodesWithText("Mindel Shows title 0")[0].assertIsDisplayed()