Skip to content

Commit 7541a59

Browse files
committed
Fix nested test to match 5th page exactly
1 parent c5e790c commit 7541a59

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

app/src/androidInstrumentedTest/kotlin/io/github/xxfast/decompose/router/app/TestNestedRouters.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class TestNestedRouters {
4141
// Go to pages and swipe to the 5th page
4242
onNode(bottomNavPagesItem).performClick()
4343
onNode(pager).performScrollToIndex(5)
44-
onNode(hasText("5")).assertExists()
44+
onNode(hasText("Page #5")).assertExists()
4545

4646
// Go to slots, open the bottom sheet and verify if it is visible
4747
onNode(bottomNavSlotItem).performClick()
@@ -58,7 +58,7 @@ class TestNestedRouters {
5858
onNode(bottomNavStackItem).performClick()
5959
onNode(details).assertExists().assertTextContains("Item@", substring = true)
6060
onNode(bottomNavPagesItem).performClick()
61-
onNode(hasText("5")).assertExists()
61+
onNode(hasText("Page #5")).assertExists()
6262
onNode(bottomNavSlotItem).performClick()
6363
onNode(buttonBottomSheet).performClick()
6464
activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT

app/src/androidInstrumentedTest/kotlin/io/github/xxfast/decompose/router/app/TestPagesRouters.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ class TestPagesRouters {
2121
// Go to pages and swipe to the 5th page
2222
onNode(bottomNavPagesItem).performClick()
2323
onNode(pager).performScrollToIndex(5)
24-
onNode(hasText("5")).assertExists()
24+
onNode(hasText("Page #5")).assertExists()
2525

2626
// Verify pages screens are restored
2727
activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
2828
onNode(pager).assertExists()
29-
onNode(hasText("5")).assertExists()
29+
onNode(hasText("Page #5")).assertExists()
3030
activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
3131
onNode(pager).assertExists()
32-
onNode(hasText("5")).assertExists()
32+
onNode(hasText("Page #5")).assertExists()
3333
}
3434
}

app/src/commonMain/kotlin/io/github/xxfast/decompose/router/screens/pages/PagesScreen.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ fun PagesScreen() {
5858
Card(modifier = Modifier.padding(16.dp)) {
5959
Box(modifier = Modifier.fillMaxSize()) {
6060
Text(
61-
text = page.index.toString(),
62-
style = MaterialTheme.typography.displayLarge,
61+
text = "Page #${page.index}",
62+
style = MaterialTheme.typography.displayMedium,
6363
modifier = Modifier.align(Alignment.Center)
6464
)
6565
}

0 commit comments

Comments
 (0)