mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-23 06:58:33 +08:00
7322aa6f5f
This reverts commit 6759887c44
.
16 lines
510 B
TypeScript
16 lines
510 B
TypeScript
import { render } from '@testing-library/react';
|
|
import { axe } from 'jest-axe';
|
|
import React from 'react';
|
|
|
|
// eslint-disable-next-line jest/no-export
|
|
export default function accessibilityTest(Component: React.ComponentType) {
|
|
describe(`accessibility`, () => {
|
|
it(`component does not have any violations`, async () => {
|
|
jest.useRealTimers();
|
|
const { container } = render(<Component />);
|
|
const results = await axe(container);
|
|
expect(results).toHaveNoViolations();
|
|
});
|
|
});
|
|
}
|