@@ -45,6 +45,7 @@ describe('ReactNative', () => {
4545 require ( 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface' ) . TextInputState ;
4646 } ) ;
4747
48+ // @gate !disableLegacyMode
4849 it ( 'should be able to create and render a native component' , ( ) => {
4950 const View = createReactNativeComponentClass ( 'RCTView' , ( ) => ( {
5051 validAttributes : { foo : true } ,
@@ -58,6 +59,7 @@ describe('ReactNative', () => {
5859 expect ( UIManager . updateView ) . not . toBeCalled ( ) ;
5960 } ) ;
6061
62+ // @gate !disableLegacyMode
6163 it ( 'should be able to create and update a native component' , ( ) => {
6264 const View = createReactNativeComponentClass ( 'RCTView' , ( ) => ( {
6365 validAttributes : { foo : true } ,
@@ -79,6 +81,7 @@ describe('ReactNative', () => {
7981 expect ( UIManager . updateView ) . toBeCalledWith ( 3 , 'RCTView' , { foo : 'bar' } ) ;
8082 } ) ;
8183
84+ // @gate !disableLegacyMode
8285 it ( 'should not call UIManager.updateView after render for properties that have not changed' , ( ) => {
8386 const Text = createReactNativeComponentClass ( 'RCTText' , ( ) => ( {
8487 validAttributes : { foo : true } ,
@@ -105,6 +108,7 @@ describe('ReactNative', () => {
105108 expect ( UIManager . updateView ) . toHaveBeenCalledTimes ( 4 ) ;
106109 } ) ;
107110
111+ // @gate !disableLegacyMode
108112 it ( 'should call dispatchCommand for native refs' , ( ) => {
109113 const View = createReactNativeComponentClass ( 'RCTView' , ( ) => ( {
110114 validAttributes : { foo : true } ,
@@ -133,6 +137,7 @@ describe('ReactNative', () => {
133137 ) ;
134138 } ) ;
135139
140+ // @gate !disableLegacyMode
136141 it ( 'should warn and no-op if calling dispatchCommand on non native refs' , ( ) => {
137142 class BasicClass extends React . Component {
138143 render ( ) {
@@ -162,6 +167,7 @@ describe('ReactNative', () => {
162167 expect ( UIManager . dispatchViewManagerCommand ) . not . toBeCalled ( ) ;
163168 } ) ;
164169
170+ // @gate !disableLegacyMode
165171 it ( 'should call sendAccessibilityEvent for native refs' , ( ) => {
166172 const View = createReactNativeComponentClass ( 'RCTView' , ( ) => ( {
167173 validAttributes : { foo : true } ,
@@ -192,6 +198,7 @@ describe('ReactNative', () => {
192198 ) . toHaveBeenCalledWith ( expect . any ( Number ) , 'focus' ) ;
193199 } ) ;
194200
201+ // @gate !disableLegacyMode
195202 it ( 'should warn and no-op if calling sendAccessibilityEvent on non native refs' , ( ) => {
196203 class BasicClass extends React . Component {
197204 render ( ) {
@@ -221,6 +228,7 @@ describe('ReactNative', () => {
221228 expect ( UIManager . sendAccessibilityEvent ) . not . toBeCalled ( ) ;
222229 } ) ;
223230
231+ // @gate !disableLegacyMode
224232 it ( 'should not call UIManager.updateView from ref.setNativeProps for properties that have not changed' , ( ) => {
225233 const View = createReactNativeComponentClass ( 'RCTView' , ( ) => ( {
226234 validAttributes : { foo : true } ,
@@ -254,6 +262,7 @@ describe('ReactNative', () => {
254262 ) ;
255263 } ) ;
256264
265+ // @gate !disableLegacyMode
257266 it ( 'should call UIManager.measure on ref.measure' , ( ) => {
258267 const View = createReactNativeComponentClass ( 'RCTView' , ( ) => ( {
259268 validAttributes : { foo : true } ,
@@ -280,6 +289,7 @@ describe('ReactNative', () => {
280289 expect ( successCallback ) . toHaveBeenCalledWith ( 10 , 10 , 100 , 100 , 0 , 0 ) ;
281290 } ) ;
282291
292+ // @gate !disableLegacyMode
283293 it ( 'should call UIManager.measureInWindow on ref.measureInWindow' , ( ) => {
284294 const View = createReactNativeComponentClass ( 'RCTView' , ( ) => ( {
285295 validAttributes : { foo : true } ,
@@ -306,6 +316,7 @@ describe('ReactNative', () => {
306316 expect ( successCallback ) . toHaveBeenCalledWith ( 10 , 10 , 100 , 100 ) ;
307317 } ) ;
308318
319+ // @gate !disableLegacyMode
309320 it ( 'should support reactTag in ref.measureLayout' , ( ) => {
310321 const View = createReactNativeComponentClass ( 'RCTView' , ( ) => ( {
311322 validAttributes : { foo : true } ,
@@ -346,6 +357,7 @@ describe('ReactNative', () => {
346357 expect ( successCallback ) . toHaveBeenCalledWith ( 1 , 1 , 100 , 100 ) ;
347358 } ) ;
348359
360+ // @gate !disableLegacyMode
349361 it ( 'should support ref in ref.measureLayout of host components' , ( ) => {
350362 const View = createReactNativeComponentClass ( 'RCTView' , ( ) => ( {
351363 validAttributes : { foo : true } ,
@@ -382,6 +394,7 @@ describe('ReactNative', () => {
382394 expect ( successCallback ) . toHaveBeenCalledWith ( 1 , 1 , 100 , 100 ) ;
383395 } ) ;
384396
397+ // @gate !disableLegacyMode
385398 it ( 'returns the correct instance and calls it in the callback' , ( ) => {
386399 const View = createReactNativeComponentClass ( 'RCTView' , ( ) => ( {
387400 validAttributes : { foo : true } ,
@@ -403,6 +416,7 @@ describe('ReactNative', () => {
403416 expect ( a ) . toBe ( c ) ;
404417 } ) ;
405418
419+ // @gate !disableLegacyMode
406420 it ( 'renders and reorders children' , ( ) => {
407421 const View = createReactNativeComponentClass ( 'RCTView' , ( ) => ( {
408422 validAttributes : { title : true } ,
@@ -433,6 +447,7 @@ describe('ReactNative', () => {
433447 expect ( UIManager . __dumpHierarchyForJestTestsOnly ( ) ) . toMatchSnapshot ( ) ;
434448 } ) ;
435449
450+ // @gate !disableLegacyMode
436451 it ( 'calls setState with no arguments' , ( ) => {
437452 let mockArgs ;
438453 class Component extends React . Component {
@@ -448,6 +463,7 @@ describe('ReactNative', () => {
448463 expect ( mockArgs . length ) . toEqual ( 0 ) ;
449464 } ) ;
450465
466+ // @gate !disableLegacyMode
451467 it ( 'should not throw when <View> is used inside of a <Text> ancestor' , ( ) => {
452468 const Image = createReactNativeComponentClass ( 'RCTImage' , ( ) => ( {
453469 validAttributes : { } ,
@@ -478,6 +494,7 @@ describe('ReactNative', () => {
478494 ) ;
479495 } ) ;
480496
497+ // @gate !disableLegacyMode
481498 it ( 'should throw for text not inside of a <Text> ancestor' , async ( ) => {
482499 const ScrollView = createReactNativeComponentClass ( 'RCTScrollView' , ( ) => ( {
483500 validAttributes : { } ,
@@ -512,6 +529,7 @@ describe('ReactNative', () => {
512529 ) ;
513530 } ) ;
514531
532+ // @gate !disableLegacyMode
515533 it ( 'should not throw for text inside of an indirect <Text> ancestor' , ( ) => {
516534 const Text = createReactNativeComponentClass ( 'RCTText' , ( ) => ( {
517535 validAttributes : { } ,
@@ -528,6 +546,7 @@ describe('ReactNative', () => {
528546 ) ;
529547 } ) ;
530548
549+ // @gate !disableLegacyMode
531550 it ( 'findHostInstance_DEPRECATED should warn if used to find a host component inside StrictMode' , ( ) => {
532551 const View = createReactNativeComponentClass ( 'RCTView' , ( ) => ( {
533552 validAttributes : { foo : true } ,
@@ -564,6 +583,7 @@ describe('ReactNative', () => {
564583 expect ( match ) . toBe ( child ) ;
565584 } ) ;
566585
586+ // @gate !disableLegacyMode
567587 it ( 'findHostInstance_DEPRECATED should warn if passed a component that is inside StrictMode' , ( ) => {
568588 const View = createReactNativeComponentClass ( 'RCTView' , ( ) => ( {
569589 validAttributes : { foo : true } ,
@@ -601,6 +621,7 @@ describe('ReactNative', () => {
601621 expect ( match ) . toBe ( child ) ;
602622 } ) ;
603623
624+ // @gate !disableLegacyMode
604625 it ( 'findNodeHandle should warn if used to find a host component inside StrictMode' , ( ) => {
605626 const View = createReactNativeComponentClass ( 'RCTView' , ( ) => ( {
606627 validAttributes : { foo : true } ,
@@ -635,6 +656,7 @@ describe('ReactNative', () => {
635656 expect ( match ) . toBe ( child . _nativeTag ) ;
636657 } ) ;
637658
659+ // @gate !disableLegacyMode
638660 it ( 'findNodeHandle should warn if passed a component that is inside StrictMode' , ( ) => {
639661 const View = createReactNativeComponentClass ( 'RCTView' , ( ) => ( {
640662 validAttributes : { foo : true } ,
@@ -670,6 +692,7 @@ describe('ReactNative', () => {
670692 expect ( match ) . toBe ( child . _nativeTag ) ;
671693 } ) ;
672694
695+ // @gate !disableLegacyMode
673696 it ( 'blur on host component calls TextInputState' , ( ) => {
674697 const View = createReactNativeComponentClass ( 'RCTView' , ( ) => ( {
675698 validAttributes : { foo : true } ,
@@ -687,6 +710,7 @@ describe('ReactNative', () => {
687710 expect ( TextInputState . blurTextInput ) . toHaveBeenCalledWith ( viewRef . current ) ;
688711 } ) ;
689712
713+ // @gate !disableLegacyMode
690714 it ( 'focus on host component calls TextInputState' , ( ) => {
691715 const View = createReactNativeComponentClass ( 'RCTView' , ( ) => ( {
692716 validAttributes : { foo : true } ,
0 commit comments