@@ -314,32 +314,30 @@ describe('ReactSuspense', () => {
314
314
} , 290 ) ;
315
315
316
316
// Render an empty shell
317
- const root = ReactTestRenderer . create ( < Foo /> , {
318
- isConcurrent : true ,
319
- } ) ;
320
-
317
+ const root = ReactDOMClient . createRoot ( container ) ;
318
+ root . render ( < Foo /> ) ;
321
319
await waitForAll ( [ 'Foo' , 'Suspend! [A]' , 'Loading...' ] ) ;
322
- expect ( root ) . toMatchRenderedOutput ( 'Loading...' ) ;
320
+ expect ( container . textContent ) . toEqual ( 'Loading...' ) ;
323
321
324
322
// Now resolve A
325
323
jest . advanceTimersByTime ( 290 ) ;
326
324
await waitFor ( [ 'A' ] ) ;
327
- expect ( root ) . toMatchRenderedOutput ( 'Loading...' ) ;
325
+ expect ( container . textContent ) . toEqual ( 'Loading...' ) ;
328
326
329
327
// B starts loading. Parent boundary is in throttle.
330
328
// Still shows parent loading under throttle
331
329
jest . advanceTimersByTime ( 10 ) ;
332
330
await waitForAll ( [ 'Suspend! [B]' , 'Loading more...' ] ) ;
333
- expect ( root ) . toMatchRenderedOutput ( 'Loading...' ) ;
331
+ expect ( container . textContent ) . toEqual ( 'Loading...' ) ;
334
332
335
333
// !! B could have finished before the throttle, but we show a fallback.
336
334
// !! Pushing out the 30ms fetch for B to 300ms.
337
335
jest . advanceTimersByTime ( 300 ) ;
338
336
await waitFor ( [ 'B' ] ) ;
339
- expect ( root ) . toMatchRenderedOutput ( 'ALoading more...' ) ;
337
+ expect ( container . textContent ) . toEqual ( 'ALoading more...' ) ;
340
338
341
339
await act ( ( ) => { } ) ;
342
- expect ( root ) . toMatchRenderedOutput ( 'AB' ) ;
340
+ expect ( container . textContent ) . toEqual ( 'AB' ) ;
343
341
} ) ;
344
342
345
343
it ( 'does not throttle fallback committing for too long' , async ( ) => {
0 commit comments