|
|
@ -167,7 +167,7 @@ class NiaAppStateTest {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
fun stateIsOfflineWhenNetworkMonitorIsOffline() = runTest(UnconfinedTestDispatcher()) {
|
|
|
|
fun niaAppState_whenNetworkMonitorIsOffline_StateIsOffline() = runTest(UnconfinedTestDispatcher()) {
|
|
|
|
composeTestRule.setContent {
|
|
|
|
composeTestRule.setContent {
|
|
|
|
state = NiaAppState(
|
|
|
|
state = NiaAppState(
|
|
|
|
navController = NavHostController(LocalContext.current),
|
|
|
|
navController = NavHostController(LocalContext.current),
|
|
|
@ -214,7 +214,7 @@ class NiaAppStateTest {
|
|
|
|
@Composable
|
|
|
|
@Composable
|
|
|
|
private fun rememberTestNavController(): TestNavHostController {
|
|
|
|
private fun rememberTestNavController(): TestNavHostController {
|
|
|
|
val context = LocalContext.current
|
|
|
|
val context = LocalContext.current
|
|
|
|
return remember<TestNavHostController> {
|
|
|
|
return remember {
|
|
|
|
TestNavHostController(context).apply {
|
|
|
|
TestNavHostController(context).apply {
|
|
|
|
navigatorProvider.addNavigator(ComposeNavigator())
|
|
|
|
navigatorProvider.addNavigator(ComposeNavigator())
|
|
|
|
graph = createGraph(startDestination = "a") {
|
|
|
|
graph = createGraph(startDestination = "a") {
|
|
|
|