feat(f7): per-block error-chip fallback (PUC-6, #21)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Ben Stull
2026-06-11 08:44:13 -07:00
parent 3b0ec4f53e
commit 6c3b137ebb
2 changed files with 48 additions and 15 deletions
+15
View File
@@ -122,3 +122,18 @@ describe("renderTrackChanges", () => {
expect(a).toBe(b);
});
});
describe("error chip (PUC-6)", () => {
it("a block whose render throws becomes an error chip; the rest still renders", () => {
const throwing = (src: string) => {
if (src.includes("BOOM")) throw new Error("kaboom");
return `<p>${src}</p>`;
};
const html = renderTrackChanges("Good one.\n\nBOOM here.\n", "Good one.\n\nBOOM here.\n", {
render: throwing,
});
expect(html).toContain("cw-error");
expect(html).toContain("kaboom");
expect(html).toContain("<p>Good one.</p>"); // the healthy block still rendered
});
});