import { describe, expect, it } from "vite-plus/test"; import { proposedPlanTitle, stripDisplayedPlanMarkdown } from "./proposedPlanText.ts"; describe("proposedPlanTitle", () => { it("reads the first markdown heading as the plan title", () => { expect(proposedPlanTitle("# Integrate RPC\n\nBody")).toBe("Integrate RPC"); }); it("returns null when the plan has no heading", () => { expect(proposedPlanTitle("- step 1")).toBeNull(); }); }); describe("stripDisplayedPlanMarkdown", () => { it("drops the leading title heading from displayed plan markdown", () => { expect(stripDisplayedPlanMarkdown("# Integrate RPC\n\n## Summary\n\n- step 1\n")).toBe( "- step 1", ); }); it("preserves non-summary headings after dropping the title heading", () => { expect(stripDisplayedPlanMarkdown("# Integrate RPC\n\n## Scope\n\n- step 1\n")).toBe( "## Scope\n\n- step 1", ); }); });