first commit
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { renderToStaticMarkup } from "react-dom/server";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { AiProvidersPage } from "./AiProvidersPage";
|
||||
|
||||
describe("AiProvidersPage", () => {
|
||||
it("renders the AI provider management workflow", () => {
|
||||
const html = renderToStaticMarkup(<AiProvidersPage />);
|
||||
|
||||
expect(html).toContain("AI 提供商管理");
|
||||
expect(html).toContain("OpenAI Relay");
|
||||
expect(html).toContain("Local Ollama");
|
||||
expect(html).toContain("新增");
|
||||
expect(html).toContain("保存");
|
||||
expect(html).toContain("secret://providers/openai");
|
||||
});
|
||||
|
||||
it("does not render raw key field names", () => {
|
||||
const html = renderToStaticMarkup(<AiProvidersPage />);
|
||||
|
||||
expect(html).not.toContain("apiKey=");
|
||||
expect(html).not.toContain("rawApiKey");
|
||||
expect(html).not.toContain('value="sk-');
|
||||
expect(html).not.toContain(">sk-");
|
||||
expect(html).not.toContain("api_key=");
|
||||
expect(html).not.toContain("Bearer ");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user