@@ -476,25 +476,23 @@ void main() {
476
476
check (await Clipboard .getData ('text/plain' )).isNotNull ().text.equals ('Hello world' );
477
477
});
478
478
479
- testWidgets ('success with a snackbar' , (tester) async {
480
- // for #732 regression check below
479
+ testWidgets ('can show snackbar on success ' , (tester) async {
480
+ // Regression test for: https://github.com/zulip/zulip-flutter/issues/732
481
481
testBinding.deviceInfoResult = IosDeviceInfo (systemVersion: '16.0' );
482
482
483
483
final message = eg.streamMessage ();
484
484
await setupToMessageActionSheet (tester, message: message, narrow: TopicNarrow .ofMessage (message));
485
485
final store = await testBinding.globalStore.perAccount (eg.selfAccount.id);
486
486
487
- prepareRawContentResponseSuccess (store,
488
- message: message,
489
- rawContent: 'Hello world' ,
487
+ // Make the request take a bit of time to complete…
488
+ prepareRawContentResponseSuccess (store, message: message, rawContent: 'Hello world' ,
490
489
delay: const Duration (milliseconds: 500 ));
491
-
492
490
await tapCopyMessageTextButton (tester);
493
- for (int i = 0 ; i < 5 ; i++ ) {
494
- await tester.pump (const Duration (milliseconds: 100 ));
495
- }
491
+ // … and pump a frame to finish the NavigationState.pop animation…
492
+ await tester.pump (const Duration (milliseconds: 250 ));
493
+ // … before the request finishes. This is the repro condition for #732.
494
+ await tester.pump (const Duration (milliseconds: 250 ));
496
495
497
- // regression check for #732
498
496
final snackbar = tester.widget <SnackBar >(find.byType (SnackBar ));
499
497
check (snackbar.behavior).equals (SnackBarBehavior .floating);
500
498
final zulipLocalizations = GlobalLocalizations .zulipLocalizations;
0 commit comments