mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-23 17:40:23 +03:00
15 lines
452 B
TypeScript
15 lines
452 B
TypeScript
|
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([]);
|
||
|
};
|