You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.
java.lang.IllegalStateException: Method addObserver must be called on the main thread.
Line navController.setGraph(R.navigation.navigation_onboarding)
`@RunWith(AndroidJUnit4::class)
class UserEmailFragmentTest {
@get:Rule
val activityRule = activityScenarioRule<OnboardingActivity>()
@Test
fun verifyAllRequiredViewsAreDisplayed() {
// Create a TestNavHostController
val navController = TestNavHostController(
ApplicationProvider.getApplicationContext()
)
navController.setGraph(R.navigation.navigation_onboarding)
// Create a graphical FragmentScenario for the TitleScreen
val userEmailScenario = launchFragmentInContainer<EmailFragment>()
// Set the NavController property on the fragment
userEmailScenario.onFragment { fragment ->
Navigation.setViewNavController(fragment.requireView(), navController)
}
assertThat(navController.currentDestination?.id).isEqualTo(R.id.emailFragment)
}
}`
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
java.lang.IllegalStateException: Method addObserver must be called on the main thread.
Line navController.setGraph(R.navigation.navigation_onboarding)
`@RunWith(AndroidJUnit4::class)
class UserEmailFragmentTest {
}`
The text was updated successfully, but these errors were encountered: