From 08c4063ff404f58174e1ae2454a481a4a2f481da Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Sun, 20 Sep 2026 12:17:45 -0700 Subject: [PATCH] test(desktop): voice boundary test partial-mocks @/hermes and @/api/client main went red after ae7bf98971d (voice playback threads the Bot owner scope through api/client::ownerScoped) met 96cb6636d31 (the new boundary test): the wholesale vi.mock of @/hermes drops setApiRequestProfile, which the profile-scope store reads at import, and the @/api/client mock lacks ownerScoped. Spread importOriginal() on both mocks so only the intended seams are faked. --- .../hooks/use-voice-conversation-boundary.test.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/desktop/src/app/chat/composer/hooks/use-voice-conversation-boundary.test.tsx b/apps/desktop/src/app/chat/composer/hooks/use-voice-conversation-boundary.test.tsx index 091f07bfad..aad96a2609 100644 --- a/apps/desktop/src/app/chat/composer/hooks/use-voice-conversation-boundary.test.tsx +++ b/apps/desktop/src/app/chat/composer/hooks/use-voice-conversation-boundary.test.tsx @@ -19,13 +19,18 @@ const mocks = vi.hoisted(() => ({ } })) -vi.mock('@/hermes', () => ({ +vi.mock('@/hermes', async importOriginal => ({ + ...(await importOriginal>()), getApiRequestConnection: () => null, getApiRequestProfile: () => null, hermesApi: mocks.config, speakText: vi.fn() })) -vi.mock('@/api/client', () => ({ profileScoped: (value: unknown) => value })) +vi.mock('@/api/client', async importOriginal => ({ + ...(await importOriginal>()), + ownerScoped: (value: unknown) => value ?? {}, + profileScoped: (value: unknown) => value +})) vi.mock('./use-mic-recorder', () => ({ useMicRecorder: () => ({ handle: mocks.mic, level: 0 }) })) vi.mock('@/lib/voice-barge-in', () => ({ monitorSpeechDuringPlayback: () => vi.fn() })) vi.mock('@/lib/thinking-sound', () => ({ startThinkingSound: vi.fn(), stopThinkingSound: vi.fn() }))