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

test(Checkbox): add accessibility unit tests and docs #7422

Merged

Conversation

dakahn
Copy link
Contributor

@dakahn dakahn commented Dec 8, 2020

Closes #7364

  • adds automated testing with Axe and Accessibility Checker
  • adds WCAG accessibility unit tests
  • adds manual testing documentation

Testing / Reviewing

run yarn test Checkbox-test.js and see that there are no errors

@dakahn dakahn requested a review from a team as a code owner December 8, 2020 20:39
packages/react/src/components/Checkbox/Checkbox-test.js Outdated Show resolved Hide resolved

it('should have no Axe violationk', async () => {
render(<Checkbox labelText="Checkbox label" id="test_id" />);
await expect(screen.getByText('Checkbox label')).toHaveNoAxeViolations();
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this check the whole checkbox component or the node that this text is inside? (Or does this selector get both? lol)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah! great catch. I was using the wrong selector query there and it was returning just the span with that text in it 🤦🏽

.getByLabelText() is what I wanted here which returns
image

packages/react/src/components/Checkbox/Checkbox-test.js Outdated Show resolved Hide resolved
packages/react/src/components/Checkbox/Checkbox-test.js Outdated Show resolved Hide resolved
@netlify
Copy link

netlify bot commented Dec 8, 2020

✔️ Deploy preview for carbon-elements ready!

🔨 Explore the source changes: ea0c108

🔍 Inspect the deploy logs: https://app.netlify.com/sites/carbon-elements/deploys/5fd7a860d34cbf00080234a0

😎 Browse the preview: https://deploy-preview-7422--carbon-elements.netlify.app

@netlify
Copy link

netlify bot commented Dec 8, 2020

Deploy preview for carbon-components-react ready!

Built with commit 8cd37a0

https://deploy-preview-7422--carbon-components-react.netlify.app

@netlify
Copy link

netlify bot commented Dec 8, 2020

Deploy preview for carbon-components-react ready!

Built with commit ea59621

https://deploy-preview-7422--carbon-components-react.netlify.app

@netlify
Copy link

netlify bot commented Dec 8, 2020

Deploy preview for carbon-components-react ready!

Built without sensitive environment variables with commit ea0c108

https://deploy-preview-7422--carbon-components-react.netlify.app

Co-authored-by: Josh Black <josh@josh.black>
Copy link
Contributor

@andreancardona andreancardona left a comment

Choose a reason for hiding this comment

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

@dakahn looks good!

@kodiakhq kodiakhq bot merged commit bdb4a9c into carbon-design-system:master Dec 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update/overhaul Checkbox accessibiltiy testing
3 participants