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