@@ -129,6 +129,54 @@ describe('aria-valid-attr-value', function() {
129
129
) ;
130
130
} ) ;
131
131
132
+ it ( 'should pass on aria-controls and aria-expanded=false when the element is not in the DOM' , function ( ) {
133
+ fixtureSetup (
134
+ '<button aria-controls="test" aria-expanded="false">Button</button>'
135
+ ) ;
136
+ var passing1 = fixture . querySelector ( 'button' ) ;
137
+ assert . isTrue (
138
+ checks [ 'aria-valid-attr-value' ] . evaluate . call ( checkContext , passing1 )
139
+ ) ;
140
+ } ) ;
141
+
142
+ it ( 'should pass on aria-controls and aria-selected=false when the element is not in the DOM' , function ( ) {
143
+ fixtureSetup (
144
+ '<button aria-controls="test" aria-selected="false">Button</button>'
145
+ ) ;
146
+ var passing1 = fixture . querySelector ( 'button' ) ;
147
+ assert . isTrue (
148
+ checks [ 'aria-valid-attr-value' ] . evaluate . call ( checkContext , passing1 )
149
+ ) ;
150
+ } ) ;
151
+
152
+ it ( 'should fail on aria-controls and aria-expanded=true when the element is not in the DOM' , function ( ) {
153
+ fixtureSetup (
154
+ '<button aria-controls="test" aria-expanded="true">Button</button>'
155
+ ) ;
156
+ var failing1 = fixture . querySelector ( 'button' ) ;
157
+ assert . isFalse (
158
+ checks [ 'aria-valid-attr-value' ] . evaluate . call ( checkContext , failing1 )
159
+ ) ;
160
+ } ) ;
161
+
162
+ it ( 'should fail on aria-controls and aria-selected=true when the element is not in the DOM' , function ( ) {
163
+ fixtureSetup (
164
+ '<button aria-controls="test" aria-selected="true">Button</button>'
165
+ ) ;
166
+ var failing1 = fixture . querySelector ( 'button' ) ;
167
+ assert . isFalse (
168
+ checks [ 'aria-valid-attr-value' ] . evaluate . call ( checkContext , failing1 )
169
+ ) ;
170
+ } ) ;
171
+
172
+ it ( 'should fail on aria-controls when the element is not in the DOM' , function ( ) {
173
+ fixtureSetup ( '<button aria-controls="test">Button</button>' ) ;
174
+ var failing1 = fixture . querySelector ( 'button' ) ;
175
+ assert . isFalse (
176
+ checks [ 'aria-valid-attr-value' ] . evaluate . call ( checkContext , failing1 )
177
+ ) ;
178
+ } ) ;
179
+
132
180
describe ( 'options' , function ( ) {
133
181
it ( 'should exclude supplied attributes' , function ( ) {
134
182
fixture . innerHTML =
0 commit comments