fix(models): expose static models list so UI renders entries before listModels resolves

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-27 07:42:44 -04:00
parent fc3866924a
commit 1d894f104f
4 changed files with 26 additions and 6 deletions
+20 -1
View File
@@ -1,5 +1,5 @@
import { describe, it, expect, beforeEach, afterEach } from "vitest";
import { listK8sModels } from "./models.js";
import { listK8sModels, DIRECT_MODELS, BEDROCK_MODELS } from "./models.js";
describe("listK8sModels", () => {
const savedEnv: Record<string, string | undefined> = {};
@@ -50,3 +50,22 @@ describe("listK8sModels", () => {
expect(models.some((m) => m.id === "claude-opus-4-7")).toBe(true);
});
});
describe("static model lists", () => {
it("DIRECT_MODELS is non-empty and has valid ids", () => {
expect(DIRECT_MODELS.length).toBeGreaterThan(0);
for (const m of DIRECT_MODELS) {
expect(typeof m.id).toBe("string");
expect(m.id.length).toBeGreaterThan(0);
expect(typeof m.label).toBe("string");
}
});
it("BEDROCK_MODELS is non-empty and all ids contain 'anthropic.'", () => {
expect(BEDROCK_MODELS.length).toBeGreaterThan(0);
for (const m of BEDROCK_MODELS) {
expect(m.id).toContain("anthropic.");
expect(typeof m.label).toBe("string");
}
});
});