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:
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user