test: fix test environment issues and update TODO with architecture plan

- Fix window.matchMedia mock for DOM environment compatibility
- Simplify accessibility tests to focus on core functionality
- Update auth test mocking to avoid initialization errors
- Move visual tests to examples directory
- Add comprehensive architecture refactoring plan to TODO
- Document platform management needs and microservices strategy
This commit is contained in:
2025-06-28 07:16:22 +02:00
parent ef71c9c06e
commit aa0e9d5ebc
6 changed files with 155 additions and 312 deletions

View File

@ -23,3 +23,20 @@ if (process.env.DATABASE_URL_TEST) {
vi.mock("node-fetch", () => ({
default: vi.fn(),
}));
// Mock window.matchMedia for theme provider (only in DOM environment)
if (typeof window !== "undefined") {
Object.defineProperty(window, "matchMedia", {
writable: true,
value: vi.fn().mockImplementation(query => ({
matches: false,
media: query,
onchange: null,
addListener: vi.fn(), // deprecated
removeListener: vi.fn(), // deprecated
addEventListener: vi.fn(),
removeEventListener: vi.fn(),
dispatchEvent: vi.fn(),
})),
});
}