@@ -86,6 +86,9 @@ describe('ReactDOMServerIntegration', () => {
8686 } ) ;
8787
8888 itRenders ( 'stateless child with context' , async render => {
89+ if ( gate ( flags => flags . disableLegacyContextForFunctionComponents ) ) {
90+ return ;
91+ }
8992 function FunctionChildWithContext ( props , context ) {
9093 return < div > { context . text } </ div > ;
9194 }
@@ -118,6 +121,9 @@ describe('ReactDOMServerIntegration', () => {
118121 } ) ;
119122
120123 itRenders ( 'stateless child without context' , async render => {
124+ if ( gate ( flags => flags . disableLegacyContextForFunctionComponents ) ) {
125+ return ;
126+ }
121127 function FunctionChildWithoutContext ( props , context ) {
122128 // this should render blank; context isn't passed to this component.
123129 return < div > { context . text } </ div > ;
@@ -151,6 +157,9 @@ describe('ReactDOMServerIntegration', () => {
151157 } ) ;
152158
153159 itRenders ( 'stateless child with wrong context' , async render => {
160+ if ( gate ( flags => flags . disableLegacyContextForFunctionComponents ) ) {
161+ return ;
162+ }
154163 function FunctionChildWithWrongContext ( props , context ) {
155164 // this should render blank; context.text isn't passed to this component.
156165 return < div id = "statelessWrongChild" > { context . text } </ div > ;
@@ -169,6 +178,9 @@ describe('ReactDOMServerIntegration', () => {
169178 } ) ;
170179
171180 itRenders ( 'with context passed through to a grandchild' , async render => {
181+ if ( gate ( flags => flags . disableLegacyContextForFunctionComponents ) ) {
182+ return ;
183+ }
172184 function Grandchild ( props , context ) {
173185 return < div > { context . text } </ div > ;
174186 }
@@ -186,6 +198,9 @@ describe('ReactDOMServerIntegration', () => {
186198 } ) ;
187199
188200 itRenders ( 'a child context overriding a parent context' , async render => {
201+ if ( gate ( flags => flags . disableLegacyContextForFunctionComponents ) ) {
202+ return ;
203+ }
189204 const Grandchild = ( props , context ) => {
190205 return < div > { context . text } </ div > ;
191206 } ;
@@ -203,6 +218,9 @@ describe('ReactDOMServerIntegration', () => {
203218 } ) ;
204219
205220 itRenders ( 'a child context merged with a parent context' , async render => {
221+ if ( gate ( flags => flags . disableLegacyContextForFunctionComponents ) ) {
222+ return ;
223+ }
206224 class Parent extends React . Component {
207225 getChildContext ( ) {
208226 return { text1 : 'purple' } ;
@@ -244,6 +262,9 @@ describe('ReactDOMServerIntegration', () => {
244262 itRenders (
245263 'with a call to componentWillMount before getChildContext' ,
246264 async render => {
265+ if ( gate ( flags => flags . disableLegacyContextForFunctionComponents ) ) {
266+ return ;
267+ }
247268 class WillMountContext extends React . Component {
248269 getChildContext ( ) {
249270 return { text : this . state . text } ;
@@ -270,6 +291,9 @@ describe('ReactDOMServerIntegration', () => {
270291 itRenders (
271292 'if getChildContext exists but childContextTypes is missing with a warning' ,
272293 async render => {
294+ if ( gate ( flags => flags . disableLegacyContextForFunctionComponents ) ) {
295+ return ;
296+ }
273297 function HopefulChild ( props , context ) {
274298 return context . foo || 'nope' ;
275299 }
0 commit comments