@@ -56,6 +56,16 @@ ruleTester.run('template-no-invalid-role', rule, {
5656 '<template><AwesomeThing role="presentation"></AwesomeThing></template>' ,
5757 '<template><table role="textbox"></table></template>' ,
5858 '<template><div role="{{if this.inModal "dialog" "contentinfo" }}"></div></template>' ,
59+
60+ // Missing VALID_ROLES entries: associationlistitemkey, associationlistitemvalue, cell
61+ '<template><div role="associationlistitemkey">Key</div></template>' ,
62+ '<template><div role="associationlistitemvalue">Value</div></template>' ,
63+ '<template><td role="cell">Data</td></template>' ,
64+
65+ // Case-insensitive role matching
66+ '<template><div role="Button">Click</div></template>' ,
67+ '<template><div role="NAVIGATION">Nav</div></template>' ,
68+ '<template><div role="ALERT">Alert</div></template>' ,
5969 ] ,
6070
6171 invalid : [
@@ -156,6 +166,32 @@ ruleTester.run('template-no-invalid-role', rule, {
156166 output : null ,
157167 errors : [ { message : "Invalid ARIA role 'COMMAND INTERFACE'. Must be a valid ARIA role." } ] ,
158168 } ,
169+
170+ // Newly added SEMANTIC_ELEMENTS: presentation/none on iframe, video, audio
171+ {
172+ code : '<template><iframe role="presentation"></iframe></template>' ,
173+ output : null ,
174+ errors : [
175+ { message : 'The role "presentation" should not be used on the semantic element <iframe>.' } ,
176+ ] ,
177+ } ,
178+ {
179+ code : '<template><video role="none"></video></template>' ,
180+ output : null ,
181+ errors : [ { message : 'The role "none" should not be used on the semantic element <video>.' } ] ,
182+ } ,
183+ {
184+ code : '<template><audio role="presentation"></audio></template>' ,
185+ output : null ,
186+ errors : [
187+ { message : 'The role "presentation" should not be used on the semantic element <audio>.' } ,
188+ ] ,
189+ } ,
190+ {
191+ code : '<template><embed role="none"></template>' ,
192+ output : null ,
193+ errors : [ { message : 'The role "none" should not be used on the semantic element <embed>.' } ] ,
194+ } ,
159195 ] ,
160196} ) ;
161197
@@ -187,6 +223,14 @@ hbsRuleTester.run('template-no-invalid-role', rule, {
187223 '<AwesomeThing role="presentation"></AwesomeThing>' ,
188224 '<table role="textbox"></table>' ,
189225 '<div role="{{if this.inModal "dialog" "contentinfo" }}"></div>' ,
226+ // Missing VALID_ROLES entries: associationlistitemkey, associationlistitemvalue, cell
227+ '<div role="associationlistitemkey">Key</div>' ,
228+ '<div role="associationlistitemvalue">Value</div>' ,
229+ '<td role="cell">Data</td>' ,
230+ // Case-insensitive role matching
231+ '<div role="Button">Click</div>' ,
232+ '<div role="NAVIGATION">Nav</div>' ,
233+ '<div role="ALERT">Alert</div>' ,
190234 // catchNonexistentRoles: false — non-existent roles are not flagged
191235 {
192236 code : '<div role="command interface"></div>' ,
@@ -260,5 +304,30 @@ hbsRuleTester.run('template-no-invalid-role', rule, {
260304 output : null ,
261305 errors : [ { message : "Invalid ARIA role 'COMMAND INTERFACE'. Must be a valid ARIA role." } ] ,
262306 } ,
307+ // Newly added SEMANTIC_ELEMENTS: presentation/none on iframe, video, audio, embed
308+ {
309+ code : '<iframe role="presentation"></iframe>' ,
310+ output : null ,
311+ errors : [
312+ { message : 'The role "presentation" should not be used on the semantic element <iframe>.' } ,
313+ ] ,
314+ } ,
315+ {
316+ code : '<video role="none"></video>' ,
317+ output : null ,
318+ errors : [ { message : 'The role "none" should not be used on the semantic element <video>.' } ] ,
319+ } ,
320+ {
321+ code : '<audio role="presentation"></audio>' ,
322+ output : null ,
323+ errors : [
324+ { message : 'The role "presentation" should not be used on the semantic element <audio>.' } ,
325+ ] ,
326+ } ,
327+ {
328+ code : '<embed role="none">' ,
329+ output : null ,
330+ errors : [ { message : 'The role "none" should not be used on the semantic element <embed>.' } ] ,
331+ } ,
263332 ] ,
264333} ) ;
0 commit comments