import "@testing-library/jest-dom"; import "./__mocks__/resizeObserver"; // Mock PointerEvent if not available in JSDOM if (typeof global.PointerEvent === "undefined") { class PointerEvent extends MouseEvent { pointerId: number; pointerType: string; isPrimary: boolean; constructor(type: string, params: PointerEventInit = {}) { super(type, params); this.pointerId = params.pointerId || 0; this.pointerType = params.pointerType || "mouse"; this.isPrimary = params.isPrimary || false; } } global.PointerEvent = PointerEvent as typeof global.PointerEvent; } // Mock window.matchMedia Object.defineProperty(window, "matchMedia", { writable: true, value: jest.fn().mockImplementation((query) => ({ matches: false, media: query, onchange: null, addListener: jest.fn(), // Deprecated removeListener: jest.fn(), // Deprecated addEventListener: jest.fn(), removeEventListener: jest.fn(), dispatchEvent: jest.fn(), })), });