Skip to content

Commit 872190f

Browse files
committed
test(template-no-empty-headings): pin falsy mustache aria-hidden cases
Adds invalid tests for `aria-hidden={{false}}` and `aria-hidden={{"false"}}` to lock down that falsy mustache values do not exempt an otherwise-empty heading.
1 parent 4544f39 commit 872190f

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

tests/lib/rules/template-no-empty-headings.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,5 +147,17 @@ ruleTester.run('template-no-empty-headings', rule, {
147147
output: null,
148148
errors: [{ messageId: 'emptyHeading' }],
149149
},
150+
151+
// Falsy mustache aria-hidden values do not exempt the heading.
152+
{
153+
code: '<template><h1 aria-hidden={{false}}></h1></template>',
154+
output: null,
155+
errors: [{ messageId: 'emptyHeading' }],
156+
},
157+
{
158+
code: '<template><h1 aria-hidden={{"false"}}></h1></template>',
159+
output: null,
160+
errors: [{ messageId: 'emptyHeading' }],
161+
},
150162
],
151163
});

0 commit comments

Comments
 (0)