@@ -33,6 +33,7 @@ class Button extends React.Component<any> {
33
33
accessibilityRole = { TEXT_ROLE }
34
34
accessibilityStates = { [ 'selected' ] }
35
35
accessibilityState = { { expanded : false , selected : true } }
36
+ accessibilityValue = { { min : 40 , max : 60 } }
36
37
>
37
38
{ this . props . children }
38
39
</ Typography >
@@ -50,6 +51,7 @@ function Section() {
50
51
accessibilityRole = { TEXT_ROLE }
51
52
accessibilityStates = { [ 'selected' , 'disabled' ] }
52
53
accessibilityState = { { expanded : false } }
54
+ accessibilityValue = { { max : 60 } }
53
55
>
54
56
Title
55
57
</ Typography >
@@ -202,3 +204,35 @@ test('getAllByA11yState, queryAllByA11yState', () => {
202
204
expect ( getAllByA11yState ( { expanded : false } ) . length ) . toEqual ( 2 ) ;
203
205
expect ( queryAllByA11yState ( { expanded : false } ) . length ) . toEqual ( 2 ) ;
204
206
} ) ;
207
+
208
+ test ( 'getByA11yValue, queryByA11yValue' , ( ) => {
209
+ const { getByA11yValue, queryByA11yValue } = render ( < Section /> ) ;
210
+
211
+ expect ( getByA11yValue ( { min : 40 } ) . props . accessibilityValue ) . toEqual ( {
212
+ min : 40 ,
213
+ max : 60 ,
214
+ } ) ;
215
+ expect ( queryByA11yValue ( { min : 40 } ) ?. props . accessibilityValue ) . toEqual ( {
216
+ min : 40 ,
217
+ max : 60 ,
218
+ } ) ;
219
+
220
+ expect ( ( ) => getByA11yValue ( { min : 50 } ) ) . toThrow ( NO_INSTANCES_FOUND ) ;
221
+ expect ( queryByA11yValue ( { min : 50 } ) ) . toEqual ( null ) ;
222
+
223
+ expect ( ( ) => getByA11yValue ( { max : 60 } ) ) . toThrow ( FOUND_TWO_INSTANCES ) ;
224
+ expect ( ( ) => queryByA11yValue ( { max : 60 } ) ) . toThrow ( FOUND_TWO_INSTANCES ) ;
225
+ } ) ;
226
+
227
+ test ( 'getAllByA11yValue, queryAllByA11yValue' , ( ) => {
228
+ const { getAllByA11yValue, queryAllByA11yValue } = render ( < Section /> ) ;
229
+
230
+ expect ( getAllByA11yValue ( { min : 40 } ) . length ) . toEqual ( 1 ) ;
231
+ expect ( queryAllByA11yValue ( { min : 40 } ) . length ) . toEqual ( 1 ) ;
232
+
233
+ expect ( ( ) => getAllByA11yValue ( { min : 50 } ) ) . toThrow ( NO_INSTANCES_FOUND ) ;
234
+ expect ( queryAllByA11yValue ( { min : 50 } ) ) . toEqual ( [ ] ) ;
235
+
236
+ expect ( getAllByA11yValue ( { max : 60 } ) . length ) . toEqual ( 2 ) ;
237
+ expect ( queryAllByA11yValue ( { max : 60 } ) . length ) . toEqual ( 2 ) ;
238
+ } ) ;
0 commit comments