// THE INBOX'S BLOCKING siteOrigin CARD and a basic-mode cut (operator ruling, 11 Nov, E5 A6): a cut that draws a QR // built from a missing origin is blocked; the same cut in basic mode -- the footage alone, no QR (a quick clip on a // channel no public site carries) -- is not. // // Run with: node --test umtool/lib/report/basic-origin.test.mjs import assert from "node:assert/strict"; import test from "node:test"; import { mkdtempSync, rmSync } from "node:fs"; import { tmpdir } from "node:os"; import path from "node:path"; import { deadOriginQrsOf, originDeadFor } from "../projects/report.mjs"; const cut = (render) => ({ slug: "q", provenance: { siteOrigin: "", channelSlug: "chan" }, render: { width: 1920, height: 1080, fps: 30, ...render }, timeline: [{ type: "clip", id: "c01", channel: "chan", video: "v1", start: 41, end: 45, cite: 41 }], }); test("a missing origin: blocking for a cut whose corner QR it builds, never for a basic-mode cut (no QR drawn)", async () => { const dir = mkdtempSync(path.join(tmpdir(), "basic-origin-")); try { const drawn = cut({}); const qrs = await deadOriginQrsOf(dir, drawn); assert.deepEqual(qrs.map((q) => q.where), ["timeline c01 (its corner QR)"]); assert.equal(originDeadFor(drawn, qrs), true); const basic = cut({ mode: "basic" }); const none = await deadOriginQrsOf(dir, basic); assert.deepEqual(none, []); assert.equal(originDeadFor(basic, none), false); } finally { rmSync(dir, { recursive: true, force: true }); } });