Skip to content

Commit 20df6a2

Browse files
committed
merge: feedback
1 parent d432fcf commit 20df6a2

4 files changed

Lines changed: 24 additions & 12 deletions

File tree

webview-ui/src/components/chat/__tests__/Announcement.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ vi.mock("@src/i18n/TranslationContext", () => ({
4141
const translations: Record<string, string> = {
4242
"chat:announcement.release.heading": "What's New:",
4343
"chat:announcement.release.gpt55":
44-
"GPT-5.5 via OpenAI Codex: Added GPT-5.5 support in the OpenAI Codex provider so you can use the latest model straight from Roo Code.",
44+
"GPT-5.5 via OpenAI Codex: Added GPT-5.5 support in the OpenAI Codex provider so you can use the latest model straight from Zoo Code.",
4545
"chat:announcement.release.claudeOpus47":
4646
"Claude Opus 4.7 on Vertex AI: Added Claude Opus 4.7 to the Vertex AI provider for Anthropic's newest flagship reasoning model.",
4747
"chat:announcement.release.checkpointNav":
@@ -65,7 +65,7 @@ describe("Announcement", () => {
6565
expect(screen.getByText("Zoo Code 3.53.0 Released")).toBeInTheDocument()
6666
expect(
6767
screen.getByText(
68-
"GPT-5.5 via OpenAI Codex: Added GPT-5.5 support in the OpenAI Codex provider so you can use the latest model straight from Roo Code.",
68+
"GPT-5.5 via OpenAI Codex: Added GPT-5.5 support in the OpenAI Codex provider so you can use the latest model straight from Zoo Code.",
6969
),
7070
).toBeInTheDocument()
7171
expect(

webview-ui/src/components/settings/__tests__/About.spec.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ vi.mock("@roo/package", () => ({
4141
},
4242
}))
4343

44-
const defaultProps = {
45-
telemetrySetting: "enabled" as const,
46-
setTelemetrySetting: vi.fn(),
47-
}
48-
4944
describe("About", () => {
45+
const defaultProps = {
46+
telemetrySetting: "enabled" as const,
47+
setTelemetrySetting: vi.fn(),
48+
}
49+
5050
beforeEach(() => {
5151
vi.clearAllMocks()
5252
})

webview-ui/src/components/welcome/WelcomeViewProvider.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,14 @@ const DEFAULT_WELCOME_API_CONFIGURATION: ProviderSettings = {
2121
}
2222

2323
const getWelcomeApiConfiguration = (apiConfiguration?: ProviderSettings): ProviderSettings => {
24+
// validateApiConfiguration treats a missing apiProvider as valid (no switch case matches),
25+
// so we explicitly fall back here before delegating to it for incomplete-but-set configs.
2426
if (!apiConfiguration?.apiProvider) {
2527
return DEFAULT_WELCOME_API_CONFIGURATION
2628
}
2729

28-
if (apiConfiguration.apiProvider === "anthropic" && !apiConfiguration.apiKey) {
30+
const validationError = validateApiConfiguration(apiConfiguration)
31+
if (validationError) {
2932
return DEFAULT_WELCOME_API_CONFIGURATION
3033
}
3134

webview-ui/src/components/welcome/__tests__/WelcomeViewProvider.spec.tsx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ vi.mock("react-i18next", () => ({
7070
},
7171
}))
7272

73+
vi.mock("i18next", () => ({
74+
default: {
75+
t: (key: string) => key,
76+
},
77+
}))
78+
7379
vi.mock("@src/i18n/TranslationContext", () => ({
7480
useAppTranslation: () => ({
7581
t: (key: string) => key,
@@ -226,17 +232,20 @@ describe("WelcomeViewProvider", () => {
226232
})
227233

228234
it("saves the configured provider from setup", () => {
229-
renderWelcomeViewProvider({ apiConfiguration: { apiProvider: "openrouter" } })
235+
const apiConfiguration = {
236+
apiProvider: "openrouter" as const,
237+
openRouterApiKey: "test-key",
238+
openRouterModelId: openRouterDefaultModelId,
239+
}
240+
renderWelcomeViewProvider({ apiConfiguration })
230241

231242
fireEvent.click(screen.getByTestId("button-primary"))
232243
fireEvent.click(screen.getByText(/welcome:providerSignup.finish/))
233244

234245
expect(vscode.postMessage).toHaveBeenCalledWith({
235246
type: "upsertApiConfiguration",
236247
text: "default",
237-
apiConfiguration: {
238-
apiProvider: "openrouter",
239-
},
248+
apiConfiguration,
240249
})
241250
})
242251

0 commit comments

Comments
 (0)