Skip to content

Commit 226fc53

Browse files
test(lint): pin the caption CSS gate on the group textShadow rule
Refs #5388
1 parent c3c7287 commit 226fc53

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

‎packages/lint/src/rules/captions.test.ts‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,29 @@ describe("caption rules", () => {
325325
findings.find((f) => f.code === "caption_textshadow_on_group_container"),
326326
).toBeUndefined();
327327
});
328+
329+
it("does not warn for a glowing title group outside a caption composition", async () => {
330+
// The rule only looks at the caption classes in the CSS, so a file without
331+
// them must stay silent even though the tween shape is the one it matches.
332+
const html = `
333+
<html><body>
334+
<div data-composition-id="main" data-width="1920" data-height="1080">
335+
<style>.title-group { position: absolute; }</style>
336+
<div id="title-group"></div>
337+
<script>
338+
window.__timelines = window.__timelines || {};
339+
var tl = gsap.timeline({ paused: true });
340+
var el = document.getElementById("title-group");
341+
tl.to(el, { textShadow: "0 0 24px #0ff", duration: 0.2 }, 0);
342+
window.__timelines["main"] = tl;
343+
</script>
344+
</div>
345+
</body></html>`;
346+
const { findings } = await lintHyperframeHtml(html);
347+
expect(
348+
findings.find((f) => f.code === "caption_textshadow_on_group_container"),
349+
).toBeUndefined();
350+
});
328351
});
329352

330353
describe("caption_fittext_scale_mismatch", () => {

0 commit comments

Comments
 (0)