fix(frontend): show session catalog in pi management
This commit is contained in:
@@ -23,7 +23,10 @@ function renderManagement() {
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
server.use(http.get("/api/pi-management/status", () => HttpResponse.json(readyStatus)));
|
||||
server.use(
|
||||
http.get("/api/pi-management/status", () => HttpResponse.json(readyStatus)),
|
||||
http.get("/api/models", () => HttpResponse.json({ models: [] })),
|
||||
);
|
||||
});
|
||||
|
||||
test("shows the catalog default as read-only installation state", async () => {
|
||||
@@ -49,6 +52,22 @@ test("shows the catalog default as read-only installation state", async () => {
|
||||
expect(document.querySelector('input[type="password"]')).toBeNull();
|
||||
});
|
||||
|
||||
test("shows every session model exposed by Core", async () => {
|
||||
server.use(http.get("/api/models", () => HttpResponse.json({ models: [
|
||||
{ provider: "zai", id: "glm-5.3", name: "GLM 5.3", reasoning: true },
|
||||
{ provider: "deepseek", id: "deepseek-v4-pro", name: "DeepSeek V4 Pro", reasoning: true },
|
||||
{ provider: "deepseek", id: "deepseek-v4-flash", name: "DeepSeek V4 Flash", reasoning: true },
|
||||
{ provider: "local-qwen", id: "qwen3.6-35b-a3b", name: "Local Qwen 3.6 35B A3B", reasoning: false },
|
||||
] })));
|
||||
renderManagement();
|
||||
|
||||
const catalog = await screen.findByRole("region", { name: "Session models" });
|
||||
expect(catalog).toHaveTextContent("GLM 5.3");
|
||||
expect(catalog).toHaveTextContent("DeepSeek V4 Pro");
|
||||
expect(catalog).toHaveTextContent("DeepSeek V4 Flash");
|
||||
expect(catalog).toHaveTextContent("Local Qwen 3.6 35B A3B");
|
||||
});
|
||||
|
||||
test("tests the catalog default without mutating credential presence", async () => {
|
||||
const user = userEvent.setup();
|
||||
let tests = 0;
|
||||
|
||||
Reference in New Issue
Block a user