Skip to content

Commit f6e80d9

Browse files
committed
test: add invalid test cases for allow options in use-baseline rule
1 parent c098a39 commit f6e80d9

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

tests/rules/use-baseline.test.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,5 +498,56 @@ ruleTester.run("use-baseline", rule, {
498498
},
499499
],
500500
},
501+
{
502+
code: "@view-transition { from-view: a; to-view: b; }\n@container (min-width: 800px) { a { color: red; } }",
503+
options: [{ allowAtRules: ["container"] }],
504+
errors: [
505+
{
506+
messageId: "notBaselineAtRule",
507+
data: {
508+
atRule: "view-transition",
509+
availability: "widely",
510+
},
511+
line: 1,
512+
column: 1,
513+
endLine: 1,
514+
endColumn: 17,
515+
},
516+
],
517+
},
518+
{
519+
code: "a { accent-color: red; backdrop-filter: blur(10px); }",
520+
options: [{ allowProperties: ["accent-color"] }],
521+
errors: [
522+
{
523+
messageId: "notBaselineProperty",
524+
data: {
525+
property: "backdrop-filter",
526+
availability: "widely",
527+
},
528+
line: 1,
529+
column: 24,
530+
endLine: 1,
531+
endColumn: 39,
532+
},
533+
],
534+
},
535+
{
536+
code: "h1:has(+ h2) { margin: 0; }\nh1:fullscreen { color: red; }",
537+
options: [{ allowSelectors: ["has"] }],
538+
errors: [
539+
{
540+
messageId: "notBaselineSelector",
541+
data: {
542+
selector: "fullscreen",
543+
availability: "widely",
544+
},
545+
line: 2,
546+
column: 3,
547+
endLine: 2,
548+
endColumn: 14,
549+
},
550+
],
551+
},
501552
],
502553
});

0 commit comments

Comments
 (0)