@@ -67,6 +67,10 @@ ruleTester.run('template-no-role-presentation-on-focusable', rule, {
6767 // Disabled form controls are not keyboard-focusable (HTML §4.10.18.5).
6868 '<template><button disabled role="presentation">Click</button></template>' ,
6969 '<template><input type="text" disabled role="presentation" /></template>' ,
70+ // Bare-mustache falsy on tabindex (rows t6, t7) — Glimmer omits at runtime,
71+ // element isn't focusable from tabindex, so role="presentation" is fine.
72+ '<template><div tabindex={{false}} role="presentation"></div></template>' ,
73+ '<template><div tabindex={{null}} role="none"></div></template>' ,
7074
7175 // Non-focusable wrapper with role="presentation" around a focusable child —
7276 // the rule only checks the element that carries the role, not its subtree.
@@ -84,6 +88,18 @@ ruleTester.run('template-no-role-presentation-on-focusable', rule, {
8488 output : null ,
8589 errors : [ { messageId : 'invalidPresentation' } ] ,
8690 } ,
91+ // Bare-mustache falsy on disabled (rows d3, d6) — Glimmer omits the
92+ // attribute, button stays focusable, role="presentation" is invalid.
93+ {
94+ code : '<template><button disabled={{false}} role="presentation">Click</button></template>' ,
95+ output : null ,
96+ errors : [ { messageId : 'invalidPresentation' } ] ,
97+ } ,
98+ {
99+ code : '<template><button disabled={{null}} role="presentation">Click</button></template>' ,
100+ output : null ,
101+ errors : [ { messageId : 'invalidPresentation' } ] ,
102+ } ,
87103 {
88104 code : '<template><button role="none">Click</button></template>' ,
89105 output : null ,
0 commit comments