Skip to content

Commit 5d71600

Browse files
committed
test: add Storybook story for voice input without API key
- Add providersConfig option to setupSimpleChatStory helper - Add VoiceInputNoApiKey story showing disabled mic with tooltip - Documents user education for missing OpenAI key
1 parent 92e31f3 commit 5d71600

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

src/browser/stories/App.chat.stories.tsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,32 @@ export const WithAgentStatus: AppStory = {
212212
),
213213
};
214214

215+
/** Voice input button shows user education when OpenAI API key is not set */
216+
export const VoiceInputNoApiKey: AppStory = {
217+
render: () => (
218+
<AppWithMocks
219+
setup={() => {
220+
setupSimpleChatStory({
221+
messages: [],
222+
// No OpenAI key configured - voice button should be disabled with tooltip
223+
providersConfig: {
224+
anthropic: { apiKeySet: true },
225+
// openai deliberately missing
226+
},
227+
});
228+
}}
229+
/>
230+
),
231+
parameters: {
232+
docs: {
233+
description: {
234+
story:
235+
"Shows the voice input button in disabled state when OpenAI API key is not configured. Hover over the mic icon in the chat input to see the user education tooltip.",
236+
},
237+
},
238+
},
239+
};
240+
215241
/** Streaming/working state with pending tool call */
216242
export const Streaming: AppStory = {
217243
render: () => (

src/browser/stories/storyHelpers.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export interface SimpleChatSetupOptions {
5555
projectName?: string;
5656
messages: MuxMessage[];
5757
gitStatus?: GitStatusFixture;
58+
providersConfig?: Record<string, { apiKeySet: boolean; baseUrl?: string; models?: string[] }>;
5859
}
5960

6061
/**
@@ -82,6 +83,7 @@ export function setupSimpleChatStory(opts: SimpleChatSetupOptions): void {
8283
workspaces,
8384
chatHandlers,
8485
gitStatus,
86+
providersConfig: opts.providersConfig,
8587
})
8688
);
8789

0 commit comments

Comments
 (0)