// A batch of shorts (lane clip-kit, slice A): names, formats, the snapshot, and `umtool shorts` driving the one // builder (a stand-in here: nothing is rendered) into shorts-/ with its batch.json. import { test } from "node:test"; import assert from "node:assert/strict"; import { existsSync } from "node:fs"; import { mkdir, mkdtemp, readFile, readdir, rm, writeFile } from "node:fs/promises"; import { tmpdir } from "node:os"; import path from "node:path"; import { againOf, asideName, assignNames, baseNameOf, batchItems, parseFormats, rowAfter, slugOf, snapshotOf } from "./shortsBatch.mjs"; import { shortsCommand } from "./shortsCli.mjs"; import { PROJECT_KEYS, planVerticalCut, withOverrides } from "umtool-report-to-video/vertical-plan"; test("a title's slug: lower case, apostrophes dropped, words joined", () => { assert.equal(slugOf("A clip about Tom's toast"), "a-clip-about-toms-toast"); assert.equal(slugOf(" Rye or sourdough?! "), "rye-or-sourdough"); assert.equal(slugOf("Café — déjà vu"), "cafe-deja-vu"); assert.equal(slugOf("x".repeat(80)).length, 60); assert.equal(baseNameOf({ id: "w01", title: "A great break", name: "Pinned Name" }), "pinned-name"); assert.equal(baseNameOf({ id: "w01" }), "w01"); }); test("names: two clips sharing a title, the second gets -; a name once given is kept", () => { const clips = [ { id: "m01", title: "A clip about Tom's toast" }, { id: "w01", title: "A clip about Tom's toast" }, { id: "w05", title: "Rye loaf" }, ]; assert.deepEqual(assignNames(clips), { m01: "a-clip-about-toms-toast", w01: "a-clip-about-toms-toast-w01", w05: "rye-loaf", }); // A later run that holds only w01 keeps its name; a retitled clip keeps its name too. const prior = { w01: "a-clip-about-toms-toast-w01", w05: "rye-loaf" }; assert.deepEqual(assignNames([{ id: "w01", title: "x" }, { id: "w05", title: "Retitled" }], prior), prior); // A new clip whose slug a prior clip holds takes the tiebreak. assert.equal(assignNames([{ id: "m05", title: "Rye loaf" }], prior).m05, "rye-loaf-m05"); }); test("formats, items and the record's again", () => { assert.deepEqual(parseFormats("vertical,landscape,vertical"), ["vertical", "landscape"]); assert.deepEqual(parseFormats(undefined), ["vertical"]); assert.throws(() => parseFormats("square"), /square: not a format/); const tl = [{ type: "clip", id: "a" }, { type: "post", id: "p" }, { type: "clip", id: "b" }]; assert.deepEqual(batchItems(tl, { all: true }).map((e) => e.id), ["a", "b"]); assert.deepEqual(batchItems(tl, { items: ["b", "a", "b"] }).map((e) => e.id), ["b", "a"]); assert.throws(() => batchItems(tl, { items: ["p"] }), /p: not a clip of the take/); assert.throws(() => batchItems(tl, {}), /--items ,… or --all/); const again = againOf({ kind: "shorts-batch", clips: [ { id: "a", knobs: { clip: "framed" }, snapshot: { vertical: null, side: null }, files: { landscape: "a.landscape.mp4" }, errors: { vertical: "failed" } }, { id: "b", files: {}, errors: {} }, ] }); assert.deepEqual(again, [{ id: "a", formats: ["vertical", "landscape"], knobs: { clip: "framed" }, snapshot: { vertical: null, side: null }, look: null }]); // A row: a success records the file, the knobs and the snapshot; a failure keeps a file still there, drops one gone. const ok = rowAfter(null, { id: "a", name: "n", title: "T", format: "vertical", knobs: { clip: "framed" }, snapshot: { vertical: null, side: null }, file: "n.vertical.mp4", seconds: 9, notes: ["x"] }); assert.deepEqual(ok, { id: "a", name: "n", title: "T", knobs: { clip: "framed" }, snapshot: { vertical: null, side: null }, files: { vertical: "n.vertical.mp4" }, seconds: { vertical: 9 }, notes: { vertical: ["x"] }, errors: {} }); const refused = rowAfter(ok, { id: "a", name: "n", title: "T", format: "vertical", knobs: {}, snapshot: {}, error: "is there", exists: true }); assert.deepEqual([refused.files, refused.errors, refused.knobs], [{ vertical: "n.vertical.mp4" }, { vertical: "is there" }, { clip: "framed" }]); assert.deepEqual(rowAfter(ok, { id: "a", name: "n", title: "T", format: "vertical", knobs: {}, snapshot: {}, error: "crashed", exists: false }).files, {}); assert.throws(() => againOf({ kind: "vertical-short" }), /not a batch record/); assert.match(asideName("/x/a.vertical.mp4", new Date(2026, 10, 13, 9, 5, 7)), /\/x\/a\.vertical\.20261113-090507\.mp4$/); }); test("the snapshot: the project keys a clip has, null for one it lacks; laid over the project's entries", () => { const e = { type: "clip", id: "a", vertical: { crop: [0.6, 0, 0.3164, 1] } }; assert.deepEqual(snapshotOf(e, PROJECT_KEYS), { vertical: { crop: [0.6, 0, 0.3164, 1] }, side: null, qr: null, promo: null, zooms: null, coldOpen: null, censor: null }); const project = [{ type: "clip", id: "a", vertical: { crop: [0.1, 0, 0.3164, 1] }, side: { item: "p", from: 0, to: 3 } }]; const laid = withOverrides(project, { a: { vertical: { crop: [0.6, 0, 0.3164, 1] }, side: null, title: "ignored" } }); assert.deepEqual(laid[0], { type: "clip", id: "a", vertical: { crop: [0.6, 0, 0.3164, 1] } }); // The plan reads the snapshot's framing over the take's own entry. const plan = planVerticalCut({ timeline: [{ type: "clip", id: "a", start: 1, end: 5 }], items: ["a"], project: laid }); assert.deepEqual(plan.timeline[0].vertical, { crop: [0.6, 0, 0.3164, 1] }); // No snapshot: the entries as they are (byte for byte the plan it always made). assert.equal(withOverrides(project, null), project); }); async function world() { const root = await mkdtemp(path.join(tmpdir(), "shortsbatch-")); const reportsRoot = path.join(root, "reports"); const dir = path.join(reportsRoot, "proj"); await mkdir(path.join(dir, "takes", "kit"), { recursive: true }); const timeline = [ { type: "clip", id: "m01", video: "v", start: 1, end: 5, title: "Tom's toast" }, { type: "clip", id: "w01", video: "v", start: 0, end: 8, title: "Tom's toast", vertical: { crop: [0.6, 0, 0.3164, 1] } }, ]; await writeFile(path.join(dir, "video.manifest.json"), JSON.stringify({ schemaVersion: 1, slug: "cut", title: "Cut", render: { fps: 30 }, timeline })); await writeFile(path.join(dir, "takes", "kit", "take.json"), JSON.stringify({ id: "kit", group: "takes", order: 1, label: "kit", kind: "reference", preview: "preview.mp4", patch: null, draft: true, window: "full", style: null })); return { root, reportsRoot, dir }; } /** A builder that writes a file where it is asked and records what it was asked. */ function standIn(calls, { fail = () => false } = {}) { return async (o) => { calls.push(o); if (fail(o)) throw new Error(`stand-in refused ${o.items[0]}`); await mkdir(path.dirname(o.out), { recursive: true }); await writeFile(o.out, `mp4 of ${o.items[0]}`); return { record: { seconds: 150, notes: o.knobs.maxSeconds < 150 ? [`this short runs 150.0 s, over its ${o.knobs.maxSeconds} s`] : [], out: o.out } }; }; } const sink = () => { const logs = []; const errs = []; return { logs, errs, log: (s) => logs.push(s), err: (s) => errs.push(s) }; }; test("umtool shorts: each clip in each format into shorts-/, named, recorded; a file there kept unless --replace", async () => { const w = await world(); try { const calls = []; const o = sink(); const code = await shortsCommand(["proj", "--take", "kit", "--all", "--formats", "vertical,landscape", "--clip", "framed", "--hook", "title"], { reportsRoot: w.reportsRoot, log: o.log, err: o.err, build: standIn(calls) }); assert.equal(code, 0, o.errs.join("\n")); const folder = path.join(w.dir, "shorts-kit"); const files = (await readdir(folder)).sort(); assert.deepEqual(files, ["batch.json", "toms-toast-w01.landscape.mp4", "toms-toast-w01.vertical.mp4", "toms-toast.landscape.mp4", "toms-toast.vertical.mp4"]); // The builder was asked one clip at a time, with the flags' knobs and each format's cap. // The take's own 16:9 look takes none of the per-clip builder's knobs (each format only the knobs it reads). assert.deepEqual(calls.map((c) => [c.items[0], c.landscape, c.knobs.maxSeconds, c.knobs.clip]), [["m01", false, 180, "framed"], ["m01", true, 140, undefined], ["w01", false, 180, "framed"], ["w01", true, 140, undefined]]); assert.deepEqual(calls[2].overrides, { w01: { vertical: { crop: [0.6, 0, 0.3164, 1] }, side: null, qr: null, promo: null, zooms: null, coldOpen: null, censor: null } }); const rec = JSON.parse(await readFile(path.join(folder, "batch.json"), "utf8")); assert.equal(rec.kind, "shorts-batch"); assert.deepEqual(rec.last.argv, ["shorts", "proj", "--take", "kit", "--items", "m01,w01", "--formats", "vertical,landscape"]); assert.deepEqual(rec.clips.map((c) => [c.id, c.name, c.files.vertical, c.knobs.clip]), [["m01", "toms-toast", "toms-toast.vertical.mp4", "framed"], ["w01", "toms-toast-w01", "toms-toast-w01.vertical.mp4", "framed"]]); assert.deepEqual(rec.clips[0].notes, { vertical: [], landscape: ["the take's own 16:9 look: clip, hook are not its (left out)", "this short runs 150.0 s, over its 140 s"] }); // Again without --replace: refused per file, recorded, exit 1; the files are untouched. const o2 = sink(); assert.equal(await shortsCommand(["proj", "--take", "kit", "--items", "w01"], { reportsRoot: w.reportsRoot, log: o2.log, err: o2.err, build: standIn([]) }), 1); assert.match(o2.errs.join("\n"), /toms-toast-w01\.vertical\.mp4 is there — --replace/); const rec2 = JSON.parse(await readFile(path.join(folder, "batch.json"), "utf8")); assert.deepEqual(rec2.clips.map((c) => c.id), ["m01", "w01"], "a clip of the folder this run did not build keeps its row"); assert.equal(rec2.clips[1].knobs.clip, "framed", "a refused run keeps the knobs the file was made with"); assert.equal(rec2.clips[1].files.landscape, "toms-toast-w01.landscape.mp4"); // --again: the record's clips, formats and knobs, framed by its snapshot, the old files set aside. await writeFile(path.join(w.dir, "video.manifest.json"), JSON.stringify({ schemaVersion: 1, slug: "cut", render: { fps: 30 }, timeline: [{ type: "clip", id: "m01", video: "v", start: 1, end: 5, title: "Renamed" }, { type: "clip", id: "w01", video: "v", start: 0, end: 8, vertical: { crop: [0, 0, 0.3164, 1] } }] })); const calls3 = []; const o3 = sink(); assert.equal(await shortsCommand(["proj", "--take", "kit", "--again"], { reportsRoot: w.reportsRoot, log: o3.log, err: o3.err, build: standIn(calls3) }), 0, o3.errs.join("\n")); assert.deepEqual(calls3.map((c) => [c.items[0], c.landscape, c.knobs.clip]), [["m01", false, "framed"], ["m01", true, undefined], ["w01", false, "framed"], ["w01", true, undefined]]); assert.deepEqual(calls3[2].overrides.w01.vertical, { crop: [0.6, 0, 0.3164, 1] }, "the snapshot, not the project's new crop"); const after = await readdir(folder); assert.ok(after.includes("toms-toast.vertical.mp4"), "the name kept though the title changed"); assert.equal(after.filter((f) => /\.\d{8}-\d{6}\.mp4$/.test(f)).length, 4, "each old file set aside"); } finally { await rm(w.root, { recursive: true, force: true }); } }); test("umtool shorts: a failing clip is recorded and the rest go on; --dry-run writes nothing; refusals say why", async () => { const w = await world(); try { const o = sink(); const code = await shortsCommand(["proj", "--take", "kit", "--all"], { reportsRoot: w.reportsRoot, log: o.log, err: o.err, build: standIn([], { fail: (x) => x.items[0] === "m01" }) }); assert.equal(code, 1); const rec = JSON.parse(await readFile(path.join(w.dir, "shorts-kit", "batch.json"), "utf8")); assert.match(rec.clips[0].errors.vertical, /stand-in refused m01/); assert.deepEqual(rec.clips[0].files, {}); assert.deepEqual(rec.clips[1].files, { vertical: "toms-toast-w01.vertical.mp4" }); await rm(path.join(w.dir, "shorts-kit"), { recursive: true }); const d = sink(); assert.equal(await shortsCommand(["proj", "--take", "kit", "--items", "w01", "--formats", "landscape", "--dry-run", "--json"], { reportsRoot: w.reportsRoot, log: d.log, err: d.err, build: standIn([]) }), 0); assert.deepEqual(JSON.parse(d.logs.join("\n")).clips[0].files, { landscape: "toms-toast.landscape.mp4" }, "alone in a new folder, w01 takes its plain name"); assert.equal(existsSync(path.join(w.dir, "shorts-kit")), false); const say = async (args, re) => { const x = sink(); assert.equal(await shortsCommand(args, { reportsRoot: w.reportsRoot, log: x.log, err: x.err, build: standIn([]) }), 2, args.join(" ")); assert.match(x.errs.join("\n"), re); }; await say(["proj", "--all"], /--take /); await say(["proj", "--take", "kit"], /--items ,… or --all/); await say(["proj", "--take", "kit", "--items", "nope"], /nope: not a clip of the take/); await say(["proj", "--take", "kit", "--all", "--formats", "square"], /square: not a format/); await say(["proj", "--take", "kit", "--again"], /batch\.json is not there/); await say(["proj", "--take", "kit", "--all", "--max-vertical", "2"], /--max-vertical is 5 to 600/); } finally { await rm(w.root, { recursive: true, force: true }); } }); test("umtool shorts: --again builds from the look it recorded; a failed rebuild puts the old file back; a hand-edited name is not trusted", async () => { const w = await world(); try { const look = { palette: { bg: "#101010" }, promo: { name: "Example Channel", url: "https://example.org/c" } }; const withLook = (calls, o2 = {}) => async (o) => { calls.push(o); if (o2.fail) throw new Error("the build failed"); await mkdir(path.dirname(o.out), { recursive: true }); await writeFile(o.out, `mp4 of ${o.items[0]} ${calls.length}`); return { record: { seconds: 9, notes: [], out: o.out, look } }; }; const o = sink(); assert.equal(await shortsCommand(["proj", "--take", "kit", "--items", "w01", "--formats", "vertical,landscape", "--qr-corner", "br"], { reportsRoot: w.reportsRoot, log: o.log, err: o.err, build: withLook([]) }), 0, o.errs.join("\n")); const folder = path.join(w.dir, "shorts-kit"); const rec = JSON.parse(await readFile(path.join(folder, "batch.json"), "utf8")); assert.deepEqual(rec.clips[0].look, look); assert.match(rec.clips[0].notes.vertical[0], /code at the top right/); // --again: the recorded look handed to the builder. const calls = []; assert.equal(await shortsCommand(["proj", "--take", "kit", "--again"], { reportsRoot: w.reportsRoot, log: o.log, err: o.err, build: withLook(calls) }), 0); assert.deepEqual(calls.map((c) => c.look), [look, look]); // A rebuild that fails: the file it replaced is back, its contents as they were. const file = path.join(folder, "toms-toast.vertical.mp4"); const before = await readFile(file, "utf8"); assert.equal(await shortsCommand(["proj", "--take", "kit", "--items", "w01", "--replace"], { reportsRoot: w.reportsRoot, log: o.log, err: o.err, build: withLook([], { fail: true }) }), 1); assert.equal(await readFile(file, "utf8"), before); // A name in the record that is not a plain file name of the folder is not used. const hacked = JSON.parse(await readFile(path.join(folder, "batch.json"), "utf8")); hacked.clips[0].name = "../../escape"; await writeFile(path.join(folder, "batch.json"), JSON.stringify(hacked)); const d = sink(); assert.equal(await shortsCommand(["proj", "--take", "kit", "--items", "w01", "--dry-run", "--json"], { reportsRoot: w.reportsRoot, log: d.log, err: d.err, build: withLook([]) }), 0); assert.deepEqual(JSON.parse(d.logs.join("\n")).clips[0].files, { vertical: "toms-toast.vertical.mp4" }); } finally { await rm(w.root, { recursive: true, force: true }); } }); import { buildShort } from "./verticalCli.mjs"; import { linkSharedOut } from "./takeMaker.mjs"; import { lstat, readlink } from "node:fs/promises"; test("the promo ends a short only on a whole clip, and a reel's outro is not added after it; a take's empty clips-raw becomes the link", async () => { const w = await world(); try { const m = JSON.parse(await readFile(path.join(w.dir, "video.manifest.json"), "utf8")); m.render.promo = { name: "Example Channel", url: "https://example.org/c" }; m.timeline.push({ type: "post", id: "p1", post: "x/1", platform: "x", author: "A", handle: "a", date: "2026-01-01T00:00:00Z", text: "a post" }); await writeFile(path.join(w.dir, "video.manifest.json"), JSON.stringify(m)); const ends = await buildShort({ project: "proj", take: "kit", items: ["m01", "w01"], dryRun: true }, { reportsRoot: w.reportsRoot }); assert.equal(ends.dryRun.promo, true); const post = await buildShort({ project: "proj", take: "kit", items: ["w01", "p1"], dryRun: true }, { reportsRoot: w.reportsRoot }); assert.equal(post.dryRun.promo, false); assert.match(post.dryRun.notes.join(), /ends on p1, a post: no channel promo/); // An empty real out/clips-raw (a failed build's) is replaced by the link to the project's. await mkdir(path.join(w.dir, "out", "clips-raw"), { recursive: true }); await writeFile(path.join(w.dir, "out", "clips-raw", "v_0.00-9.00.mp4"), "x"); const takeOut = path.join(w.dir, "takes", "kit", "out"); await mkdir(path.join(takeOut, "clips-raw"), { recursive: true }); await linkSharedOut(w.dir, takeOut); assert.ok((await lstat(path.join(takeOut, "clips-raw"))).isSymbolicLink()); assert.equal(await readlink(path.join(takeOut, "clips-raw")), path.join(w.dir, "out", "clips-raw")); } finally { await rm(w.root, { recursive: true, force: true }); } }); test("hidden regions reach a short of a RENDERED take (its render frozen): the take's boxes and the project's, added; --again keeps a box added since; a reframe refuses one", async () => { const w = await world(); try { const m = JSON.parse(await readFile(path.join(w.dir, "video.manifest.json"), "utf8")); const TAKE_BOX = { video: "v", boxes: [[0, 0, 0.2, 0.2]], style: "black" }; // The take as rendered: its own recording box, frozen in its manifest. await writeFile(path.join(w.dir, "takes", "kit", "video.manifest.json"), JSON.stringify({ ...m, render: { ...m.render, censor: [TAKE_BOX] } })); const dry = (o = {}) => buildShort({ project: "proj", take: "kit", items: ["w01"], dryRun: true, ...o }, { reportsRoot: w.reportsRoot }).then((r) => r.dryRun.hidden); assert.deepEqual(await dry(), { w01: 1 }, "the take's own"); // A box on the recording set on the PROJECT since: added, in every format. m.render.censor = [{ video: "v", boxes: [[0.75, 0, 0.25, 1]], style: "black" }]; await writeFile(path.join(w.dir, "video.manifest.json"), JSON.stringify(m)); assert.deepEqual(await dry(), { w01: 2 }, "a short"); assert.deepEqual(await dry({ desktop: true }), { w01: 2 }, "a desktop clip"); assert.deepEqual(await dry({ landscape: true }), { w01: 2 }, "the take's own 16:9 look"); // A reframe cuts the take's finished picture, which does not hide it: refused, by clip. await assert.rejects(dry({ reframe: true }), /--reframe cuts take kit's finished picture, which does not hide the regions set since .* on w01 \(2 box\(es\)\)/); // A batch, then a box on the clip itself: --again builds with it (the record's snapshot and the clip now, both). const o = sink(); assert.equal(await shortsCommand(["proj", "--take", "kit", "--items", "w01", "--formats", "vertical"], { reportsRoot: w.reportsRoot, log: o.log, err: o.err, build: standIn([]) }), 0, o.errs.join("\n")); const m2 = JSON.parse(await readFile(path.join(w.dir, "video.manifest.json"), "utf8")); m2.timeline.find((e) => e.id === "w01").censor = { boxes: [[0.4, 0.4, 0.2, 0.2]], style: "blur" }; await writeFile(path.join(w.dir, "video.manifest.json"), JSON.stringify(m2)); const calls = []; assert.equal(await shortsCommand(["proj", "--take", "kit", "--again"], { reportsRoot: w.reportsRoot, log: o.log, err: o.err, build: standIn(calls) }), 0, o.errs.join("\n")); assert.equal(calls.length, 1); assert.deepEqual(await dry({ overrides: calls[0].overrides }), { w01: 3 }, "the take's, the project's recording box and the clip's own, added since the batch"); } finally { await rm(w.root, { recursive: true, force: true }); } }); test("a record's look keeps its fonts by name (the pipeline's) or relative to the project, never this checkout's path; --again resolves them", async () => { const { lookSnapshotOf, lookFromSnapshot } = await import("./verticalCli.mjs"); const { MONO_FONT_FILE, MONO_BOLD_FONT_FILE } = await import("umtool-report-to-video/brand"); const dir = "/somewhere/reports/proj"; const look = lookSnapshotOf({ fontRegular: MONO_FONT_FILE, fontBold: `${dir}/fonts/Own-Bold.ttf`, palette: { bg: "#000000" }, width: 1920 }, { projectDir: dir }); assert.deepEqual(look, { fontRegular: "IBMPlexMono-Regular.ttf", fontBold: "fonts/Own-Bold.ttf", palette: { bg: "#000000" } }); assert.ok(!JSON.stringify(look).includes(path.dirname(MONO_FONT_FILE)), "no absolute path of this checkout"); assert.deepEqual(lookFromSnapshot(look, { projectDir: dir }), { fontRegular: MONO_FONT_FILE, fontBold: `${dir}/fonts/Own-Bold.ttf`, palette: { bg: "#000000" } }); assert.equal(lookFromSnapshot({ fontBold: "IBMPlexMono-Bold.ttf" }, { projectDir: dir }).fontBold, MONO_BOLD_FONT_FILE); // A font elsewhere on the machine stays as written (there is no name to give it). assert.equal(lookSnapshotOf({ fontRegular: "/usr/share/fonts/X.ttf" }, { projectDir: dir }).fontRegular, "/usr/share/fonts/X.ttf"); }); test("a short or a desktop clip of a take with a cold-open teaser and an analysis ending: the clip alone is planned, as without them (per-clip builds have no deck, so no full-frame blackout)", async () => { const w = await world(); try { const m = JSON.parse(await readFile(path.join(w.dir, "video.manifest.json"), "utf8")); const plain = await buildShort({ project: "proj", take: "kit", items: ["w01"], dryRun: true }, { reportsRoot: w.reportsRoot }); const plainDesk = await buildShort({ project: "proj", take: "kit", items: ["w01"], dryRun: true, desktop: true }, { reportsRoot: w.reportsRoot }); m.render.chrome = { engine: "hyperframes", layout: "deck", deck: {} }; m.timeline = [ { type: "teaser", id: "t-open", seconds: 4, lines: ["Coming up"], dip: true }, ...m.timeline, { type: "analysis", id: "a-end", seconds: 7, kind: "ending" }, ]; await writeFile(path.join(w.dir, "video.manifest.json"), JSON.stringify(m)); const withThem = await buildShort({ project: "proj", take: "kit", items: ["w01"], dryRun: true }, { reportsRoot: w.reportsRoot }); const desk = await buildShort({ project: "proj", take: "kit", items: ["w01"], dryRun: true, desktop: true }, { reportsRoot: w.reportsRoot }); assert.deepEqual(withThem.dryRun.items, plain.dryRun.items); assert.deepEqual(withThem.dryRun.pieces, plain.dryRun.pieces); assert.deepEqual(desk.dryRun.items, plainDesk.dryRun.items); assert.deepEqual(withThem.dryRun.items.map((i) => i.type), ["clip"]); } finally { await rm(w.root, { recursive: true, force: true }); } }); test("the per-clip renders drop the deck (a desktop clip, a bare short): no chrome, so no full-frame blackout; the stacked deck keeps it, over the planned clips alone", async () => { const { desktopRender, verticalRender } = await import("umtool-report-to-video/vertical"); const { fullFrameItems } = await import("umtool-report-to-video/full-frame"); const render = { width: 1920, height: 1080, fps: 30, chrome: { engine: "hyperframes", layout: "deck", deck: {} } }; assert.equal(desktopRender(render).chrome, undefined); assert.equal(verticalRender({ ...render, format: "vertical", vertical: { deck: "bare" } }).chrome, undefined, "a bare short"); assert.deepEqual(verticalRender({ ...render, format: "vertical" }).chrome, render.chrome, "the stacked deck keeps it"); // Its schedule is the planned clips': no teaser, intro or analysis item among them, so no full-frame item. assert.deepEqual(fullFrameItems({ segments: [{ id: "w01", type: "clip", start: 0, end: 8, duration: 8 }], total: 8, fps: 30, transition: 0.5 }), []); });