Skip to content
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

tests: relax contrast font size expectation #9441

Merged
merged 1 commit into from
Jul 24, 2019
Merged

Conversation

brendankenny
Copy link
Member

yarn smoke a11y fails in color-contrast on the Mac because the font size is different than Linux and the stricter expectations introduced in #8961 work on Linux :)

This loosens up the requirement, which is fine because this is just the explanation string, not what the audit was testing.

@@ -153,7 +153,8 @@ module.exports = [
'type': 'node',
'selector': '#color-contrast',
'snippet': '<div id="color-contrast" style="background-color: red; color: pink;">\n Hello\n </div>',
'explanation': 'Fix any of the following:\n Element has insufficient color contrast of 2.59 (foreground color: #ffc0cb, background color: #ff0000, font size: 28.5pt, font weight: normal). Expected contrast ratio of 3:1',
// Default font size is different depending on the platform (e.g. 28.5 on travis, 30.0 on Mac), so use \d\d\.\d.
'explanation': /^Fix any of the following:\n {2}Element has insufficient color contrast of 2\.59 \(foreground color: #ffc0cb, background color: #ff0000, font size: \d\d\.\dpt, font weight: normal\). Expected contrast ratio of 3:1$/,
Copy link
Member Author

Choose a reason for hiding this comment

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

the {2} is because we apparently have an eslint rule for not allowing multiple spaces in a row 🤷‍♀

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants