Add global search

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2022-08-26 16:08:58 +02:00
parent bfc936f57c
commit 48935e2168
216 changed files with 3646 additions and 2806 deletions

View File

@@ -1,6 +1,6 @@
import { vi } from "vitest";
window.matchMedia = vi.fn().mockImplementation((query) => ({
vi.stubGlobal("matchMedia", (query: string) => ({
matches: false,
media: query,
onchange: null,
@@ -10,17 +10,3 @@ window.matchMedia = vi.fn().mockImplementation((query) => ({
removeEventListener: vi.fn(),
dispatchEvent: vi.fn(),
}));
// 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(),
// })),
// });