1import { describe, expect, it } from "vite-plus/test";
2import { proposedPlanTitle, stripDisplayedPlanMarkdown } from "./proposedPlanText.ts";
3
4describe("proposedPlanTitle", () => {
5 it("reads the first markdown heading as the plan title", () => {
6 expect(proposedPlanTitle("# Integrate RPC\n\nBody")).toBe("Integrate RPC");
7 });
8
9 it("returns null when the plan has no heading", () => {
10 expect(proposedPlanTitle("- step 1")).toBeNull();
11 });
12});
13
14describe("stripDisplayedPlanMarkdown", () => {
15 it("drops the leading title heading from displayed plan markdown", () => {
16 expect(stripDisplayedPlanMarkdown("# Integrate RPC\n\n## Summary\n\n- step 1\n")).toBe(
17 "- step 1",
18 );
19 });
20
21 it("preserves non-summary headings after dropping the title heading", () => {
22 expect(stripDisplayedPlanMarkdown("# Integrate RPC\n\n## Scope\n\n- step 1\n")).toBe(
23 "## Scope\n\n- step 1",
24 );
25 });
26});