-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Add test for undo_history_controller.0.dart #148205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test for undo_history_controller.0.dart #148205
Conversation
|
Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change). If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
| expect(find.widgetWithText(TextButton, 'Redo'), findsOne); | ||
|
|
||
| await tester.enterText(find.byType(TextField), '1st change'); | ||
| await tester.pump(const Duration(milliseconds: 500)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: is there a constant that we can use for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The constant is private 😕
flutter/packages/flutter/lib/src/widgets/undo_history.dart
Lines 90 to 99 in dafce76
| class UndoHistoryState<T> extends State<UndoHistory<T>> with UndoManagerClient { | |
| final _UndoStack<T> _stack = _UndoStack<T>(); | |
| late final _Throttled<T> _throttledPush; | |
| Timer? _throttleTimer; | |
| bool _duringTrigger = false; | |
| // This duration was chosen as a best fit for the behavior of Mac, Linux, | |
| // and Windows undo/redo state save durations, but it is not perfect for any | |
| // of them. | |
| static const Duration _kThrottleDuration = Duration(milliseconds: 500); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the link! I think you can make a similar constant directly in the test file with some comments, just so people know what the value 500ms signifies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of refactor: Add a const for duration ? Did you have a better comment in mind?
Renzo-Olivares
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you for the contribution!
QuncCccccc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM:) Thanks for your contribution!
…pdate * master: (92 commits) Add tests for actions.0.dart API example. (flutter#148678) Introduce `WidgetStateBorderSide.lerp` (flutter#148122) add `default-flavor` field to flutter pubspec, which will be used as the flavor in `flutter build/run` if `--flavor` is not provided (flutter#147968) [wiki migration] Pages under docs/postmortems/ (flutter#148798) Roll Flutter Engine from e5a73e520e89 to c89defa55801 (2 revisions) (flutter#148812) Make hover tests functional and cleanup mouse pointers in Material toggleables (flutter#148808) Fix two dimensional viewport unexpected null exception when no child is laid out (flutter#148256) Roll Flutter Engine from bc1345b6b50a to e5a73e520e89 (3 revisions) (flutter#148807) Add test for undo_history_controller.0.dart (flutter#148205) Roll Flutter Engine from a8872c8915a2 to bc1345b6b50a (6 revisions) (flutter#148802) Fix test that leaks images. (flutter#148494) Fix warnings in `dependency_version_checker.gradle.kts` (flutter#148699) [wiki migration] Android team pages (flutter#148585) Fix leaky test. (flutter#148788) Add DropdownButton.menuWidth (flutter#148125) Add test for focus example 2 (flutter#147624) Add a migrator to remove `FlutterMultiDexApplication.java` (flutter#148515) [wiki migration] Infra team pages (flutter#148718) Roll Flutter Engine from 8a352f01e503 to a8872c8915a2 (1 revision) (flutter#148776) Fix the output of the CDN test. (flutter#148730) ...
* master: (29 commits) Add tests for actions.0.dart API example. (flutter#148678) Introduce `WidgetStateBorderSide.lerp` (flutter#148122) add `default-flavor` field to flutter pubspec, which will be used as the flavor in `flutter build/run` if `--flavor` is not provided (flutter#147968) [wiki migration] Pages under docs/postmortems/ (flutter#148798) Roll Flutter Engine from e5a73e520e89 to c89defa55801 (2 revisions) (flutter#148812) Make hover tests functional and cleanup mouse pointers in Material toggleables (flutter#148808) Fix two dimensional viewport unexpected null exception when no child is laid out (flutter#148256) Roll Flutter Engine from bc1345b6b50a to e5a73e520e89 (3 revisions) (flutter#148807) Add test for undo_history_controller.0.dart (flutter#148205) Roll Flutter Engine from a8872c8915a2 to bc1345b6b50a (6 revisions) (flutter#148802) Fix test that leaks images. (flutter#148494) Fix warnings in `dependency_version_checker.gradle.kts` (flutter#148699) [wiki migration] Android team pages (flutter#148585) Fix leaky test. (flutter#148788) Add DropdownButton.menuWidth (flutter#148125) Add test for focus example 2 (flutter#147624) Add a migrator to remove `FlutterMultiDexApplication.java` (flutter#148515) [wiki migration] Infra team pages (flutter#148718) Roll Flutter Engine from 8a352f01e503 to a8872c8915a2 (1 revision) (flutter#148776) Fix the output of the CDN test. (flutter#148730) ...
* master: (92 commits) Add tests for actions.0.dart API example. (flutter#148678) Introduce `WidgetStateBorderSide.lerp` (flutter#148122) add `default-flavor` field to flutter pubspec, which will be used as the flavor in `flutter build/run` if `--flavor` is not provided (flutter#147968) [wiki migration] Pages under docs/postmortems/ (flutter#148798) Roll Flutter Engine from e5a73e520e89 to c89defa55801 (2 revisions) (flutter#148812) Make hover tests functional and cleanup mouse pointers in Material toggleables (flutter#148808) Fix two dimensional viewport unexpected null exception when no child is laid out (flutter#148256) Roll Flutter Engine from bc1345b6b50a to e5a73e520e89 (3 revisions) (flutter#148807) Add test for undo_history_controller.0.dart (flutter#148205) Roll Flutter Engine from a8872c8915a2 to bc1345b6b50a (6 revisions) (flutter#148802) Fix test that leaks images. (flutter#148494) Fix warnings in `dependency_version_checker.gradle.kts` (flutter#148699) [wiki migration] Android team pages (flutter#148585) Fix leaky test. (flutter#148788) Add DropdownButton.menuWidth (flutter#148125) Add test for focus example 2 (flutter#147624) Add a migrator to remove `FlutterMultiDexApplication.java` (flutter#148515) [wiki migration] Infra team pages (flutter#148718) Roll Flutter Engine from 8a352f01e503 to a8872c8915a2 (1 revision) (flutter#148776) Fix the output of the CDN test. (flutter#148730) ...
flutter/flutter@d02292d...73bf206 2024-05-22 [email protected] `CupertinoDialogRoute` leak fix (flutter/flutter#148774) 2024-05-22 [email protected] Marks Windows plugin_test to be flaky (flutter/flutter#148835) 2024-05-22 [email protected] Add tests for actions.0.dart API example. (flutter/flutter#148678) 2024-05-22 [email protected] Introduce `WidgetStateBorderSide.lerp` (flutter/flutter#148122) 2024-05-22 [email protected] add `default-flavor` field to flutter pubspec, which will be used as the flavor in `flutter build/run` if `--flavor` is not provided (flutter/flutter#147968) 2024-05-22 [email protected] [wiki migration] Pages under docs/postmortems/ (flutter/flutter#148798) 2024-05-22 [email protected] Roll Flutter Engine from e5a73e520e89 to c89defa55801 (2 revisions) (flutter/flutter#148812) 2024-05-22 [email protected] Make hover tests functional and cleanup mouse pointers in Material toggleables (flutter/flutter#148808) 2024-05-21 [email protected] Fix two dimensional viewport unexpected null exception when no child is laid out (flutter/flutter#148256) 2024-05-21 [email protected] Roll Flutter Engine from bc1345b6b50a to e5a73e520e89 (3 revisions) (flutter/flutter#148807) 2024-05-21 [email protected] Add test for undo_history_controller.0.dart (flutter/flutter#148205) 2024-05-21 [email protected] Roll Flutter Engine from a8872c8915a2 to bc1345b6b50a (6 revisions) (flutter/flutter#148802) 2024-05-21 [email protected] Fix test that leaks images. (flutter/flutter#148494) 2024-05-21 [email protected] Fix warnings in `dependency_version_checker.gradle.kts` (flutter/flutter#148699) 2024-05-21 [email protected] [wiki migration] Android team pages (flutter/flutter#148585) 2024-05-21 [email protected] Fix leaky test. (flutter/flutter#148788) 2024-05-21 [email protected] Add DropdownButton.menuWidth (flutter/flutter#148125) 2024-05-21 [email protected] Add test for focus example 2 (flutter/flutter#147624) 2024-05-21 [email protected] Add a migrator to remove `FlutterMultiDexApplication.java` (flutter/flutter#148515) 2024-05-21 [email protected] [wiki migration] Infra team pages (flutter/flutter#148718) 2024-05-21 [email protected] Roll Flutter Engine from 8a352f01e503 to a8872c8915a2 (1 revision) (flutter/flutter#148776) 2024-05-21 [email protected] Fix the output of the CDN test. (flutter/flutter#148730) 2024-05-21 [email protected] [wiki migration] Release team pages (flutter/flutter#148723) 2024-05-21 [email protected] Remove hidden dependencies on LocalProcessManager (flutter/flutter#148096) 2024-05-21 [email protected] Adds Missing `onHover` & `onFocusChange` for `OutlinedButton.icon` (flutter/flutter#144374) 2024-05-21 [email protected] Adds tests to NestedScrollView examples (flutter/flutter#148170) 2024-05-21 [email protected] Roll Flutter Engine from c2ef01f6f1ab to 8a352f01e503 (18 revisions) (flutter/flutter#148766) 2024-05-21 [email protected] `switch` expressions: finale (flutter/flutter#148711) 2024-05-21 [email protected] [iOS] specify minimum os version for native asset frameworks (flutter/flutter#148504) 2024-05-21 [email protected] Removed brand references from MenuAnchor.dart (flutter/flutter#148760) 2024-05-21 [email protected] Skip flaky test in expression_evaluation_test.dart (flutter/flutter#148737) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Contributes to #130459
It adds test for
examples/api/test/widgets/undo_history/undo_history_controller.0_test.dart.Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.