mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-23 17:40:23 +03:00
13 lines
376 B
TypeScript
13 lines
376 B
TypeScript
|
import { run } from 'axe-core';
|
||
|
|
||
|
type ContainerWrapper = { container: HTMLElement };
|
||
|
|
||
|
type AccessibilityTestSubject = ContainerWrapper | Promise<ContainerWrapper>;
|
||
|
|
||
|
export const checkAccessibility = async (subject: AccessibilityTestSubject) => {
|
||
|
const { container } = await subject;
|
||
|
const { violations } = await run(container);
|
||
|
|
||
|
expect(violations).toStrictEqual([]);
|
||
|
};
|