From 57f478b7c16bffe92fed31f316ca9b36d6a1011d Mon Sep 17 00:00:00 2001 From: Don Turner Date: Mon, 7 Mar 2022 20:18:31 +0000 Subject: [PATCH] Remove episodes and saved destinations Bug: 223215076 Change-Id: If71b9190c145f9fc298f33fe2145a87886419d68 --- .../samples/apps/nowinandroid/ui/NavigationTest.kt | 14 +++++--------- .../google/samples/apps/nowinandroid/ui/NiaApp.kt | 3 +-- 2 files changed, 6 insertions(+), 11 deletions(-) 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.kt index 8d6d4b524..6e3dab8b7 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 @@ -142,10 +142,7 @@ class NavigationTest { composeTestRule.apply { // GIVEN the user is on any of the top level destinations, THEN the Up arrow is not shown. onNodeWithContentDescription(navigateUp).assertDoesNotExist() - onNodeWithText(episodes).performClick() - onNodeWithContentDescription(navigateUp).assertDoesNotExist() - onNodeWithText(saved).performClick() - onNodeWithContentDescription(navigateUp).assertDoesNotExist() + // TODO: Add top level destinations here, see b/226357686. onNodeWithText(topics).performClick() onNodeWithContentDescription(navigateUp).assertDoesNotExist() } @@ -157,8 +154,8 @@ class NavigationTest { @Test(expected = NoActivityResumedException::class) fun homeDestination_back_quitsApp() { composeTestRule.apply { - // GIVEN the user navigates to the Episodes destination - onNodeWithText(episodes).performClick() + // GIVEN the user navigates to the Topics destination + onNodeWithText(topics).performClick() // and then navigates to the For you destination onNodeWithText(forYou).performClick() // WHEN the user uses the system button/gesture to go back @@ -174,10 +171,9 @@ class NavigationTest { @Test fun navigationBar_backFromAnyDestination_returnsToForYou() { composeTestRule.apply { - // GIVEN the user navigated to the Episodes destination - onNodeWithText(episodes).performClick() - // and then navigated to the Topics destination + // GIVEN the user navigated to the Topics destination onNodeWithText(topics).performClick() + // TODO: Add another destination here to increase test coverage, see b/226357686. // WHEN the user uses the system button/gesture to go back, Espresso.pressBack() // THEN the app shows the For You destination diff --git a/app/src/main/java/com/google/samples/apps/nowinandroid/ui/NiaApp.kt b/app/src/main/java/com/google/samples/apps/nowinandroid/ui/NiaApp.kt index 0a24b2f50..5073d8cad 100644 --- a/app/src/main/java/com/google/samples/apps/nowinandroid/ui/NiaApp.kt +++ b/app/src/main/java/com/google/samples/apps/nowinandroid/ui/NiaApp.kt @@ -195,7 +195,6 @@ private sealed class Destination( private val TOP_LEVEL_DESTINATIONS = listOf( Destination.ForYou, - Destination.Episodes, - Destination.Saved, + // TODO: Add destinations here, see b/226359180. Destination.Following )