Closed Luccasoli closed 8 months ago
The tested code:
it.only('Should not have any accessibility violations', async () => { (useIsMobile as jest.Mock).mockReturnValue(false); expect.extend(toHaveNoViolations); const { container } = render( <div aria-hidden='true'> <input aria-disabled='true' /> </div> ); const results = await axe(container, { rules: { 'aria-hidden-focus': { enabled: true }, }, }); expect(results).toHaveNoViolations(); });
libs versions:
{ "@types/jest-axe": "^3.5.9", "jest-axe": "^6.0.1", "@testing-library/dom": "^9.3.1", "@testing-library/jest-dom": "^5.16.4", "@testing-library/react": "^12.1.4", }
Please raise axe-core related issues with axe-core, if you find it's an issue with jest-axe itself then feel free to re-open later :)
https://github.com/dequelabs/axe-core
The tested code:
libs versions: