FakeNavigator
A fake Navigator that can be used in tests to record and assert navigation events.
This navigator acts as a real navigator for all intents and purposes, navigating either a given BackStack or using a simple real one under the hood if one isn't provided.
Example
val navigator = FakeNavigator(FavoritesScreen)
val presenter = FavoritesPresenter(navigator)
presenter.test {
val state = awaitItem()
state.eventSink(AddFavoriteClick)
assertThat(navigator.awaitNextScreen())
.isEqualTo(AddFavoriteScreen)
}
Types
Represents a recorded Navigator.goTo event.
Represents a recorded Navigator.pop event.
Represents a recorded Navigator.resetRoot event.
Functions
Awaits the next navigation goTo or throws if no goTo are performed.
Awaits the next Screen that was navigated to or throws if no screens were navigated to.
Awaits the next navigation pop event or throws if no pops are performed.
Awaits the next navigation resetRoot or throws if no resets were performed.
Returns the next Screen that was navigated to or throws if no screens were navigated to.