add unit tests
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2026-02-24 11:33:37 +01:00
parent e17c82de2f
commit 4fc3738adf
19 changed files with 1427 additions and 10 deletions

15
tests/setup.ts Normal file
View File

@@ -0,0 +1,15 @@
// Required by React to silence act(...) warnings in jsdom tests.
globalThis.IS_REACT_ACT_ENVIRONMENT = true;
import '@testing-library/jest-dom/vitest';
import { cleanup } from '@testing-library/react';
import { afterEach, vi } from 'vitest';
vi.mock('@mdxeditor/editor', () => import('./mocks/mdxeditor'));
afterEach(() => {
cleanup();
localStorage.clear();
vi.restoreAllMocks();
vi.useRealTimers();
});