fix: close browser session lifecycle gaps

This commit is contained in:
Wenxin Duan
2026-09-08 11:12:12 +08:00
parent 8fa006344d
commit ba45382747
12 changed files with 149 additions and 11 deletions
+2
View File
@@ -10,6 +10,8 @@ describe("ModelSettings", () => {
const save = vi.fn().mockResolvedValue({ configured: true, source: "session", keyHint: "••••cret" });
render(<ModelSettings open onClose={vi.fn()} busy={false} onSave={save} onTest={vi.fn()} onClear={vi.fn()} />);
expect(screen.getByLabelText("模型 ID")).toHaveAttribute("autocomplete", "off");
expect(screen.getByLabelText("API Key")).toHaveAttribute("autocomplete", "new-password");
await user.type(screen.getByLabelText("API Key"), "sk-browser-secret");
await user.type(screen.getByLabelText("模型 ID"), "gpt-test");
await user.click(screen.getByRole("button", { name: "保存配置" }));