Testing · Middle · Question 70 of 75
How can automated accessibility checks be added to component tests?
const { container } = render(<Form />);
expect(await axe(container)).toHaveNoViolations();- ✓Correct answer: With jest-axe (axe-core) - it catches part of the issues, like missing labels and wrong ARIA
- 2It's impossible outside a real browser
- 3With snapshot tests
Explanation
Automated tools find roughly a third of a11y problems; keyboard and screen-reader checks are still needed.