2026-01-06 12:21:33 +03:00
|
|
|
import * as matchers from '@testing-library/jest-dom/matchers';
|
|
|
|
|
import { cleanup } from '@testing-library/svelte';
|
|
|
|
|
import {
|
|
|
|
|
afterEach,
|
|
|
|
|
expect,
|
2026-01-08 13:14:04 +03:00
|
|
|
vi,
|
2026-01-06 12:21:33 +03:00
|
|
|
} from 'vitest';
|
|
|
|
|
|
2026-01-08 13:14:04 +03:00
|
|
|
// Import Tailwind CSS styles for component tests
|
|
|
|
|
import '$app/styles/app.css';
|
|
|
|
|
|
2026-01-06 12:21:33 +03:00
|
|
|
expect.extend(matchers);
|
|
|
|
|
|
|
|
|
|
afterEach(() => {
|
|
|
|
|
cleanup();
|
|
|
|
|
});
|
2026-01-08 13:14:04 +03:00
|
|
|
|
|
|
|
|
// Mock window.matchMedia for components that use it
|
|
|
|
|
Object.defineProperty(window, 'matchMedia', {
|
|
|
|
|
writable: true,
|
|
|
|
|
value: vi.fn().mockImplementation((query: string) => ({
|
|
|
|
|
matches: false,
|
|
|
|
|
media: query,
|
|
|
|
|
onchange: null,
|
|
|
|
|
addListener: vi.fn(),
|
|
|
|
|
removeListener: vi.fn(),
|
|
|
|
|
addEventListener: vi.fn(),
|
|
|
|
|
removeEventListener: vi.fn(),
|
|
|
|
|
dispatchEvent: vi.fn(),
|
|
|
|
|
})),
|
|
|
|
|
});
|