-
-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Testing screens that uses DestinationsNavigator and Parcelable args #36
Comments
Hi @asrieltiago ! 👋 Thanks for reporting. val navController = TestNavHostController(ApplicationProvider.getApplicationContext())
fun destinationsNavigator(navBackStackEntry: NavBackStackEntry): DestinationsNavigator {
return DestinationsNavController(navController, navBackStackEntry)
}
//...
DestinationsNavHost(navGraph = NavGraphs.root, navController = navController) I'm not sure if this helps or not. I'd have to fully understand what you're trying to do, so I can test on my side. |
Or you can create an implementation of |
If you need an empty implementation of DestinationsNavigator, the library has an |
Hi,
Previously i was using this to mock the NavHostController, but cannot find a way to do the same with DestinationsNavController.
private val navController = TestNavHostController(ApplicationProvider.getApplicationContext())
I could make it work on the startDestination of the NavGraphs, but i think this is not the correct way.
On the detail screen i receive parcelable args, and i'm not able to mock the args on the Destination.
When i tried to run the test, i receive this exception and cannot mock the args:
I wanna know if already exists a way to mock or test the screens with this library, receiving the args from the DestinationNavigator.
The text was updated successfully, but these errors were encountered: