29 lines
978 B
TypeScript
29 lines
978 B
TypeScript
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 ");
|
|
});
|
|
});
|