mirror of
https://github.com/kjanat/livedash-node.git
synced 2026-01-16 13:32:08 +01:00
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:
@ -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(),
|
||||
})),
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user