diff --git a/packages/core/src/lint/hyperframeLinter.test.ts b/packages/core/src/lint/hyperframeLinter.test.ts index e8dbaf35d..7285dca30 100644 --- a/packages/core/src/lint/hyperframeLinter.test.ts +++ b/packages/core/src/lint/hyperframeLinter.test.ts @@ -1,7 +1,7 @@ import { describe, it, expect, vi } from "vitest"; import { lintHyperframeHtml, lintScriptUrls } from "./hyperframeLinter.js"; -describe("lintHyperframeHtml", () => { +describe("lintHyperframeHtml — orchestrator", () => { const validComposition = ` @@ -24,72 +24,6 @@ describe("lintHyperframeHtml", () => { expect(result.errorCount).toBe(0); }); - it("reports error when root is missing data-composition-id", () => { - const html = ` - -
- -`; - const result = lintHyperframeHtml(html); - const finding = result.findings.find((f) => f.code === "root_missing_composition_id"); - expect(finding).toBeDefined(); - expect(finding?.severity).toBe("error"); - }); - - it("reports error when root is missing data-width or data-height", () => { - const html = ` - -
- -`; - const result = lintHyperframeHtml(html); - const finding = result.findings.find((f) => f.code === "root_missing_dimensions"); - expect(finding).toBeDefined(); - expect(finding?.severity).toBe("error"); - }); - - it("reports error when timeline registry is missing", () => { - const html = ` - -
- -`; - const result = lintHyperframeHtml(html); - const finding = result.findings.find((f) => f.code === "missing_timeline_registry"); - expect(finding).toBeDefined(); - }); - - it("reports error for duplicate media ids", () => { - const html = ` - -
- - -
- -`; - const result = lintHyperframeHtml(html); - const finding = result.findings.find((f) => f.code === "duplicate_media_id"); - expect(finding).toBeDefined(); - expect(finding?.severity).toBe("error"); - expect(finding?.elementId).toBe("v1"); - }); - - it("reports error for composition host missing data-composition-id", () => { - const html = ` - -
-
-
- -`; - const result = lintHyperframeHtml(html); - const finding = result.findings.find((f) => f.code === "host_missing_composition_id"); - expect(finding).toBeDefined(); - }); - it("attaches filePath to findings when option is set", () => { const html = "
"; const result = lintHyperframeHtml(html, { filePath: "test.html" }); @@ -99,7 +33,6 @@ describe("lintHyperframeHtml", () => { }); it("deduplicates identical findings", () => { - // Calling with the same HTML should not produce duplicate entries const html = `
@@ -111,44 +44,6 @@ describe("lintHyperframeHtml", () => { expect(codes.length).toBe(uniqueCodes.length); }); - it("reports info for composition with external CDN script dependency", () => { - const html = ``; - const result = lintHyperframeHtml(html, { filePath: "compositions/rockets.html" }); - const finding = result.findings.find( - (f) => f.code === "external_script_dependency" && f.message.includes("cdnjs.cloudflare.com"), - ); - expect(finding).toBeDefined(); - expect(finding?.severity).toBe("info"); - // info findings do not count as errors — ok should still be true - expect(result.ok).toBe(true); - expect(result.errorCount).toBe(0); - }); - - it("does not report external_script_dependency for inline scripts", () => { - const html = ` - -
- -
-`; - const result = lintHyperframeHtml(html); - expect(result.findings.find((f) => f.code === "external_script_dependency")).toBeUndefined(); - }); - it("strips