Description: Verify the layout and state persistence of a StackContainer nested within a FormSheet. This test ensures that the Stack layout correctly fills the FormSheet container, that content remains properly centered, that the layout smoothly adapts when the FormSheet height changes, and that the Stack's navigation state is preserved when the sheet is dismissed and reopened.
OS test creation version: iOS: 18.6 and 26.4, iPadOS 26.4
Other: Planned, but will be implemented separately.
- iOS device or simulator: iPhone and iPad
- On iPad: Ensure the device is in full-screen mode, regular width, regular height size class
- On iPad: The FormSheet is presented as a centered floating panel with a fixed width, not as a full-width bottom sheet as on iPhone.
- Launch the app and navigate to the FormSheet with Nested Stack v5 screen.
- Expected: Content with the button "Open FormSheet" is shown
- Tap the "Open FormSheet" button.
- Expected: The FormSheet opens at the initial lower detent (0.6). The "Home Screen" text is visible and centered within the sheet. The light blue background completely covers the FormSheet content area.
- Tap the "Push A" button to push Screen A.
- Expected: The stack navigates to "Screen A". The "Screen A" text is centered. The light yellow background completely covers the FormSheet content area.
- Grab the top edge of the FormSheet and swipe up to expand it to the maximum detent (1.0).
- Expected: The FormSheet expands to take up the maximum available height (respecting the top inset). The layout adapts dynamically - the light yellow background stretches to cover the new full height, and the "Screen A" text dynamically re-centers itself within the newly expanded view area.
- Swipe down on the FormSheet to dismiss it, then tap the "Open FormSheet" button again.
- Expected: The FormSheet re-opens at the initial lower detent (0.6). The stack's navigation state has been kept - the sheet immediately displays "Screen A" (with the yellow background and centered text) rather than resetting back to the Home Screen.
- Tap the "Pop" button (or native header back button) to pop Screen A.
- Expected: The stack correctly navigates back to the "Home Screen". The "Home Screen" text is visible and centered, and the light blue background completely covers the FormSheet content area.
- Launch the app and navigate to the FormSheet with Nested Stack v5 screen.
- Expected: Content with the button "Open FormSheet" is shown.
- Tap the "Open FormSheet" button.
- Expected: The FormSheet opens as a centered floating panel at the initial lower detent (0.6). The panel has a fixed width and is horizontally centered on screen. The "Home Screen" text is visible and centered within the panel. The light blue background completely covers the FormSheet content area.
- Tap the "Push A" button to push Screen A.
- Expected: The stack navigates to "Screen A". The "Screen A" text is centered within the floating panel. The light yellow background completely covers the FormSheet content area.
- Grab the top edge of the FormSheet and swipe up to expand it to the maximum detent (1.0).
- Expected: The FormSheet panel expands vertically to take up the maximum available height (respecting the top inset), while the width remains fixed. The layout adapts dynamically - the light yellow background stretches to cover the new full height, and the "Screen A" text dynamically re-centers itself within the newly expanded panel.
- Swipe down on the FormSheet to dismiss it, then tap the "Open FormSheet" button again.
- Expected: The FormSheet re-opens as a centered floating panel at the initial lower detent (0.6). The stack's navigation state has been kept - the panel immediately displays "Screen A" (with the yellow background and centered text) rather than resetting back to the Home Screen.
- Tap the "Pop" button (or native header back button) to pop Screen A.
- Expected: The stack correctly navigates back to the "Home Screen". The "Home Screen" text is visible and centered within the panel, and the light blue background completely covers the FormSheet content area.