From ae0db7c491bb8a0b6f45d60d8ac68ecb9de79ebf Mon Sep 17 00:00:00 2001 From: Maurice Date: Fri, 26 Jun 2026 22:25:02 +0200 Subject: [PATCH] test(setup): stub websocket addListener/removeListener in the global mock BackgroundTasksWidget (mounted globally in App) subscribes via addListener/removeListener from api/websocket, but the global test mock didn't export them, so every test that renders threw on mount. Add the two stubs. (Surfaced now that the page-pattern check passes and the client test step actually runs.) --- client/tests/setup.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/tests/setup.ts b/client/tests/setup.ts index 0c0fc012..4455d6fe 100644 --- a/client/tests/setup.ts +++ b/client/tests/setup.ts @@ -11,6 +11,8 @@ vi.mock('../src/api/websocket', () => ({ getSocketId: vi.fn(() => null), setRefetchCallback: vi.fn(), setPreReconnectHook: vi.fn(), + addListener: vi.fn(), + removeListener: vi.fn(), })); // MSW lifecycle