Skip to content

Conversation

@HansMuller
Copy link
Contributor

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.

Copy link
Contributor

@johnsonmh johnsonmh left a 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Default, not disabled
// Default, not disabled.

https://www.dartlang.org/guides/language/effective-dart/documentation#do-format-comments-like-sentences

Copy link
Contributor

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Highlighted (pressed)
// Highlighted (pressed).

https://www.dartlang.org/guides/language/effective-dart/documentation#do-format-comments-like-sentences

// 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

https://www.dartlang.org/guides/language/effective-dart/documentation#do-format-comments-like-sentences

});
}

PhysicalModelLayer _findPhysicalLayer(Element element) {
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@HansMuller HansMuller merged commit 73957b9 into flutter:master May 3, 2019
@HansMuller HansMuller deleted the button_contrast_test branch May 3, 2019 23:13
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants