Caspar Template
All checks were successful
Build & Push Docker (latest) / verify (push) Successful in 9m29s
Build & Push Docker (latest) / build (push) Successful in 8s

This commit is contained in:
Aiden Wilson
2026-05-29 22:51:32 +10:00
parent a88306aec7
commit bba1ab5cee
6 changed files with 375 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
import test from "node:test";
import assert from "node:assert/strict";
import { graphicPage, prepareEmbedHtml } from "../src/templates.js";
import { casparTemplatePage, graphicPage, prepareEmbedHtml } from "../src/templates.js";
test("adds autoplay parameters and permissions to iframe embeds", () => {
const html = prepareEmbedHtml('<iframe src="https://player.example.com/video?id=1"></iframe>');
@@ -184,3 +184,11 @@ test("omits autoplay assist when autoplay is disabled", () => {
assert.doesNotMatch(page, /const playVideo = \(video\) =>/);
});
test("renders a CasparCG template shell", () => {
const page = casparTemplatePage();
assert.match(page, /<body class="graphic transparent is-loading"/);
assert.match(page, /<section class="embed provider-empty"/);
assert.match(page, /<script src="\/caspar\.js"><\/script>/);
});