(elements: React.ReactElement[], axeOptions?: any)
| 15 | }; |
| 16 | |
| 17 | export function axe(elements: React.ReactElement[], axeOptions?: any) { |
| 18 | expect.extend(toHaveNoViolations); |
| 19 | |
| 20 | it('has no accessibility violations', async () => { |
| 21 | for (const element of elements) { |
| 22 | const { container } = await renderWithAct(element); |
| 23 | const combinedConfig = { |
| 24 | ...config, |
| 25 | ...axeOptions, |
| 26 | rules: { |
| 27 | ...config.rules, |
| 28 | ...(axeOptions?.rules || {}), |
| 29 | }, |
| 30 | }; |
| 31 | const result = await Axe(container, combinedConfig); |
| 32 | expect(result).toHaveNoViolations(); |
| 33 | } |
| 34 | }, 30000); |
| 35 | } |
no test coverage detected