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:
@@ -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
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user