@@ -13,6 +13,7 @@ import {
1313 normalizeHfColorGradingWithVariables ,
1414 serializeHfColorGrading ,
1515} from "./colorGrading" ;
16+ import { lintHyperframeHtml } from "./lint" ;
1617
1718describe ( "color grading" , ( ) => {
1819 it ( "derives grade and effect preset views from their actual payloads" , ( ) => {
@@ -28,6 +29,32 @@ describe("color grading", () => {
2829 expect ( HF_COLOR_GRADING_PRESETS ) . toHaveLength ( 18 ) ;
2930 } ) ;
3031
32+ it ( "keeps every canonical grading key accepted by lint" , async ( ) => {
33+ const grading = normalizeHfColorGrading ( "neutral" ) ;
34+ expect ( grading ) . not . toBeNull ( ) ;
35+ const html = ( attribute : string ) => `
36+ <html><body>
37+ <div id="root" data-composition-id="c1" data-start="0" data-width="1920" data-height="1080" data-duration="1">
38+ <img class="clip" data-start="0" data-duration="1" src="media.jpg" data-color-grading='${ attribute } '>
39+ </div>
40+ <script>window.__timelines = {};</script>
41+ </body></html>
42+ ` ;
43+
44+ const valid = await lintHyperframeHtml ( html ( serializeHfColorGrading ( grading ) ) ) ;
45+ expect ( valid . findings . filter ( ( finding ) => finding . severity === "error" ) ) . toEqual ( [ ] ) ;
46+
47+ const invalid = await lintHyperframeHtml ( html ( '{"effects":{"notARealEffect":1}}' ) ) ;
48+ expect ( invalid . findings ) . toEqual (
49+ expect . arrayContaining ( [
50+ expect . objectContaining ( {
51+ code : "color_grading_invalid_structure" ,
52+ severity : "error" ,
53+ } ) ,
54+ ] ) ,
55+ ) ;
56+ } ) ;
57+
3158 it ( "parses preset shorthand" , ( ) => {
3259 const grading = normalizeHfColorGrading ( "warm-daylight" ) ;
3360 expect ( grading ?. preset ) . toBe ( "warm-daylight" ) ;
0 commit comments