Skip to content

Commit

Permalink
Tries to fix flaky test
Browse files Browse the repository at this point in the history
Change-Id: I4c94aadaa9f6b7fafce17ce949c922973bd522d0
  • Loading branch information
JoseAlcerreca committed Nov 8, 2023
1 parent bb69e0b commit 6c8fdef
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import dagger.hilt.android.testing.BindValue
import dagger.hilt.android.testing.HiltAndroidRule
import dagger.hilt.android.testing.HiltAndroidTest
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.test.runTest
import org.junit.Before
import org.junit.Rule
Expand Down Expand Up @@ -265,12 +266,14 @@ class NavigationTest {
}

@Test
fun navigationBar_multipleBackStackInterests() = runTest {
fun navigationBar_multipleBackStackInterests() {
composeTestRule.apply {
onNodeWithText(interests).performClick()

// Select the last topic
val topic = topicsRepository.getTopics().first().sortedBy(Topic::name).last().name
val topic = runBlocking {
topicsRepository.getTopics().first().sortedBy(Topic::name).last().name
}
onNodeWithTag("interests:topics").performScrollToNode(hasText(topic))
onNodeWithText(topic).performClick()

Expand Down

0 comments on commit 6c8fdef

Please sign in to comment.