Enhance Beryl Agent detail and report views
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { afterEach, expect, it } from "vitest";
|
||||
import { modelStorageKey, readSavedModel, saveModel } from "../src/model-storage.js";
|
||||
import type { ModelConnectionInput } from "@agent-studio/shared";
|
||||
afterEach(() => localStorage.clear());
|
||||
const config = { providerId: "test", modelId: "test", apiKey: "test-secret" } as ModelConnectionInput;
|
||||
it("never persists the API key", () => {
|
||||
saveModel(config);
|
||||
expect(localStorage.getItem(modelStorageKey)).not.toContain("test-secret");
|
||||
expect(readSavedModel()?.apiKey).toBeUndefined();
|
||||
expect(config.apiKey).toBe("test-secret");
|
||||
});
|
||||
it("removes keys from legacy saved configurations", () => {
|
||||
localStorage.setItem(modelStorageKey, JSON.stringify(config));
|
||||
expect(readSavedModel()?.apiKey).toBeUndefined();
|
||||
expect(localStorage.getItem(modelStorageKey)).not.toContain("test-secret");
|
||||
});
|
||||
Reference in New Issue
Block a user