diff --git a/packages/lint/src/rules/media.test.ts b/packages/lint/src/rules/media.test.ts index 3be4187a2d..f1a244f1b2 100644 --- a/packages/lint/src/rules/media.test.ts +++ b/packages/lint/src/rules/media.test.ts @@ -1,7 +1,23 @@ import { describe, it, expect } from "vitest"; +import { readFileSync } from "node:fs"; +import { resolve } from "node:path"; import { lintHyperframeHtml } from "../hyperframeLinter.js"; describe("media rules", () => { + it("keeps the editorial emphasis registry component free of invalid placeholder media", async () => { + const component = readFileSync( + resolve( + process.cwd(), + "../../registry/components/caption-editorial-emphasis/caption-editorial-emphasis.html", + ), + "utf8", + ); + + const result = await lintHyperframeHtml(component); + + expect(result.findings.find((finding) => finding.code === "media_missing_src")).toBeUndefined(); + }); + it("reports error for duplicate media ids", async () => { const html = ` diff --git a/registry/components/caption-editorial-emphasis/caption-editorial-emphasis.html b/registry/components/caption-editorial-emphasis/caption-editorial-emphasis.html index b90b987289..50b41a1220 100644 --- a/registry/components/caption-editorial-emphasis/caption-editorial-emphasis.html +++ b/registry/components/caption-editorial-emphasis/caption-editorial-emphasis.html @@ -37,15 +37,6 @@ background: transparent; } - #bg-video { - position: absolute; - inset: 0; - z-index: 1; - width: 100%; - height: 100%; - object-fit: cover; - } - .caption-layer { position: absolute; inset: 0; @@ -132,17 +123,6 @@ data-width="1920" data-height="1080" > - - diff --git a/registry/components/caption-editorial-emphasis/demo.html b/registry/components/caption-editorial-emphasis/demo.html index 85067766d3..d942f7ce7b 100644 --- a/registry/components/caption-editorial-emphasis/demo.html +++ b/registry/components/caption-editorial-emphasis/demo.html @@ -36,15 +36,6 @@ background: #000; } - #bg-video { - position: absolute; - inset: 0; - z-index: 1; - width: 100%; - height: 100%; - object-fit: cover; - } - .caption-layer { position: absolute; inset: 0; @@ -130,17 +121,6 @@ data-width="1920" data-height="1080" > - -