Skip to content

Commit 48deb08

Browse files
committed
test(template-require-mandatory-role-attributes): absorb audit-fixture cases, drop audit fixture
Upstream maintainers don't want the per-PR `tests/audit/peer-parity` pattern. Port two basic widget-role-missing-required-attrs cases that peer plugins also flag (slider missing aria-valuenow, checkbox missing aria-checked) into the regular suite. Other audit cases were already covered by the regular tests on this branch — including the previous DIVERGENCE cases (role="COMBOBOX", role="combobox listbox") which this PR's lowercase + split-whitespace fix turns into INVALID assertions in the regular suite.
1 parent a934d3b commit 48deb08

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

tests/lib/rules/template-require-mandatory-role-attributes.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,18 @@ ruleTester.run('template-require-mandatory-role-attributes', rule, {
7474
output: null,
7575
errors: [{ message: 'The attribute aria-selected is required by the role option' }],
7676
},
77+
// Plain widget roles missing all required attrs — basic coverage that
78+
// peer plugins (jsx-a11y / vue-a11y / angular-eslint) also flag.
79+
{
80+
code: '<template><div role="slider" /></template>',
81+
output: null,
82+
errors: [{ message: 'The attribute aria-valuenow is required by the role slider' }],
83+
},
84+
{
85+
code: '<template><div role="checkbox" /></template>',
86+
output: null,
87+
errors: [{ message: 'The attribute aria-checked is required by the role checkbox' }],
88+
},
7789
{
7890
code: '<template><CustomComponent role="checkbox" aria-required="true" /></template>',
7991
output: null,

0 commit comments

Comments
 (0)