Skip to content

Commit 5bc47f9

Browse files
committed
test(template-no-redundant-role): absorb audit-fixture cases, drop audit fixture
Upstream maintainers don't want the per-PR `tests/audit/peer-parity` pattern. Port two basic non-landmark redundancy cases that were only in the audit fixture into the regular suite: - `<button role="button">` (autofix drops role) - `<img role="img">` (autofix drops role) Other audit cases were already covered by the regular tests.
1 parent dd083fb commit 5bc47f9

2 files changed

Lines changed: 11 additions & 214 deletions

File tree

tests/audit/no-redundant-roles/peer-parity.js

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

tests/lib/rules/template-no-redundant-role.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,17 @@ ruleTester.run('template-no-redundant-role', rule, {
8787
},
8888
],
8989
},
90+
// Non-landmark same-role redundancy — covered by jsx-a11y / vue-a11y too.
91+
{
92+
code: '<template><button role="button"></button></template>',
93+
output: '<template><button></button></template>',
94+
errors: [{ message: 'Use of redundant or invalid role: button on <button> detected.' }],
95+
},
96+
{
97+
code: '<template><img role="img" /></template>',
98+
output: '<template><img /></template>',
99+
errors: [{ message: 'Use of redundant or invalid role: img on <img> detected.' }],
100+
},
90101
{
91102
// Valueless `<select size>` — per HTML boolean-attr semantics, the
92103
// attribute value is an empty string; Number('') is 0; 0 is NOT > 1,

0 commit comments

Comments
 (0)