mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-06-30 18:46:00 +00:00
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 <App/> threw on mount. Add the two stubs. (Surfaced now that the page-pattern check passes and the client test step actually runs.)
This commit is contained in:
@@ -11,6 +11,8 @@ vi.mock('../src/api/websocket', () => ({
|
|||||||
getSocketId: vi.fn(() => null),
|
getSocketId: vi.fn(() => null),
|
||||||
setRefetchCallback: vi.fn(),
|
setRefetchCallback: vi.fn(),
|
||||||
setPreReconnectHook: vi.fn(),
|
setPreReconnectHook: vi.fn(),
|
||||||
|
addListener: vi.fn(),
|
||||||
|
removeListener: vi.fn(),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// MSW lifecycle
|
// MSW lifecycle
|
||||||
|
|||||||
Reference in New Issue
Block a user