fix(web/m7-362): repair Vitest fixtures (matchMedia.fire, listenbrainz mock)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-03 18:48:20 -04:00
parent f8684f0034
commit 66f651cf5c
2 changed files with 31 additions and 11 deletions
+8 -1
View File
@@ -20,7 +20,14 @@ function setupMatchMedia(prefersLight: boolean) {
vi.stubGlobal('window', {
matchMedia: () => mql
});
return { mql, listeners, fire: (matches: boolean) => listeners.forEach((cb) => cb({ matches })) };
return {
mql,
listeners,
fire: (matches: boolean) => {
mql.matches = matches;
listeners.forEach((cb) => cb({ matches }));
}
};
}
beforeEach(() => {