NickColley / jest-axe

Custom Jest matcher for aXe for testing accessibility ♿️🃏
MIT License
1.06k stars 54 forks source link

`aria-hidden-focus` rule it is not showing an error #279

Closed Luccasoli closed 8 months ago

Luccasoli commented 10 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();
  });

image

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",
}
NickColley commented 8 months ago

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