Co-authored-by: Yash Singh <[email protected]> Co-authored-by: Julius Marminge <[email protected]> Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
27 lines
923 B
TypeScript
27 lines
923 B
TypeScript
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",
|
|
);
|
|
});
|
|
});
|