mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-18 16:08:56 +00:00
test(lint): cover template-root composition variable declarations (#6150)
The declaration rule validates data-composition-variables on every
declaring element since 571c99ce9 (#4454), but the template-fragment
reproduction case from #4383 had no regression coverage. Add it.
Refs #4383
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
factory-droid[bot]
parent
fa2e63515f
commit
b764a5ffdc
@@ -1355,6 +1355,15 @@ describe("composition rules", () => {
|
||||
expect(finding).toBeDefined();
|
||||
});
|
||||
|
||||
it("checks a declaration on a template-fragment composition root", async () => {
|
||||
const html = `<template><div id="main" data-composition-id="main" data-no-timeline data-width="1920" data-height="1080" data-duration="10" data-composition-variables='broken'></div></template>`;
|
||||
const result = await lintHyperframeHtml(html, { isSubComposition: true });
|
||||
const finding = result.findings.find(
|
||||
(f) => f.code === "invalid_composition_variables_declaration",
|
||||
);
|
||||
expect(finding).toBeDefined();
|
||||
});
|
||||
|
||||
it("warns when data-composition-variables is unparseable JSON", async () => {
|
||||
const html = `<html data-composition-variables='[{not json'><body><div data-composition-id="x"></div></body></html>`;
|
||||
const result = await lintHyperframeHtml(html);
|
||||
|
||||
Reference in New Issue
Block a user