@@ -405,7 +405,31 @@ void main() {
405
405
});
406
406
407
407
group ('presents message content appropriately' , () {
408
- testWidgets ('content not asked to consume insets (including bottom), even without compose box' , (tester) async {
408
+ testWidgets ('content not asked to consume insets (including bottom), even without compose box, in top sliver' , (tester) async {
409
+ // Regression test for: https://github.com/zulip/zulip-flutter/issues/1523
410
+ const fakePadding = FakeViewPadding (left: 10 , top: 10 , right: 10 , bottom: 10 );
411
+ tester.view.viewInsets = fakePadding;
412
+ tester.view.padding = fakePadding;
413
+
414
+ await setupMessageListPage (tester, narrow: const CombinedFeedNarrow (),
415
+ messages: [
416
+ eg.streamMessage (content: ContentExample .codeBlockPlain.html),
417
+ eg.streamMessage (),
418
+ ]);
419
+
420
+ // Verify this message list lacks a compose box.
421
+ // (The original bug wouldn't reproduce with a compose box present.)
422
+ final state = MessageListPage .ancestorOf (tester.element (find.text ("verb\n atim" )));
423
+ check (state.composeBoxState).isNull ();
424
+ // Also verify that the first message is in the top sliver.
425
+ check (state.model! .middleMessage).equals (1 );
426
+
427
+ final element = tester.element (find.byType (CodeBlock ));
428
+ final padding = MediaQuery .of (element).padding;
429
+ check (padding).equals (EdgeInsets .zero);
430
+ });
431
+
432
+ testWidgets ('content not asked to consume insets (including bottom), even without compose box, in bottom sliver' , (tester) async {
409
433
// Regression test for: https://github.com/zulip/zulip-flutter/issues/736
410
434
const fakePadding = FakeViewPadding (left: 10 , top: 10 , right: 10 , bottom: 10 );
411
435
tester.view.viewInsets = fakePadding;
@@ -418,6 +442,8 @@ void main() {
418
442
// (The original bug wouldn't reproduce with a compose box present.)
419
443
final state = MessageListPage .ancestorOf (tester.element (find.text ("verb\n atim" )));
420
444
check (state.composeBoxState).isNull ();
445
+ // Also verify that the message is in the bottom sliver.
446
+ check (state.model! .middleMessage).equals (0 );
421
447
422
448
final element = tester.element (find.byType (CodeBlock ));
423
449
final padding = MediaQuery .of (element).padding;
0 commit comments