Skip to content

Commit a71b8a9

Browse files
committed
Fixes botched test composition_is_restored_in_modal_after_config_change.
I converted it wrong, putting what was supposed to be the modal content into the body / activity instead. So the test was passing vaccuously, and even better, failing with an obscure `SavedStateRegistry.consumeRestoredStateForKey` exception on higher API levels. Fixes #800.
1 parent dd4338a commit a71b8a9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

workflow-ui/compose/src/androidTest/java/com/squareup/workflow1/ui/compose/ComposeViewTreeIntegrationTest.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import com.squareup.workflow1.ui.container.AndroidOverlay
3737
import com.squareup.workflow1.ui.container.BackStackScreen
3838
import com.squareup.workflow1.ui.container.BodyAndModalsScreen
3939
import com.squareup.workflow1.ui.container.ModalScreenOverlayDialogFactory
40-
import com.squareup.workflow1.ui.container.Overlay
4140
import com.squareup.workflow1.ui.container.ScreenOverlay
4241
import com.squareup.workflow1.ui.internal.test.DetectLeaksAfterTestSuccess
4342
import com.squareup.workflow1.ui.internal.test.IdleAfterTestRule
@@ -372,7 +371,9 @@ internal class ComposeViewTreeIntegrationTest {
372371
// Show first screen to initialize state.
373372
scenario.onActivity {
374373
it.setRendering(
375-
BodyAndModalsScreen<Screen, Overlay>(BackStackScreen(EmptyRendering, firstScreen))
374+
BodyAndModalsScreen(
375+
EmptyRendering, TestModal(BackStackScreen(EmptyRendering, firstScreen))
376+
)
376377
)
377378
}
378379

@@ -608,7 +609,7 @@ internal class ComposeViewTreeIntegrationTest {
608609
object EmptyRendering : AndroidScreen<EmptyRendering> {
609610
override val viewFactory: ScreenViewFactory<EmptyRendering>
610611
get() = ScreenViewFactory.fromCode { _, e, c, _ ->
611-
ScreenViewHolder(e, View(c)) { _, _, -> }
612+
ScreenViewHolder(e, View(c)) { _, _ -> }
612613
}
613614
}
614615

0 commit comments

Comments
 (0)