@@ -274,8 +274,22 @@ describe('ReactElementClone', () => {
274274
275275 const root = ReactDOMClient . createRoot ( document . createElement ( 'div' ) ) ;
276276 await act ( ( ) => root . render ( < Grandparent /> ) ) ;
277- expect ( component . childRef ) . toEqual ( { current : null } ) ;
278- expect ( component . parentRef . current . xyzRef . current . tagName ) . toBe ( 'SPAN' ) ;
277+ if ( gate ( flags => flags . enableRefAsProp && flags . disableStringRefs ) ) {
278+ expect ( component . childRef ) . toEqual ( { current : null } ) ;
279+ expect ( component . parentRef . current . xyzRef . current . tagName ) . toBe ( 'SPAN' ) ;
280+ } else if (
281+ gate ( flags => ! flags . enableRefAsProp && ! flags . disableStringRefs )
282+ ) {
283+ expect ( component . childRef ) . toEqual ( { current : null } ) ;
284+ expect ( component . parentRef . current . xyzRef . current . tagName ) . toBe ( 'SPAN' ) ;
285+ } else if (
286+ gate ( flags => flags . enableRefAsProp && ! flags . disableStringRefs )
287+ ) {
288+ expect ( component . childRef ) . toEqual ( { current : null } ) ;
289+ expect ( component . parentRef . current . xyzRef . current . tagName ) . toBe ( 'SPAN' ) ;
290+ } else {
291+ // Not going to bother testing every possible combination.
292+ }
279293 } ) ;
280294
281295 it ( 'should overwrite props' , async ( ) => {
@@ -371,6 +385,11 @@ describe('ReactElementClone', () => {
371385 ) {
372386 expect ( clone . ref ) . toBe ( element . ref ) ;
373387 expect ( clone . props ) . toEqual ( { foo : 'ef' } ) ;
388+ } else if (
389+ gate ( flags => flags . enableRefAsProp && ! flags . disableStringRefs )
390+ ) {
391+ expect ( clone . ref ) . toBe ( element . ref ) ;
392+ expect ( clone . props ) . toEqual ( { foo : 'ef' } ) ;
374393 } else {
375394 // Not going to bother testing every possible combination.
376395 }
0 commit comments