diff --git a/tests/integration/online-board/start-page.test.tsx b/tests/integration/online-board/start-page.test.tsx index 11a3cee7..709e9990 100644 --- a/tests/integration/online-board/start-page.test.tsx +++ b/tests/integration/online-board/start-page.test.tsx @@ -65,6 +65,30 @@ vi.mock("@/ui/city-autocomplete/index.js", () => ({ describe("Start page integration", () => { beforeEach(() => { vi.clearAllMocks(); + + // Stub matchMedia for useIsMobileViewport (jsdom doesn't implement it). + Object.defineProperty(window, "matchMedia", { + value: vi.fn().mockImplementation((query: string) => ({ + matches: false, + media: query, + addEventListener: () => {}, + removeEventListener: () => {}, + dispatchEvent: () => false, + })), + configurable: true, + }); + + // Stub geolocation for useGeoCityDefault (jsdom doesn't implement it). + Object.defineProperty(navigator, "geolocation", { + value: { + getCurrentPosition: vi.fn().mockImplementation( + (_s: PositionCallback, onErr: PositionErrorCallback) => { + onErr({ code: 1, message: "denied" } as GeolocationPositionError); + }, + ), + }, + configurable: true, + }); }); it("renders the page layout with data-testid", () => {