mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-10 09:33:51 +00:00
Add first accessibility tests
This commit is contained in:
14
test/__helpers__/accessibility.ts
Normal file
14
test/__helpers__/accessibility.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { screen } from '@testing-library/react';
|
||||
import { run } from 'axe-core';
|
||||
|
||||
type ContainerWrapper = { container: HTMLElement };
|
||||
|
||||
type AccessibilityTestSubject = ContainerWrapper | Promise<ContainerWrapper>;
|
||||
|
||||
export const checkAccessibility = async (subject: AccessibilityTestSubject) => {
|
||||
const { container } = await subject;
|
||||
screen.debug(container);
|
||||
const { violations } = await run(container);
|
||||
|
||||
expect(violations).toStrictEqual([]);
|
||||
};
|
||||
Reference in New Issue
Block a user