Files
t3code/packages/shared/src/proposedPlanText.test.ts
T
12069eefd7 feat(web): find messages and plans in the current thread (#10439)
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]>
2026-10-08 08:24:50 -05:00

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",
);
});
});