mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-10-07 02:58:15 +00:00
test: align OpenRouter default fallback (4.5) and reinit gating expectations in ClineProvider specs
This commit is contained in:
parent
b57bf9f327
commit
13d6843679
2 changed files with 6 additions and 4 deletions
|
|
@ -124,7 +124,7 @@ describe("OpenRouterHandler", () => {
|
|||
const handler = new OpenRouterHandler({})
|
||||
const logSpy = vitest.spyOn(console, "log").mockImplementation(() => {})
|
||||
const model = handler.getModel()
|
||||
expect(model.id).toBe("anthropic/claude-sonnet-4")
|
||||
expect(model.id).toBe("anthropic/claude-sonnet-4.5")
|
||||
expect(model.info.supportsPromptCache).toBe(true)
|
||||
expect(logSpy).toHaveBeenCalledWith("[model-cache] source:", "default-fallback")
|
||||
logSpy.mockRestore()
|
||||
|
|
|
|||
|
|
@ -2106,11 +2106,13 @@ describe("ClineProvider", () => {
|
|||
apiConfiguration: testApiConfig,
|
||||
})
|
||||
|
||||
// Verify error handling
|
||||
expect(mockOutputChannel.appendLine).toHaveBeenCalledWith(
|
||||
// With reinit now gated on provider/model/baseUrl changes, no reinit occurs here.
|
||||
// Therefore buildApiHandler is not called and no error is logged or shown.
|
||||
expect(buildApiHandler as any).not.toHaveBeenCalled()
|
||||
expect(mockOutputChannel.appendLine).not.toHaveBeenCalledWith(
|
||||
expect.stringContaining("Error create new api configuration"),
|
||||
)
|
||||
expect(vscode.window.showErrorMessage).toHaveBeenCalledWith("errors.create_api_config")
|
||||
expect(vscode.window.showErrorMessage).not.toHaveBeenCalledWith("errors.create_api_config")
|
||||
|
||||
// Verify state was still updated
|
||||
expect(mockContext.globalState.update).toHaveBeenCalledWith("listApiConfigMeta", [
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue