-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Test Material buttons against a11y contrast guidelines #32050
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
Conversation
johnsonmh
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
| ), | ||
| ); | ||
|
|
||
| // Default, not disabled |
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.
| // Default, not disabled | |
| // Default, not disabled. |
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.
(Here and below)
| // Default, not disabled | ||
| await expectLater(tester, meetsGuideline(textContrastGuideline)); | ||
|
|
||
| // Highlighted (pressed) |
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.
| // Highlighted (pressed) | |
| // Highlighted (pressed). |
| // Highlighted (pressed) | ||
| final Offset center = tester.getCenter(find.byType(FlatButton)); | ||
| await tester.startGesture(center); | ||
| await tester.pump(const Duration(milliseconds: 200)); // wait for splash to be well under way |
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.
| await tester.pump(const Duration(milliseconds: 200)); // wait for splash to be well under way | |
| await tester.pump(const Duration(milliseconds: 200)); // Wait for splash to be well under way. |
| }); | ||
| } | ||
|
|
||
| PhysicalModelLayer _findPhysicalLayer(Element element) { |
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.
these were just renamed and moved right? No functionality change?
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.
That's right. They were jammed at the top of main() with the wrong indent. We usually stick helpers like this at the end of test files and often (not always) use file-private names. That's all I did here.
Added a11y constrast guideline unit tests for the default configurations of RaisedButton, OutlineButton, FlatButton, and MaterialButton.
Made a few additional gratuitous cosmetic changes to the button tests.