Skip to content

Commit 13d6843

Browse files
committed
test: align OpenRouter default fallback (4.5) and reinit gating expectations in ClineProvider specs
1 parent b57bf9f commit 13d6843

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/api/providers/__tests__/openrouter.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ describe("OpenRouterHandler", () => {
124124
const handler = new OpenRouterHandler({})
125125
const logSpy = vitest.spyOn(console, "log").mockImplementation(() => {})
126126
const model = handler.getModel()
127-
expect(model.id).toBe("anthropic/claude-sonnet-4")
127+
expect(model.id).toBe("anthropic/claude-sonnet-4.5")
128128
expect(model.info.supportsPromptCache).toBe(true)
129129
expect(logSpy).toHaveBeenCalledWith("[model-cache] source:", "default-fallback")
130130
logSpy.mockRestore()

src/core/webview/__tests__/ClineProvider.spec.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2106,11 +2106,13 @@ describe("ClineProvider", () => {
21062106
apiConfiguration: testApiConfig,
21072107
})
21082108

2109-
// Verify error handling
2110-
expect(mockOutputChannel.appendLine).toHaveBeenCalledWith(
2109+
// With reinit now gated on provider/model/baseUrl changes, no reinit occurs here.
2110+
// Therefore buildApiHandler is not called and no error is logged or shown.
2111+
expect(buildApiHandler as any).not.toHaveBeenCalled()
2112+
expect(mockOutputChannel.appendLine).not.toHaveBeenCalledWith(
21112113
expect.stringContaining("Error create new api configuration"),
21122114
)
2113-
expect(vscode.window.showErrorMessage).toHaveBeenCalledWith("errors.create_api_config")
2115+
expect(vscode.window.showErrorMessage).not.toHaveBeenCalledWith("errors.create_api_config")
21142116

21152117
// Verify state was still updated
21162118
expect(mockContext.globalState.update).toHaveBeenCalledWith("listApiConfigMeta", [

0 commit comments

Comments
 (0)