2023-09-30 11:20:28 +03:00
|
|
|
import 'vitest-canvas-mock';
|
2023-08-15 10:53:28 +03:00
|
|
|
import '@testing-library/jest-dom/vitest';
|
2023-05-27 12:36:18 +03:00
|
|
|
import { cleanup } from '@testing-library/react';
|
2023-09-30 11:20:28 +03:00
|
|
|
import axe from 'axe-core';
|
2023-08-15 10:53:28 +03:00
|
|
|
import { afterEach } from 'vitest';
|
2023-05-27 12:36:18 +03:00
|
|
|
|
2023-09-30 11:20:28 +03:00
|
|
|
axe.configure({
|
|
|
|
checks: [
|
|
|
|
{
|
|
|
|
// Disable color contrast checking, as it doesn't work in jsdom
|
|
|
|
id: 'color-contrast',
|
|
|
|
enabled: false,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
});
|
|
|
|
|
2023-08-14 13:15:57 +03:00
|
|
|
// Clear all mocks and cleanup DOM after every test
|
2023-05-27 12:36:18 +03:00
|
|
|
afterEach(() => {
|
2023-05-27 13:29:03 +03:00
|
|
|
vi.clearAllMocks();
|
2023-05-27 12:36:18 +03:00
|
|
|
cleanup();
|
|
|
|
});
|
|
|
|
|
|
|
|
(global as any).scrollTo = () => {};
|