fix: close browser session lifecycle gaps
This commit is contained in:
@@ -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: "保存配置" }));
|
||||
|
||||
Reference in New Issue
Block a user