A fully functional Android app built entirely with Kotlin and Jetpack Compose
Update NavigationTest.kt
Simon Marquis0a1f333fc64e
diff --git a/app/src/androidTest/java/com/google/samples/apps/nowinandroid/ui/NavigationTest.kt b/app/src/androidTest/java/com/google/samples/apps/nowinandroid/ui/NavigationTest.ktindex a5241a9db..3d14eedd6 100644--- a/app/src/androidTest/java/com/google/samples/apps/nowinandroid/ui/NavigationTest.kt+++ b/app/src/androidTest/java/com/google/samples/apps/nowinandroid/ui/NavigationTest.kt@@ -27,8 +27,10 @@ import androidx.compose.ui.test.junit4.AndroidComposeTestRuleimport androidx.compose.ui.test.junit4.createAndroidComposeRuleimport androidx.compose.ui.test.onAllNodesWithTextimport androidx.compose.ui.test.onNodeWithContentDescription+import androidx.compose.ui.test.onNodeWithTagimport androidx.compose.ui.test.onNodeWithTextimport androidx.compose.ui.test.performClick+import androidx.compose.ui.test.performScrollToNodeimport androidx.test.espresso.Espressoimport androidx.test.espresso.NoActivityResumedExceptionimport com.google.samples.apps.nowinandroid.MainActivity@@ -262,10 +264,13 @@ class NavigationTest {@Testfun navigationBar_multipleBackStackInterests() = runTest {- val topics = datasource.getTopics(ids = null)composeTestRule.apply {onNodeWithText(interests).performClick()- onNodeWithText(topics.random().name).performClick()++ // Select a random topic+ val topic = datasource.getTopics().random().name+ onNodeWithTag("interests:topics").performScrollToNode(hasText(topic))+ onNodeWithText(topic).performClick()// Switch tabonNodeWithText(forYou).performClick()@@ -274,7 +279,7 @@ class NavigationTest {onNodeWithText(interests).performClick()// Verify we're not in the list of interests- onNodeWithText(topics.random().name).assertDoesNotExist()+ onNodeWithTag("interests:topics").assertDoesNotExist()}}}