Files
kilocode/packages/kilo-vscode/tests/unit/mode-model.test.ts
T
2026-08-06 13:54:50 +02:00

30 lines
1.0 KiB
TypeScript

import { describe, expect, it } from "bun:test"
import { modelPatch } from "../../webview-ui/src/components/settings/mode-model"
describe("modelPatch", () => {
it("clears model and variant together", () => {
expect(modelPatch("", "", [], "high")).toEqual({ model: null, variant: null })
})
it("keeps current variant when next model supports it", () => {
expect(modelPatch("kilo", "anthropic/claude-sonnet-4-6", ["low", "high"], "high")).toEqual({
model: "kilo/anthropic/claude-sonnet-4-6",
})
})
it("keeps the nearest supported effort when the exact variant is unavailable", () => {
expect(modelPatch("kilo", "anthropic/claude-sonnet-4-6", ["low", "medium"], "high")).toEqual({
model: "kilo/anthropic/claude-sonnet-4-6",
variant: "medium",
})
})
it("clears an unknown variant when next model does not support it", () => {
expect(modelPatch("kilo", "anthropic/claude-sonnet-4-6", ["low", "medium"], "thinking")).toEqual({
model: "kilo/anthropic/claude-sonnet-4-6",
variant: null,
})
})
})