Skip to content

Commit

Permalink
test(NearbyTransitView): wait in test for route to be found
Browse files Browse the repository at this point in the history
  • Loading branch information
KaylaBrady committed Dec 18, 2024
1 parent 88fcce7 commit 4296629
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.mbta.tid.mbta_app.android.nearbyTransit

import androidx.compose.ui.test.ExperimentalTestApi
import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.hasText
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithText
import com.mbta.tid.mbta_app.model.Coordinate
Expand Down Expand Up @@ -229,6 +231,7 @@ class NearbyTransitViewTest : KoinTest {

@get:Rule val composeTestRule = createComposeRule()

@OptIn(ExperimentalTestApi::class)
@Test
fun testNearbyTransitViewDisplaysCorrectly() {
composeTestRule.setContent {
Expand All @@ -245,6 +248,7 @@ class NearbyTransitViewTest : KoinTest {
}

composeTestRule.onNodeWithText("Nearby Transit").assertIsDisplayed()
composeTestRule.waitUntilExactlyOneExists(hasText("Sample Route"))
composeTestRule.onNodeWithText("Sample Route").assertIsDisplayed()
composeTestRule.onNodeWithText("Sample Headsign").assertIsDisplayed()
composeTestRule.onNodeWithText("1 min").assertIsDisplayed()
Expand Down

0 comments on commit 4296629

Please sign in to comment.