Files
hyperframes/scripts/backfill-block-previews.test.ts
Miguel Ángel d2398d686a feat(registry): eight ad templates show their video preview in the catalog (#4979)
* feat(registry): eight ad templates show their video preview in the catalog

* refactor(scripts): the preview backfill reuses the shared entrypoint guard
2026-10-04 01:27:10 +00:00

22 lines
958 B
TypeScript

import { describe, it } from "node:test";
import assert from "node:assert/strict";
import { missingBlockPreview } from "./backfill-block-previews.js";
describe("backfill block previews", () => {
it("fills a block that declares no preview with the catalog CDN pattern", () => {
assert.deepEqual(missingBlockPreview("app-showcase", undefined), {
video: "https://static.heygen.ai/hyperframes-oss/docs/images/catalog/blocks/app-showcase.mp4",
poster:
"https://static.heygen.ai/hyperframes-oss/docs/images/catalog/blocks/app-showcase.png",
});
});
it("keeps a declared preview that points somewhere else", () => {
const promoted = {
video: "https://static.heygen.ai/hyperframes/templates/promoted/abc/notes-reveal/preview.mp4",
poster: "https://static.heygen.ai/hyperframes/templates/promoted/abc/notes-reveal/poster.jpg",
};
assert.equal(missingBlockPreview("notes-reveal", promoted), null);
});
});