Skip to content

Commit 499ec42

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 4f7f10f commit 499ec42

2 files changed

Lines changed: 12 additions & 239 deletions

File tree

tests/audit/role-has-required-aria/peer-parity.js

Lines changed: 0 additions & 239 deletions
This file was deleted.

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

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

0 commit comments

Comments
 (0)