import { describe, expect, it } from "vitest"; import { buildCopilotSystemPrompt } from "./system-prompt"; import type { DiagramType } from "./types"; describe("buildCopilotSystemPrompt", () => { it("should include the diagram type in uppercase", () => { const prompt = buildCopilotSystemPrompt("bpmn"); expect(prompt).toContain("BPMN"); expect(prompt).toContain("Type: BPMN"); }); it("should include diagram description for each type", () => { const types: DiagramType[] = [ "bpmn", "er", "orgchart", "architecture", "sequence", "flowchart", ]; for (const type of types) { const prompt = buildCopilotSystemPrompt(type); expect(prompt).toContain(`Type: ${type.toUpperCase()}`); expect(prompt).toContain("domaingraph AI copilot"); expect(prompt).toContain("CHAT-ONLY mode"); } }); it("should mention chat-only constraint", () => { const prompt = buildCopilotSystemPrompt("er"); expect(prompt).toContain("CHAT-ONLY mode"); expect(prompt).toContain("cannot modify the diagram directly"); }); it("should include today's date", () => { const prompt = buildCopilotSystemPrompt("flowchart"); const year = new Date().getFullYear().toString(); expect(prompt).toContain(year); }); it("should include ER-specific description", () => { const prompt = buildCopilotSystemPrompt("er"); expect(prompt).toContain("Entity-Relationship"); expect(prompt).toContain("entities"); }); it("should include architecture-specific description", () => { const prompt = buildCopilotSystemPrompt("architecture"); expect(prompt).toContain("services"); expect(prompt).toContain("databases"); }); });