NavigatorTurbine

Functions

Link copied to clipboard
abstract suspend fun awaitNavigate(block: Navigator.() -> Unit)

Assert that all the events in the block are received. This function will suspend if no events have been received.

Link copied to clipboard
abstract suspend fun awaitNavigateBack()

Assert that the next event received was a back navigation event. This function will suspend if no events have been received.

Link copied to clipboard
abstract suspend fun <T : NavRoute> awaitNavigateBackTo(popUpTo: KClass<T>, inclusive: Boolean)

Assert that the next event received was a "back to" navigation event with matching parameters. This function will suspend if no events have been received.

Link copied to clipboard
abstract suspend fun awaitNavigateForResult(request: ActivityResultRequest<Void?, *>)
abstract suspend fun <I> awaitNavigateForResult(request: ActivityResultRequest<I, *>, input: I)

Assert that the next event received was a navigate for result event to request. This function will suspend if no events have been received.

Link copied to clipboard
abstract suspend fun awaitNavigateTo(route: NavRoute)
abstract suspend fun awaitNavigateTo(route: ActivityRoute, fallbackRoute: NavRoute? = null)

Assert that the next event received was a navigation event to the given route. This function will suspend if no events have been received.

Link copied to clipboard
abstract suspend fun awaitNavigateUp()

Assert that the next event received was an "up" navigation event. This function will suspend if no events have been received.

Link copied to clipboard
abstract suspend fun <O : Parcelable> awaitNavigationResult(key: NavigationResultRequest.Key<O>, result: O)

Assert that the next event received was a navigation result. This function will suspend if no events have been received.

Link copied to clipboard
abstract suspend fun awaitReplaceAllBackStacks(root: NavRoot)

Assert that the next event received was a "replace all back stacks" navigation event with matching parameters. This function will suspend if no events have been received.

Link copied to clipboard
abstract suspend fun awaitRequestPermissions(request: PermissionsResultRequest, vararg permissions: String)
abstract suspend fun awaitRequestPermissions(request: PermissionsResultRequest, permissions: List<String>)

Assert that the next event received was a permission request. This function will suspend if no events have been received.

Link copied to clipboard
abstract suspend fun awaitShowRoot(root: NavRoot)

Assert that the next event received was a "show root" navigation event with matching parameters. This function will suspend if no events have been received.

Link copied to clipboard
abstract suspend fun awaitSwitchBackStack(root: NavRoot)

Assert that the next event received was a "switch back stack" navigation event with matching parameters. This function will suspend if no events have been received.

Link copied to clipboard
abstract suspend fun cancel()

Cancel this NavigatorTurbine.

Link copied to clipboard
abstract suspend fun cancelAndIgnoreRemainingNavEvents()

Cancel this NavigatorTurbine. The difference to cancel is any unconsumed event will be ignored and no error will be thrown.

Link copied to clipboard
abstract fun dispatchBackPress()

Causes an emission to the current BackInterceptor.backPresses collector to make it possible to simulate a back press in tests that check custom back press logic.