-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Add test for segmented_button.0.dart #150676
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 segmented_button.0.dart #150676
Conversation
bleroux
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 with nits.
| await tester.pumpWidget( | ||
| const example.SegmentedButtonApp(), | ||
| ); | ||
|
|
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.
Not sure it will be more readable, maybe use a helper to avoid repeating the verbose expect?
| void expectOneCalendarButton(example.Calendar period) { | |
| expect( | |
| find.byWidgetPredicate( | |
| (Widget widget) => widget is SegmentedButton<example.Calendar> && setEquals(widget.selected, <example.Calendar>{period}), | |
| ), | |
| findsOne, | |
| ); | |
| } | |
| expect(find.byWidgetPredicate( | ||
| (Widget widget) => widget is SegmentedButton<example.Calendar> && setEquals(widget.selected, const <example.Calendar>{example.Calendar.day}), | ||
| ), findsOne); | ||
|
|
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.
Remove extra line
|
|
||
| }); | ||
|
|
||
| testWidgets('Segmented button can be used for with a multiple selection', (WidgetTester tester) async { |
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.
Typo 'for with'
| import 'package:flutter_test/flutter_test.dart'; | ||
|
|
||
| void main() { | ||
| testWidgets('Segmented button can be used for with a single selection', (WidgetTester tester) async { |
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.
typo 'for with'
|
Thank you for the review @bleroux, everything should be fixed in refactor: Use helper |
TahaTesser
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
flutter/flutter@651a17d...99bb2ff 2024-07-01 [email protected] Roll Flutter Engine from 0d93da7e2fe1 to b57a044ed10f (1 revision) (flutter/flutter#151082) 2024-06-30 [email protected] Roll Flutter Engine from ad1343cfb99e to 0d93da7e2fe1 (9 revisions) (flutter/flutter#151062) 2024-06-29 [email protected] Reduce the depth used in a test that applies finders to deep widget trees (flutter/flutter#151049) 2024-06-29 [email protected] Roll Flutter Engine from f828363d03ff to ad1343cfb99e (3 revisions) (flutter/flutter#151016) 2024-06-29 [email protected] Add test for segmented_button.0.dart (flutter/flutter#150676) 2024-06-29 [email protected] Roll pub packages (flutter/flutter#151022) 2024-06-29 [email protected] Roll pub packages (flutter/flutter#150827) 2024-06-28 [email protected] Roll Flutter Engine from 2f7e9ab27493 to f828363d03ff (3 revisions) (flutter/flutter#151013) 2024-06-28 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 3.25.10 to 3.25.11 (flutter/flutter#151012) 2024-06-28 [email protected] [tool] when writing to openssl as a part of macOS/iOS code-signing, flush the stdin stream before closing it (flutter/flutter#150120) 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 flutter#130459 It adds a test for - `examples/api/test/material/segmented_button/segmented_button.0_test.dart`
Contributes to #130459
It adds a test for
examples/api/test/material/segmented_button/segmented_button.0_test.dartPre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.