-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Add test for material_state_property.0.dart
#156719
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 material_state_property.0.dart
#156719
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.
Thanks for the contribution !
See my comment about the finder vs helper.
| const example.MaterialStatePropertyExampleApp(), | ||
| ); | ||
|
|
||
| expect(findForegroundColor(Colors.red), 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.
Using a finder here feels somewhat unintuitive to me.
Maybe a helper function such as getButtonForegroundColor and an expect such as expect(getButtonForegroundColor(), Colors.red) would be easier to understand?
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.
Sure! What do you think of revamp: Change findForegroundColor into getButtonForegroundColor?
| ); | ||
|
|
||
| testWidgets( | ||
| 'The foreground color of the TextButton should blue when hovered', |
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 foreground color of the TextButton should blue when hovered', | |
| 'The foreground color of the TextButton should be blue when hovered', |
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!
You should propably rebase to fix the failing CI check.
1670c7f to
eb9c756
Compare
Contributes to #130459
It adds a test for
examples/api/test/material/material_state/material_state_property.0_test.dartPre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.