// What modules.spec.ts edits (release 39, the video modules): // // modules-fixture the deck on (make-fixture.mjs deckManifest), three // clips, a then-and-now pair (c01 → c02) and a status // ledger row -- the generic module panel: on/off, // a list editor, a refused save, the single-layer // preview (pair, chapter) // modules-preset-fixture NO chrome of its own, a module-config.json beside // it -- the look preset (the panel's list and // `umtool preset apply`) and `umtool modules apply` // // Synthetic, like every fixture. import { mkdirSync, writeFileSync } from "node:fs"; import path from "node:path"; const clip = (id, start) => ({ type: "clip", id, video: "vid1", start, end: start + 3, cite: start, section: 0, lock: true, quote: "and because" }); /** @param {{ reports: string, manifest: Function, deckManifest: Function }} o */ export function makeModulesFixture({ reports, manifest, deckManifest }) { const dir = path.join(reports, "modules-fixture"); mkdirSync(dir, { recursive: true }); const m = deckManifest("modules-fixture", "The Modules Fixture", [clip("c01", 3), clip("c02", 9), clip("c03", 0)]); m.render.chrome = { ...m.render.chrome, pair: { pairs: [{ topic: "The opening", then: { clip: "c01", date: "2012-09-29" }, now: { clip: "c02", date: "2026-02-27" }, caption: "The same opening, renamed." }] }, status: { items: [{ item: "The lawsuit", announced: { clip: "c01", date: "2019-06-01" }, outcome: "no follow-up found", evidence: ["c01", "c03"] }] }, }; writeFileSync(path.join(dir, "video.manifest.json"), JSON.stringify(m, null, 2) + "\n"); const pdir = path.join(reports, "modules-preset-fixture"); mkdirSync(pdir, { recursive: true }); const p = manifest("modules-preset-fixture", "The Modules Preset Fixture", { siteOrigin: "https://archive.example" }, [clip("c01", 3), clip("c02", 9)]); // A deck's size, as deckManifest gives it, but no chrome: the preset brings the deck. p.render = { ...p.render, width: 1920, height: 1080 }; delete p.render.headerHeight; writeFileSync(path.join(pdir, "video.manifest.json"), JSON.stringify(p, null, 2) + "\n"); writeFileSync( path.join(pdir, "module-config.json"), JSON.stringify({ preset: "plain-deck", modules: { shell: { title: "Not mapped" }, chapter: [{ atClip: "c02", title: "Part two", subtitle: "the second clip" }], pair: [{ then: { clip: "c01", date: "2012" }, now: { clip: "c02", date: "2026-02" }, caption: "then and now" }], }, }, null, 2) + "\n", ); return { dir, pdir }; }