// The title card's markup (release 27 S7): a card without `sub` or `foot` — // every manifest `reports to-manifest` made before release 27 lacked `foot` — // renders them empty, never the word "undefined". // // Run with: node --test umtool/report-to-video/title-card.test.mjs import assert from "node:assert/strict"; import test from "node:test"; import { markupFor } from "./render-cards.mjs"; const PAL = { bg: "#000000", fg: "#ffffff", muted: "#888888", accent: "#c8752a", amber: "#ffc860" }; test("a title card with no foot and no sub: no 'undefined' in its markup", () => { const markup = markupFor({ type: "card", id: "title", style: "title", heading: "A heading" }, PAL); assert.ok(!markup.includes("undefined"), markup); assert.match(markup, /A heading/); }); test("a title card with an empty foot renders the same as one with none", () => { const none = markupFor({ type: "card", id: "title", style: "title", heading: "H", sub: "S" }, PAL); const empty = markupFor({ type: "card", id: "title", style: "title", heading: "H", sub: "S", foot: "" }, PAL); assert.equal(none, empty); const set = markupFor({ type: "card", id: "title", style: "title", heading: "H", sub: "S", foot: "Channel · 2026" }, PAL); assert.match(set, /Channel · 2026/); });