Skip to content

Commit 835b89e

Browse files
committed
Fix test failures in role-supports-aria-props-test due to ARIA 1.2 updates
1 parent 0c8880d commit 835b89e

File tree

1 file changed

+146
-38
lines changed

1 file changed

+146
-38
lines changed

__tests__/src/rules/role-supports-aria-props-test.js

Lines changed: 146 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ ruleTester.run('role-supports-aria-props', rule, {
8585
{ code: '<a href="#" aria-dropeffect />' },
8686
{ code: '<a href="#" aria-flowto />' },
8787
{ code: '<a href="#" aria-grabbed />' },
88-
{ code: '<a href="#" aria-haspopup />' },
8988
{ code: '<a href="#" aria-hidden />' },
90-
{ code: '<a href="#" aria-invalid />' },
9189
{ code: '<a href="#" aria-label />' },
9290
{ code: '<a href="#" aria-labelledby />' },
9391
{ code: '<a href="#" aria-live />' },
@@ -107,9 +105,7 @@ ruleTester.run('role-supports-aria-props', rule, {
107105
{ code: '<area href="#" aria-dropeffect />' },
108106
{ code: '<area href="#" aria-flowto />' },
109107
{ code: '<area href="#" aria-grabbed />' },
110-
{ code: '<area href="#" aria-haspopup />' },
111108
{ code: '<area href="#" aria-hidden />' },
112-
{ code: '<area href="#" aria-invalid />' },
113109
{ code: '<area href="#" aria-label />' },
114110
{ code: '<area href="#" aria-labelledby />' },
115111
{ code: '<area href="#" aria-live />' },
@@ -129,9 +125,7 @@ ruleTester.run('role-supports-aria-props', rule, {
129125
{ code: '<link href="#" aria-dropeffect />' },
130126
{ code: '<link href="#" aria-flowto />' },
131127
{ code: '<link href="#" aria-grabbed />' },
132-
{ code: '<link href="#" aria-haspopup />' },
133128
{ code: '<link href="#" aria-hidden />' },
134-
{ code: '<link href="#" aria-invalid />' },
135129
{ code: '<link href="#" aria-label />' },
136130
{ code: '<link href="#" aria-labelledby />' },
137131
{ code: '<link href="#" aria-live />' },
@@ -149,7 +143,6 @@ ruleTester.run('role-supports-aria-props', rule, {
149143

150144
// MENU TESTS - implicit role is `toolbar` when `type="toolbar"`
151145
{ code: '<menu type="toolbar" aria-activedescendant />' },
152-
{ code: '<menu type="toolbar" aria-expanded />' },
153146
{ code: '<menu type="toolbar" aria-atomic />' },
154147
{ code: '<menu type="toolbar" aria-busy />' },
155148
{ code: '<menu type="toolbar" aria-controls />' },
@@ -158,9 +151,7 @@ ruleTester.run('role-supports-aria-props', rule, {
158151
{ code: '<menu type="toolbar" aria-dropeffect />' },
159152
{ code: '<menu type="toolbar" aria-flowto />' },
160153
{ code: '<menu type="toolbar" aria-grabbed />' },
161-
{ code: '<menu type="toolbar" aria-haspopup />' },
162154
{ code: '<menu type="toolbar" aria-hidden />' },
163-
{ code: '<menu type="toolbar" aria-invalid />' },
164155
{ code: '<menu type="toolbar" aria-label />' },
165156
{ code: '<menu type="toolbar" aria-labelledby />' },
166157
{ code: '<menu type="toolbar" aria-live />' },
@@ -182,7 +173,6 @@ ruleTester.run('role-supports-aria-props', rule, {
182173
{ code: '<menuitem type="command" aria-grabbed />' },
183174
{ code: '<menuitem type="command" aria-haspopup />' },
184175
{ code: '<menuitem type="command" aria-hidden />' },
185-
{ code: '<menuitem type="command" aria-invalid />' },
186176
{ code: '<menuitem type="command" aria-label />' },
187177
{ code: '<menuitem type="command" aria-labelledby />' },
188178
{ code: '<menuitem type="command" aria-live />' },
@@ -225,7 +215,6 @@ ruleTester.run('role-supports-aria-props', rule, {
225215
{ code: '<menuitem type="radio" aria-owns />' },
226216
{ code: '<menuitem type="radio" aria-relevant />' },
227217
{ code: '<menuitem type="radio" aria-posinset />' },
228-
{ code: '<menuitem type="radio" aria-selected />' },
229218
{ code: '<menuitem type="radio" aria-setsize />' },
230219

231220
// these will have global
@@ -246,7 +235,6 @@ ruleTester.run('role-supports-aria-props', rule, {
246235
{ code: '<input type="button" aria-grabbed />' },
247236
{ code: '<input type="button" aria-haspopup />' },
248237
{ code: '<input type="button" aria-hidden />' },
249-
{ code: '<input type="button" aria-invalid />' },
250238
{ code: '<input type="button" aria-label />' },
251239
{ code: '<input type="button" aria-labelledby />' },
252240
{ code: '<input type="button" aria-live />' },
@@ -265,7 +253,6 @@ ruleTester.run('role-supports-aria-props', rule, {
265253
{ code: '<input type="image" aria-grabbed />' },
266254
{ code: '<input type="image" aria-haspopup />' },
267255
{ code: '<input type="image" aria-hidden />' },
268-
{ code: '<input type="image" aria-invalid />' },
269256
{ code: '<input type="image" aria-label />' },
270257
{ code: '<input type="image" aria-labelledby />' },
271258
{ code: '<input type="image" aria-live />' },
@@ -284,7 +271,6 @@ ruleTester.run('role-supports-aria-props', rule, {
284271
{ code: '<input type="reset" aria-grabbed />' },
285272
{ code: '<input type="reset" aria-haspopup />' },
286273
{ code: '<input type="reset" aria-hidden />' },
287-
{ code: '<input type="reset" aria-invalid />' },
288274
{ code: '<input type="reset" aria-label />' },
289275
{ code: '<input type="reset" aria-labelledby />' },
290276
{ code: '<input type="reset" aria-live />' },
@@ -303,14 +289,12 @@ ruleTester.run('role-supports-aria-props', rule, {
303289
{ code: '<input type="submit" aria-grabbed />' },
304290
{ code: '<input type="submit" aria-haspopup />' },
305291
{ code: '<input type="submit" aria-hidden />' },
306-
{ code: '<input type="submit" aria-invalid />' },
307292
{ code: '<input type="submit" aria-label />' },
308293
{ code: '<input type="submit" aria-labelledby />' },
309294
{ code: '<input type="submit" aria-live />' },
310295
{ code: '<input type="submit" aria-owns />' },
311296
{ code: '<input type="submit" aria-relevant />' },
312297
// when `type="checkbox"`, the implicit role is `checkbox`
313-
{ code: '<input type="checkbox" aria-checked />' },
314298
{ code: '<input type="checkbox" aria-atomic />' },
315299
{ code: '<input type="checkbox" aria-busy />' },
316300
{ code: '<input type="checkbox" aria-controls />' },
@@ -319,7 +303,6 @@ ruleTester.run('role-supports-aria-props', rule, {
319303
{ code: '<input type="checkbox" aria-dropeffect />' },
320304
{ code: '<input type="checkbox" aria-flowto />' },
321305
{ code: '<input type="checkbox" aria-grabbed />' },
322-
{ code: '<input type="checkbox" aria-haspopup />' },
323306
{ code: '<input type="checkbox" aria-hidden />' },
324307
{ code: '<input type="checkbox" aria-invalid />' },
325308
{ code: '<input type="checkbox" aria-label />' },
@@ -328,7 +311,6 @@ ruleTester.run('role-supports-aria-props', rule, {
328311
{ code: '<input type="checkbox" aria-owns />' },
329312
{ code: '<input type="checkbox" aria-relevant />' },
330313
// when `type="radio"`, the implicit role is `radio`
331-
{ code: '<input type="radio" aria-checked />' },
332314
{ code: '<input type="radio" aria-atomic />' },
333315
{ code: '<input type="radio" aria-busy />' },
334316
{ code: '<input type="radio" aria-controls />' },
@@ -337,16 +319,13 @@ ruleTester.run('role-supports-aria-props', rule, {
337319
{ code: '<input type="radio" aria-dropeffect />' },
338320
{ code: '<input type="radio" aria-flowto />' },
339321
{ code: '<input type="radio" aria-grabbed />' },
340-
{ code: '<input type="radio" aria-haspopup />' },
341322
{ code: '<input type="radio" aria-hidden />' },
342-
{ code: '<input type="radio" aria-invalid />' },
343323
{ code: '<input type="radio" aria-label />' },
344324
{ code: '<input type="radio" aria-labelledby />' },
345325
{ code: '<input type="radio" aria-live />' },
346326
{ code: '<input type="radio" aria-owns />' },
347327
{ code: '<input type="radio" aria-relevant />' },
348328
{ code: '<input type="radio" aria-posinset />' },
349-
{ code: '<input type="radio" aria-selected />' },
350329
{ code: '<input type="radio" aria-setsize />' },
351330
// when `type="range"`, the implicit role is `slider`
352331
{ code: '<input type="range" aria-valuemax />' },
@@ -384,14 +363,7 @@ ruleTester.run('role-supports-aria-props', rule, {
384363
{ code: '<h2 role="presentation" aria-level={undefined} />' },
385364

386365
// OTHER TESTS
387-
{ code: '<aside aria-expanded />' },
388-
{ code: '<article aria-expanded />' },
389-
{ code: '<body aria-expanded />' },
390366
{ code: '<button aria-pressed />' },
391-
{ code: '<datalist aria-expanded />' },
392-
{ code: '<details aria-expanded />' },
393-
{ code: '<dialog aria-expanded />' },
394-
{ code: '<dl aria-expanded />' },
395367
{ code: '<form aria-hidden />' },
396368
{ code: '<h1 aria-hidden />' },
397369
{ code: '<h2 aria-hidden />' },
@@ -401,20 +373,12 @@ ruleTester.run('role-supports-aria-props', rule, {
401373
{ code: '<h6 aria-hidden />' },
402374
{ code: '<hr aria-hidden />' },
403375
{ code: '<li aria-current />' },
404-
{ code: '<li aria-expanded />' },
405376
{ code: '<meter aria-atomic />' },
406-
{ code: '<nav aria-expanded />' },
407-
{ code: '<ol aria-expanded />' },
408377
{ code: '<option aria-atomic />' },
409-
{ code: '<output aria-expanded />' },
410378
{ code: '<progress aria-atomic />' },
411-
{ code: '<section aria-expanded />' },
412-
{ code: '<select aria-expanded />' },
413-
{ code: '<tbody aria-expanded />' },
414379
{ code: '<textarea aria-hidden />' },
415-
{ code: '<tfoot aria-expanded />' },
416-
{ code: '<thead aria-expanded />' },
417-
{ code: '<ul aria-expanded />' },
380+
{ code: '<select aria-expanded />', },
381+
{ code: '<datalist aria-expanded />', },
418382

419383
].concat(validTests).map(parserOptionsMapper),
420384

@@ -444,5 +408,149 @@ ruleTester.run('role-supports-aria-props', rule, {
444408
code: '<aside aria-checked />',
445409
errors: [errorMessage('aria-checked', 'complementary', 'aside', true)],
446410
},
411+
{
412+
code: '<ul aria-expanded />',
413+
errors: [errorMessage('aria-expanded', 'list', 'ul', true)],
414+
},
415+
{
416+
code: '<details aria-expanded />',
417+
errors: [errorMessage('aria-expanded', 'group', 'details', true)],
418+
},
419+
{
420+
code: '<dialog aria-expanded />',
421+
errors: [errorMessage('aria-expanded', 'dialog', 'dialog', true)],
422+
},
423+
{
424+
code: '<dl aria-expanded />',
425+
errors: [errorMessage('aria-expanded', 'list', 'dl', true)],
426+
},
427+
{
428+
code: '<aside aria-expanded />',
429+
errors: [errorMessage('aria-expanded', 'complementary', 'aside', true)],
430+
},
431+
{
432+
code: '<article aria-expanded />',
433+
errors: [errorMessage('aria-expanded', 'article', 'article', true)],
434+
},
435+
{
436+
code: '<body aria-expanded />',
437+
errors: [errorMessage('aria-expanded', 'document', 'body', true)],
438+
},
439+
{
440+
code: '<li aria-expanded />',
441+
errors: [errorMessage('aria-expanded', 'listitem', 'li', true)],
442+
},
443+
{
444+
code: '<nav aria-expanded />',
445+
errors: [errorMessage('aria-expanded', 'navigation', 'nav', true)],
446+
},
447+
{
448+
code: '<ol aria-expanded />',
449+
errors: [errorMessage('aria-expanded', 'list', 'ol', true)],
450+
},
451+
{
452+
code: '<output aria-expanded />',
453+
errors: [errorMessage('aria-expanded', 'status', 'output', true)],
454+
},
455+
{
456+
code: '<section aria-expanded />',
457+
errors: [errorMessage('aria-expanded', 'region', 'section', true)],
458+
},
459+
{
460+
code: '<tbody aria-expanded />',
461+
errors: [errorMessage('aria-expanded', 'rowgroup', 'tbody', true)],
462+
},
463+
{
464+
code: '<tfoot aria-expanded />',
465+
errors: [errorMessage('aria-expanded', 'rowgroup', 'tfoot', true)],
466+
},
467+
{
468+
code: '<thead aria-expanded />',
469+
errors: [errorMessage('aria-expanded', 'rowgroup', 'thead', true)],
470+
},
471+
{
472+
code: '<input type="radio" aria-invalid />',
473+
errors: [errorMessage('aria-invalid', 'radio', 'input', true)],
474+
},
475+
{
476+
code: '<input type="radio" aria-selected />',
477+
errors: [errorMessage('aria-selected', 'radio', 'input', true)],
478+
},
479+
{
480+
code: '<input type="radio" aria-checked />',
481+
errors: [errorMessage('aria-checked', 'radio', 'input', true)],
482+
},
483+
{
484+
code: '<input type="radio" aria-haspopup />',
485+
errors: [errorMessage('aria-haspopup', 'radio', 'input', true)],
486+
},
487+
{
488+
code: '<input type="checkbox" aria-haspopup />',
489+
errors: [errorMessage('aria-haspopup', 'checkbox', 'input', true)],
490+
},
491+
{
492+
code: '<input type="checkbox" aria-checked />',
493+
errors: [errorMessage('aria-checked', 'checkbox', 'input', true)],
494+
},
495+
{
496+
code: '<input type="reset" aria-invalid />',
497+
errors: [errorMessage('aria-invalid', 'button', 'input', true)],
498+
},
499+
{
500+
code: '<input type="submit" aria-invalid />',
501+
errors: [errorMessage('aria-invalid', 'button', 'input', true)],
502+
},
503+
{
504+
code: '<input type="image" aria-invalid />',
505+
errors: [errorMessage('aria-invalid', 'button', 'input', true)],
506+
},
507+
{
508+
code: '<input type="button" aria-invalid />',
509+
errors: [errorMessage('aria-invalid', 'button', 'input', true)],
510+
},
511+
{
512+
code: '<menuitem type="command" aria-invalid />',
513+
errors: [errorMessage('aria-invalid', 'menuitem', 'menuitem', true)],
514+
},
515+
{
516+
code: '<menuitem type="radio" aria-selected />',
517+
errors: [errorMessage('aria-selected', 'menuitemradio', 'menuitem', true)],
518+
},
519+
{
520+
code: '<menu type="toolbar" aria-haspopup />',
521+
errors: [errorMessage('aria-haspopup', 'toolbar', 'menu', true)],
522+
},
523+
{
524+
code: '<menu type="toolbar" aria-invalid />',
525+
errors: [errorMessage('aria-invalid', 'toolbar', 'menu', true)],
526+
},
527+
{
528+
code: '<menu type="toolbar" aria-expanded />',
529+
errors: [errorMessage('aria-expanded', 'toolbar', 'menu', true)],
530+
},
531+
{
532+
code: '<link href="#" aria-invalid />',
533+
errors: [errorMessage('aria-invalid', 'link', 'link', true)],
534+
},
535+
{
536+
code: '<link href="#" aria-haspopup />',
537+
errors: [errorMessage('aria-haspopup', 'link', 'link', true)],
538+
},
539+
{
540+
code: '<area href="#" aria-invalid />',
541+
errors: [errorMessage('aria-invalid', 'link', 'area', true)],
542+
},
543+
{
544+
code: '<area href="#" aria-haspopup />',
545+
errors: [errorMessage('aria-haspopup', 'link', 'area', true)],
546+
},
547+
{
548+
code: '<a href="#" aria-haspopup />',
549+
errors: [errorMessage('aria-haspopup', 'link', 'a', true)],
550+
},
551+
{
552+
code: '<a href="#" aria-invalid />',
553+
errors: [errorMessage('aria-invalid', 'link', 'a', true)],
554+
},
447555
].concat(invalidTests).map(parserOptionsMapper),
448556
});

0 commit comments

Comments
 (0)