Skip to content

Commit 03c3f03

Browse files
committed
fix: add docs header marker; tests for valueless and empty-literal aria-label
1 parent 19039d6 commit 03c3f03

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

docs/rules/template-no-aria-label-misuse.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# ember/template-no-aria-label-misuse
22

3+
<!-- begin auto-generated rule header -->
34
<!-- end auto-generated rule header -->
45

56
Flag `aria-label` and `aria-labelledby` on elements whose computed role

tests/lib/rules/template-no-aria-label-misuse.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ const validHbs = [
5858
// role per WAI-ARIA §4.1. `role="xxyxyz button"` resolves to `button`,
5959
// which accepts aria-label — should not flag.
6060
'<div role="xxyxyz button" aria-label="Custom">x</div>',
61+
// Valueless aria-label carries no name — treated as empty, not flagged as misuse.
62+
'<div aria-label>x</div>',
63+
// Static string-literal mustache — empty string is treated as no label.
64+
'<div aria-label={{""}}>x</div>',
6165
];
6266

6367
const invalidHbs = [

0 commit comments

Comments
 (0)