@@ -56,6 +56,7 @@ describe('ReactDOMTestSelectors', () => {
56
56
} ) ;
57
57
58
58
describe ( 'findAllNodes' , ( ) => {
59
+ // @gate www
59
60
it ( 'should support searching from the document root' , ( ) => {
60
61
function Example ( ) {
61
62
return (
@@ -75,6 +76,7 @@ describe('ReactDOMTestSelectors', () => {
75
76
expect ( matches [ 0 ] . id ) . toBe ( 'match' ) ;
76
77
} ) ;
77
78
79
+ // @gate www
78
80
it ( 'should support searching from the container' , ( ) => {
79
81
function Example ( ) {
80
82
return (
@@ -94,6 +96,7 @@ describe('ReactDOMTestSelectors', () => {
94
96
expect ( matches [ 0 ] . id ) . toBe ( 'match' ) ;
95
97
} ) ;
96
98
99
+ // @gate www
97
100
it ( 'should support searching from a previous match if the match had a data-testname' , ( ) => {
98
101
function Outer ( ) {
99
102
return (
@@ -124,6 +127,7 @@ describe('ReactDOMTestSelectors', () => {
124
127
expect ( matches [ 0 ] . id ) . toBe ( 'inner' ) ;
125
128
} ) ;
126
129
130
+ // @gate www
127
131
it ( 'should not support searching from a previous match if the match did not have a data-testname' , ( ) => {
128
132
function Outer ( ) {
129
133
return (
@@ -153,6 +157,7 @@ describe('ReactDOMTestSelectors', () => {
153
157
) ;
154
158
} ) ;
155
159
160
+ // @gate www
156
161
it ( 'should support an multiple component types in the selector array' , ( ) => {
157
162
function Outer ( ) {
158
163
return (
@@ -206,6 +211,7 @@ describe('ReactDOMTestSelectors', () => {
206
211
expect ( matches [ 0 ] . id ) . toBe ( 'match3' ) ;
207
212
} ) ;
208
213
214
+ // @gate www
209
215
it ( 'should find multiple matches' , ( ) => {
210
216
function Example1 ( ) {
211
217
return (
@@ -243,6 +249,7 @@ describe('ReactDOMTestSelectors', () => {
243
249
] ) ;
244
250
} ) ;
245
251
252
+ // @gate www
246
253
it ( 'should ignore nested matches' , ( ) => {
247
254
function Example ( ) {
248
255
return (
@@ -262,6 +269,7 @@ describe('ReactDOMTestSelectors', () => {
262
269
expect ( matches [ 0 ] . id ) . toEqual ( 'match1' ) ;
263
270
} ) ;
264
271
272
+ // @gate www
265
273
it ( 'should enforce the specific order of selectors' , ( ) => {
266
274
function Outer ( ) {
267
275
return (
@@ -286,6 +294,7 @@ describe('ReactDOMTestSelectors', () => {
286
294
) . toHaveLength ( 0 ) ;
287
295
} ) ;
288
296
297
+ // @gate www
289
298
it ( 'should not search within hidden subtrees' , ( ) => {
290
299
const ref1 = React . createRef ( null ) ;
291
300
const ref2 = React . createRef ( null ) ;
@@ -315,6 +324,7 @@ describe('ReactDOMTestSelectors', () => {
315
324
expect ( matches [ 0 ] ) . toBe ( ref2 . current ) ;
316
325
} ) ;
317
326
327
+ // @gate www
318
328
it ( 'should support filtering by display text' , ( ) => {
319
329
function Example ( ) {
320
330
return (
@@ -337,6 +347,7 @@ describe('ReactDOMTestSelectors', () => {
337
347
expect ( matches [ 0 ] . id ) . toBe ( 'match' ) ;
338
348
} ) ;
339
349
350
+ // @gate www
340
351
it ( 'should support filtering by explicit accessibiliy role' , ( ) => {
341
352
function Example ( ) {
342
353
return (
@@ -361,6 +372,7 @@ describe('ReactDOMTestSelectors', () => {
361
372
expect ( matches [ 0 ] . id ) . toBe ( 'match' ) ;
362
373
} ) ;
363
374
375
+ // @gate www
364
376
it ( 'should support filtering by explicit secondary accessibiliy role' , ( ) => {
365
377
const ref = React . createRef ( ) ;
366
378
@@ -385,6 +397,7 @@ describe('ReactDOMTestSelectors', () => {
385
397
expect ( matches [ 0 ] ) . toBe ( ref . current ) ;
386
398
} ) ;
387
399
400
+ // @gate www
388
401
it ( 'should support filtering by implicit accessibiliy role' , ( ) => {
389
402
function Example ( ) {
390
403
return (
@@ -407,6 +420,7 @@ describe('ReactDOMTestSelectors', () => {
407
420
expect ( matches [ 0 ] . id ) . toBe ( 'match' ) ;
408
421
} ) ;
409
422
423
+ // @gate www
410
424
it ( 'should support filtering by implicit accessibiliy role with attributes qualifications' , ( ) => {
411
425
function Example ( ) {
412
426
return (
@@ -429,6 +443,7 @@ describe('ReactDOMTestSelectors', () => {
429
443
expect ( matches [ 0 ] . id ) . toBe ( 'match' ) ;
430
444
} ) ;
431
445
446
+ // @gate www
432
447
it ( 'should support searching ahead with the has() selector' , ( ) => {
433
448
function Example ( ) {
434
449
return (
@@ -464,12 +479,14 @@ describe('ReactDOMTestSelectors', () => {
464
479
expect ( matches [ 0 ] . id ) . toBe ( 'match' ) ;
465
480
} ) ;
466
481
482
+ // @gate www
467
483
it ( 'should throw if no container can be found' , ( ) => {
468
484
expect ( ( ) => findAllNodes ( document . body , [ ] ) ) . toThrow (
469
485
'Could not find React container within specified host subtree.' ,
470
486
) ;
471
487
} ) ;
472
488
489
+ // @gate www
473
490
it ( 'should throw if an invalid host root is specified' , ( ) => {
474
491
const ref = React . createRef ( ) ;
475
492
function Example ( ) {
@@ -485,6 +502,7 @@ describe('ReactDOMTestSelectors', () => {
485
502
} ) ;
486
503
487
504
describe ( 'getFindAllNodesFailureDescription' , ( ) => {
505
+ // @gate www
488
506
it ( 'should describe findAllNodes failures caused by the component type selector' , ( ) => {
489
507
function Outer ( ) {
490
508
return < Middle /> ;
@@ -514,6 +532,7 @@ No matching component was found for:
514
532
) ;
515
533
} ) ;
516
534
535
+ // @gate www
517
536
it ( 'should return null if findAllNodes was able to find a match' , ( ) => {
518
537
function Example ( ) {
519
538
return (
@@ -549,6 +568,7 @@ No matching component was found for:
549
568
} ;
550
569
}
551
570
571
+ // @gate www
552
572
it ( 'should return a single rect for a component that returns a single root host element' , ( ) => {
553
573
const ref = React . createRef ( ) ;
554
574
@@ -582,6 +602,7 @@ No matching component was found for:
582
602
} ) ;
583
603
} ) ;
584
604
605
+ // @gate www
585
606
it ( 'should return a multiple rects for multiple matches' , ( ) => {
586
607
const outerRef = React . createRef ( ) ;
587
608
const innerRef = React . createRef ( ) ;
@@ -631,6 +652,7 @@ No matching component was found for:
631
652
} ) ;
632
653
} ) ;
633
654
655
+ // @gate www
634
656
it ( 'should return a multiple rects for single match that returns a fragment' , ( ) => {
635
657
const refA = React . createRef ( ) ;
636
658
const refB = React . createRef ( ) ;
@@ -680,6 +702,7 @@ No matching component was found for:
680
702
} ) ;
681
703
} ) ;
682
704
705
+ // @gate www
683
706
it ( 'should merge overlapping rects' , ( ) => {
684
707
const refA = React . createRef ( ) ;
685
708
const refB = React . createRef ( ) ;
@@ -734,6 +757,7 @@ No matching component was found for:
734
757
} ) ;
735
758
} ) ;
736
759
760
+ // @gate www
737
761
it ( 'should merge some types of adjacent rects (if they are the same in one dimension)' , ( ) => {
738
762
const refA = React . createRef ( ) ;
739
763
const refB = React . createRef ( ) ;
@@ -833,6 +857,7 @@ No matching component was found for:
833
857
} ) ;
834
858
} ) ;
835
859
860
+ // @gate www
836
861
it ( 'should not search within hidden subtrees' , ( ) => {
837
862
const refA = React . createRef ( ) ;
838
863
const refB = React . createRef ( ) ;
@@ -889,6 +914,7 @@ No matching component was found for:
889
914
} ) ;
890
915
891
916
describe ( 'focusWithin' , ( ) => {
917
+ // @gate www
892
918
it ( 'should return false if the specified component path has no matches' , ( ) => {
893
919
function Example ( ) {
894
920
return < Child /> ;
@@ -909,6 +935,7 @@ No matching component was found for:
909
935
expect ( didFocus ) . toBe ( false ) ;
910
936
} ) ;
911
937
938
+ // @gate www
912
939
it ( 'should return false if there are no focusable elements within the matched subtree' , ( ) => {
913
940
function Example ( ) {
914
941
return < Child /> ;
@@ -926,6 +953,7 @@ No matching component was found for:
926
953
expect ( didFocus ) . toBe ( false ) ;
927
954
} ) ;
928
955
956
+ // @gate www
929
957
it ( 'should return false if the only focusable elements are disabled' , ( ) => {
930
958
function Example ( ) {
931
959
return (
@@ -943,6 +971,7 @@ No matching component was found for:
943
971
expect ( didFocus ) . toBe ( false ) ;
944
972
} ) ;
945
973
974
+ // @gate www
946
975
it ( 'should return false if the only focusable elements are hidden' , ( ) => {
947
976
function Example ( ) {
948
977
return < button hidden = { true } > not clickable</ button > ;
@@ -956,6 +985,7 @@ No matching component was found for:
956
985
expect ( didFocus ) . toBe ( false ) ;
957
986
} ) ;
958
987
988
+ // @gate www
959
989
it ( 'should successfully focus the first focusable element within the tree' , ( ) => {
960
990
const secondRef = React . createRef ( null ) ;
961
991
@@ -1010,6 +1040,7 @@ No matching component was found for:
1010
1040
expect ( handleThirdFocus ) . not . toHaveBeenCalled ( ) ;
1011
1041
} ) ;
1012
1042
1043
+ // @gate www
1013
1044
it ( 'should successfully focus the first focusable element even if application logic interferes' , ( ) => {
1014
1045
const ref = React . createRef ( null ) ;
1015
1046
@@ -1039,6 +1070,7 @@ No matching component was found for:
1039
1070
expect ( handleFocus ) . toHaveBeenCalledTimes ( 1 ) ;
1040
1071
} ) ;
1041
1072
1073
+ // @gate www
1042
1074
it ( 'should not focus within hidden subtrees' , ( ) => {
1043
1075
const secondRef = React . createRef ( null ) ;
1044
1076
@@ -1162,6 +1194,7 @@ No matching component was found for:
1162
1194
window . IntersectionObserver = IntersectionObserver ;
1163
1195
} ) ;
1164
1196
1197
+ // @gate www
1165
1198
it ( 'should notify a listener when the underlying instance intersection changes' , ( ) => {
1166
1199
const ref = React . createRef ( null ) ;
1167
1200
@@ -1198,6 +1231,7 @@ No matching component was found for:
1198
1231
expect ( handleVisibilityChange ) . toHaveBeenCalledWith ( [ { rect, ratio : 0.5 } ] ) ;
1199
1232
} ) ;
1200
1233
1234
+ // @gate www
1201
1235
it ( 'should notify a listener of multiple targets when the underlying instance intersection changes' , ( ) => {
1202
1236
const ref1 = React . createRef ( null ) ;
1203
1237
const ref2 = React . createRef ( null ) ;
@@ -1274,6 +1308,7 @@ No matching component was found for:
1274
1308
] ) ;
1275
1309
} ) ;
1276
1310
1311
+ // @gate www
1277
1312
it ( 'should stop listening when its disconnected' , ( ) => {
1278
1313
const ref = React . createRef ( null ) ;
1279
1314
@@ -1308,7 +1343,7 @@ No matching component was found for:
1308
1343
} ) ;
1309
1344
1310
1345
// This test reuires gating because it relies on the __DEV__ only commit hook to work.
1311
- // @gate __DEV__
1346
+ // @gate www && __DEV__
1312
1347
it ( 'should update which targets its listening to after a commit' , ( ) => {
1313
1348
const ref1 = React . createRef ( null ) ;
1314
1349
const ref2 = React . createRef ( null ) ;
@@ -1387,6 +1422,7 @@ No matching component was found for:
1387
1422
] ) ;
1388
1423
} ) ;
1389
1424
1425
+ // @gate www
1390
1426
it ( 'should not observe components within hidden subtrees' , ( ) => {
1391
1427
const ref1 = React . createRef ( null ) ;
1392
1428
const ref2 = React . createRef ( null ) ;
0 commit comments