Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ class NavigateToTest {
AppRoute.Main.Sheet(AppRoute.Sheets.Wallet),
)

navigator.openAsSheet(AppRoute.Sheets.Lab)
navigator.openAsSheet(AppRoute.Sheets.ShareApp)

assertNotNull(navigator.pendingSheetDismiss)
// Backstack unchanged until the callback fires
Expand All @@ -302,15 +302,15 @@ class NavigateToTest {
AppRoute.Main.Sheet(AppRoute.Sheets.Wallet),
)

navigator.openAsSheet(AppRoute.Sheets.Lab)
navigator.openAsSheet(AppRoute.Sheets.ShareApp)

// Simulate dismiss: remove old sheet entry, then callback fires
navigator.backStack.removeAt(navigator.backStack.lastIndex)
navigator.pendingSheetDismiss!!.invoke()

val last = navigator.backStack.last()
assertIs<AppRoute.Main.Sheet>(last)
assertEquals(AppRoute.Sheets.Lab, last.initialRoute)
assertEquals(AppRoute.Sheets.ShareApp, last.initialRoute)
}

@Test
Expand All @@ -321,7 +321,7 @@ class NavigateToTest {
)
val initialGeneration = navigator.sheetGeneration

navigator.openAsSheet(AppRoute.Sheets.Lab)
navigator.openAsSheet(AppRoute.Sheets.ShareApp)

// Simulate dismiss
navigator.backStack.removeAt(navigator.backStack.lastIndex)
Expand All @@ -334,7 +334,7 @@ class NavigateToTest {
fun `openAsSheet without existing sheet navigates directly`() {
val navigator = createNavigator(AppRoute.Main.Scanner)

navigator.openAsSheet(AppRoute.Sheets.Lab)
navigator.openAsSheet(AppRoute.Sheets.ShareApp)

assertNull(navigator.pendingSheetDismiss)
assertEquals(2, navigator.backStack.size)
Expand Down
Loading