first commit

This commit is contained in:
npc0-hue
2026-07-11 14:56:10 +08:00
commit 7e05d0a4e7
660 changed files with 78119 additions and 0 deletions
@@ -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 ");
});
});