Skip to content
This repository was archived by the owner on Aug 6, 2026. It is now read-only.

Commit b273d98

Browse files
authored
test(sessions): mock SpeechNotifier in sessionServiceHost cloud-permission tests
Main's new terminal-cloud-run permission tests surface a cloud question, which now flows through the always-on deterministic speak path (speakDeterministic -> enqueueSpeech -> resolveService(SpeechNotifier)). The test's resolveService fake didn't mock that token, so it threw "unmocked token". Add a no-op SpeechNotifier mock alongside the existing NotificationBus one. Generated-By: PostHog Code Task-Id: 779ce8fc-0ff8-46f5-abb0-90dcfa253718
1 parent 02666a5 commit b273d98

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

packages/ui/src/features/sessions/sessionServiceHost.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,10 @@ const mockNotificationService = vi.hoisted(() => ({
228228
notifyPromptComplete: vi.fn(),
229229
}));
230230

231+
const mockSpeechNotifier = vi.hoisted(() => ({
232+
speak: vi.fn(),
233+
}));
234+
231235
const mockSettingsState = vi.hoisted(() => ({
232236
customInstructions: "",
233237
syncCustomInstructionsFromFile: false,
@@ -303,6 +307,9 @@ vi.mock("@posthog/di/container", () => ({
303307
if (typeof token === "function" && token.name === "NotificationBus") {
304308
return mockNotificationService;
305309
}
310+
if (typeof token === "function" && token.name === "SpeechNotifier") {
311+
return mockSpeechNotifier;
312+
}
306313
throw new Error(`resolveService: unmocked token ${String(token)}`);
307314
},
308315
}));

0 commit comments

Comments
 (0)