@@ -151,12 +151,17 @@ describe('ReactDOMTracing', () => {
151151 expect (
152152 onInteractionScheduledWorkCompleted ,
153153 ) . toHaveBeenLastNotifiedOfInteraction ( interaction ) ;
154- // TODO: This is 4 instead of 3 because this update was scheduled at
155- // idle priority, and idle updates are slightly higher priority than
156- // offscreen work. So it takes two render passes to finish it. Profiler
157- // calls `onRender` for the first render even though everything
158- // bails out.
159- expect ( onRender ) . toHaveBeenCalledTimes ( 4 ) ;
154+
155+ if ( gate ( flags => flags . new ) ) {
156+ expect ( onRender ) . toHaveBeenCalledTimes ( 3 ) ;
157+ } else {
158+ // TODO: This is 4 instead of 3 because this update was scheduled at
159+ // idle priority, and idle updates are slightly higher priority than
160+ // offscreen work. So it takes two render passes to finish it. Profiler
161+ // calls `onRender` for the first render even though everything
162+ // bails out.
163+ expect ( onRender ) . toHaveBeenCalledTimes ( 4 ) ;
164+ }
160165 expect ( onRender ) . toHaveLastRenderedWithInteractions (
161166 new Set ( [ interaction ] ) ,
162167 ) ;
@@ -305,12 +310,16 @@ describe('ReactDOMTracing', () => {
305310 expect (
306311 onInteractionScheduledWorkCompleted ,
307312 ) . toHaveBeenLastNotifiedOfInteraction ( interaction ) ;
308- // TODO: This is 4 instead of 3 because this update was scheduled at
309- // idle priority, and idle updates are slightly higher priority than
310- // offscreen work. So it takes two render passes to finish it. Profiler
311- // calls `onRender` for the first render even though everything
312- // bails out.
313- expect ( onRender ) . toHaveBeenCalledTimes ( 4 ) ;
313+ if ( gate ( flags => flags . new ) ) {
314+ expect ( onRender ) . toHaveBeenCalledTimes ( 3 ) ;
315+ } else {
316+ // TODO: This is 4 instead of 3 because this update was scheduled at
317+ // idle priority, and idle updates are slightly higher priority than
318+ // offscreen work. So it takes two render passes to finish it. Profiler
319+ // calls `onRender` for the first render even though everything
320+ // bails out.
321+ expect ( onRender ) . toHaveBeenCalledTimes ( 4 ) ;
322+ }
314323 expect ( onRender ) . toHaveLastRenderedWithInteractions (
315324 new Set ( [ interaction ] ) ,
316325 ) ;
0 commit comments