Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
class TestHostNavigator(var handleDeepLinkRoute: NavRoute? = null) : HostNavigator

Functions

Link copied to clipboard
fun DestinationNavigator.dispatchBackPress()

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

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

Link copied to clipboard
inline fun <R : Parcelable> fakeNavigationResultKey(): NavigationResultRequest.Key<R>

Creates a NavigationResultRequest.Key for testing purposes. This should only be used for testing the result sender that retrieves a key as part of its argument.

Link copied to clipboard
fun <O> ActivityResultRequest<*, O>.sendResult(result: O)
fun <R : Parcelable> NavigationResultRequest<R>.sendResult(result: R)
fun PermissionsResultRequest.sendResult(vararg pairs: Pair<String, PermissionsResultRequest.PermissionResult>)
fun PermissionsResultRequest.sendResult(result: Map<String, PermissionsResultRequest.PermissionResult>)
fun PermissionsResultRequest.sendResult(permission: String, result: PermissionsResultRequest.PermissionResult)

Send a fake result to collectors of this request. Can be used to test the result handling logic.

Link copied to clipboard
suspend fun DestinationNavigator.test(timeout: Duration? = null, name: String? = null, validate: suspend NavigatorTurbine.() -> Unit)

Collects events from DestinationNavigator and allows the validate lambda to consume and assert properties on them in order. If any exception occurs during validation the exception is rethrown from this method.

suspend fun TestHostNavigator.test(timeout: Duration? = null, name: String? = null, validate: suspend NavigatorTurbine.() -> Unit)

Collects events from TestHostNavigator and allows the validate lambda to consume and assert properties on them in order. If any exception occurs during validation the exception is rethrown from this method.

Link copied to clipboard
fun DestinationNavigator.testIn(scope: CoroutineScope, timeout: Duration? = null, name: String? = null): NavigatorTurbine

Collects events from DestinationNavigator and returns a NavigatorTurbine for consuming and asserting properties on them in order. If any exception occurs during validation the exception is rethrown from this method.

fun TestHostNavigator.testIn(scope: CoroutineScope, timeout: Duration? = null, name: String? = null): NavigatorTurbine

Collects events from TestHostNavigator and returns a NavigatorTurbine for consuming and asserting properties on them in order. If any exception occurs during validation the exception is rethrown from this method.