java.lang.IllegalStateException: Method addObserver must be called on the main thread.
@Test fun verifyAllRequiredViewsAreDisplayed() {
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)
}