mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-08-02 04:45:21 +00:00
Loading quota label matches sibling skeleton labels (Sentence case); matchMedia test stub deduped into lib/testMatchMedia. 253/253, typecheck + build green.
15 lines
484 B
TypeScript
15 lines
484 B
TypeScript
import { vi } from 'vitest'
|
|
|
|
/** Test-only matchMedia stub: every query reports the given `matches` value. */
|
|
export function mockMatchMedia(matches: boolean): void {
|
|
window.matchMedia = vi.fn().mockImplementation((query: string) => ({
|
|
matches,
|
|
media: query,
|
|
onchange: null,
|
|
addEventListener: vi.fn(),
|
|
removeEventListener: vi.fn(),
|
|
addListener: vi.fn(),
|
|
removeListener: vi.fn(),
|
|
dispatchEvent: vi.fn(),
|
|
})) as unknown as typeof window.matchMedia
|
|
}
|