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