Skip to content

Conversation

MdSaifAliMolla
Copy link

closes #1668

@MdSaifAliMolla MdSaifAliMolla force-pushed the test branch 3 times, most recently from 2ea25f6 to 0de6501 Compare October 14, 2025 15:50
@gnprice
Copy link
Member

gnprice commented Oct 15, 2025

Thanks. Some of these changes look good, but there are other places where a lot more code is getting changed and it's not obvious what the reasons for those changes are. That makes it considerably more work for someone to review, because they have to read through all those changes and reverse-engineer what your intent is.

Please take a look at our guide to writing a clean commit history:
https://zulip.readthedocs.io/en/latest/contributing/commit-discipline.html#write-a-clean-commit-history
and then try using those ideas to make this PR an efficient one for someone to review. So:

  • avoid any changes that aren't relevant;
  • and if there are places where you think a more complex change is needed, make that a separate commit with a commit message explaining why.

@MdSaifAliMolla MdSaifAliMolla force-pushed the test branch 2 times, most recently from 303dcc8 to bfa6bb4 Compare October 15, 2025 07:42
@MdSaifAliMolla
Copy link
Author

@gnprice I guess it's fine now.

@gnprice
Copy link
Member

gnprice commented Oct 15, 2025

This is improved, but there are still some places like this:

where a lot more code is getting changed and it's not obvious what the reasons for those changes are. That makes it considerably more work for someone to review, because they have to read through all those changes and reverse-engineer what your intent is.

For example:

-      testWidgets('can show snackbar on success', (tester) async {
-        // Regression test for: https://github.com/zulip/zulip-flutter/issues/732
-        testBinding.deviceInfoResult = const IosDeviceInfo(systemVersion: '16.0');
-
-        final message = eg.streamMessage();
-        await setupToMessageActionSheet(tester, message: message, narrow: TopicNarrow.ofMessage(messa
ge));
+    testWidgets('can show snackbar on success', (WidgetTester tester) async {
+      // Regression test for: https://github.com/zulip/zulip-flutter/issues/732
+      final TransitionDurationObserver transitionDurationObserver = TransitionDurationObserver();
+      await tester.pumpWidget(
+        MaterialApp(
+          navigatorObservers: <NavigatorObserver>[transitionDurationObserver],
+          home: Scaffold(
+            body: Builder(
+              builder: (context) {
+                testBinding.deviceInfoResult = const IosDeviceInfo(systemVersion: '16.0');
+                final message = eg.streamMessage();
+                setupToMessageActionSheet(tester,message: message,narrow: TopicNarrow.ofMessage(messa
ge));
+                return const SizedBox.shrink();}
+            ))));
+      final message = eg.streamMessage();
+       // Make the request take a bit of time to complete
+      prepareRawContentResponseSuccess(message: message,rawContent: 'Hello world',delay: const Durati
on(milliseconds: 500),
+      );
+      await tapCopyMessageTextButton(tester);
+      // … and pump a frame to finish the NavigationState.pop animation…
+      await transitionDurationObserver.pumpPastTransition(tester);
+      // … before the request finishes.  This is the repro condition for #732.
+      await transitionDurationObserver.pumpPastTransition(tester);
 
-        // Make the request take a bit of time to complete…
-        prepareRawContentResponseSuccess(message: message, rawContent: 'Hello world',
-          delay: const Duration(milliseconds: 500));
-        await tapCopyMessageTextButton(tester);
-        // … and pump a frame to finish the NavigationState.pop animation…
-        await tester.pump(const Duration(milliseconds: 250));
-        // … before the request finishes.  This is the repro condition for #732.
-        await tester.pump(const Duration(milliseconds: 250));
+      final snackbar = tester.widget<SnackBar>(find.byType(SnackBar));
+      check(snackbar.behavior).equals(SnackBarBehavior.floating);
 
-        final snackbar = tester.widget<SnackBar>(find.byType(SnackBar));
-        check(snackbar.behavior).equals(SnackBarBehavior.floating);
-        final zulipLocalizations = GlobalLocalizations.zulipLocalizations;
-        tester.widget(find.descendant(matchRoot: true,
+      final zulipLocalizations = GlobalLocalizations.zulipLocalizations;
+      tester.widget(find.descendant(matchRoot: true,
           of: find.byWidget(snackbar.content),
-          matching: find.text(zulipLocalizations.successMessageTextCopied)));
-      });
+          matching: find.text(zulipLocalizations.successMessageTextCopied),
+        ));
+    });
+

Take a look again at the changes in your PR. Use git log -p, or a graphical Git viewer, to see exactly what changes you have. Then please revise to accomplish this as far as you can:

[…] to make this PR an efficient one for someone to review. So:

  • avoid any changes that aren't relevant;
  • and if there are places where you think a more complex change is needed, make that a separate commit with a commit message explaining why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tests: Get route-transition duration robustly, instead of hard-coding

2 participants