Skip to content

Commit 3155ef8

Browse files
square-tombstudioclaude
committed
test(mobile): rotate a covered page while another route's keyboard is up
Without the keyboard, the shrink-follow branch also refreshed the held padding, so the rotation test passed even with the size check removed. Raising the covering route's keyboard first leaves the size change as the only way to release the portrait padding. Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@localhost> Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Tom Brow <[email protected]>
1 parent c61e984 commit 3155ef8

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎mobile/test/shared/widgets/covered_route_keyboard_insets_test.dart‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ void main() {
135135
EdgeInsets? padding;
136136
final navigator = GlobalKey<NavigatorState>();
137137
var landscape = false;
138+
var keyboard = 0.0;
138139
late StateSetter setOuter;
139140
final app = MaterialApp(
140141
navigatorKey: navigator,
@@ -158,6 +159,7 @@ void main() {
158159
padding: landscape
159160
? const EdgeInsets.symmetric(horizontal: 44)
160161
: const EdgeInsets.only(top: 44, bottom: 34),
162+
viewInsets: EdgeInsets.only(bottom: keyboard),
161163
),
162164
child: app,
163165
);
@@ -175,6 +177,12 @@ void main() {
175177
);
176178
await tester.pumpAndSettle();
177179

180+
// The covering route raises its own keyboard, so only the size change can
181+
// release the held portrait padding.
182+
setOuter(() => keyboard = 300);
183+
await tester.pump();
184+
expect(padding, const EdgeInsets.only(top: 44, bottom: 34));
185+
178186
setOuter(() => landscape = true);
179187
await tester.pump();
180188
expect(padding, const EdgeInsets.symmetric(horizontal: 44));

0 commit comments

Comments
 (0)