import { describe, expect, test } from "bun:test"; import { formatPlanContent } from "./render.js"; describe("formatPlanContent", () => { test("renders headings, paragraphs, and lists for plan panels", () => { const html = formatPlanContent(`## Summary Line one Line two - First item - Second item 1. Step one 2. Step two`); expect(html).toContain("

Summary

"); expect(html).toContain("

Line one
Line two

"); expect(html).toContain(""); expect(html).toContain("
  1. Step one
  2. Step two
"); }); test("escapes unsafe markup and preserves inline formatting plus code blocks", () => { const html = formatPlanContent(`**Bold** with \`inline\` and \`\`\`js const markup = "
"; \`\`\``); expect(html).toContain("Bold"); expect(html).toContain(""); expect(html).toContain("<script>alert(1)</script>"); expect(html).toContain("
const markup = "<div>";
"); }); });