I have a question the proper way to test Navigation in compose-wear.
When I use the TestNavHostController, and I create a graph with
createGraph
and
composable(Screen.MainMenu.route)
set I get a casting error:
java.lang.ClassCastException: androidx.navigation.testing.TestNavigatorProvider$navigator$1 cannot be cast to androidx.wear.compose.navigation.WearNavigator
at androidx.wear.compose.navigation.NavGraphBuilderKt.composable(NavGraphBuilder.kt:55)
at androidx.wear.compose.navigation.NavGraphBuilderKt.composable$default(NavGraphBuilder.kt:36)
If I don't create a graph, I get a null-pointer error, since there's nowhere to navigate to.
All the examples I see online seem to be using
R.navigation
, but I think that's used when your app uses an XML navigation definition, and not jetpack compose...