sa11y
sa11y copied to clipboard
How to ignore certain rules for certain tests
Hi, I am wondering if we can turn off some certain rules for specific tests. For example, there are some accessibility errors happening due to the third-party usage. It is out of our control to fix those errors. We want to skip that check if it is possible
expect(1 issues)toBeAccessible: expected document to have no accessibility violations but found 1 issues:
"⭕ (aria-allowed-attr) Elements must only use allowed ARIA attributes: #popover-trigger-\\:rb\\:"
🔗 Help URL: https://dequeuniversity.com/rules/axe/4.7/aria-allowed-attr
🔗 WCAG Criteria: SA11Y-WCAG-SC4.1.2-P1(0 issues)
130 | })
131 | // To test using all rules provided by axe
> 132 | await expect(container).toBeAccessible(full)
| ^
133 | })
134 |
135 | /**
Something like jest-axe
config? https://www.npmjs.com/package/jest-axe#setting-global-configuration