@@ -271,14 +271,14 @@ describe('fixedCacheKey', () => {
271
271
test ( 'a component without `fixedCacheKey` has `originalArgs`' , async ( ) => {
272
272
render ( < Component name = "C1" /> , {
273
273
wrapper : storeRef . wrapper ,
274
- legacyRoot : true ,
275
274
} )
276
275
let c1 = screen . getByTestId ( 'C1' )
277
276
expect ( getByTestId ( c1 , 'status' ) . textContent ) . toBe ( 'uninitialized' )
278
277
expect ( getByTestId ( c1 , 'originalArgs' ) . textContent ) . toBe ( 'undefined' )
279
278
280
- act ( ( ) => {
279
+ await act ( async ( ) => {
281
280
getByTestId ( c1 , 'trigger' ) . click ( )
281
+ await Promise . resolve ( )
282
282
} )
283
283
284
284
expect ( getByTestId ( c1 , 'originalArgs' ) . textContent ) . toBe ( 'C1' )
@@ -312,15 +312,16 @@ describe('fixedCacheKey', () => {
312
312
< Component name = "C1" fixedCacheKey = "test" value = { p1 } />
313
313
< Component name = "C2" fixedCacheKey = "test" value = { p2 } />
314
314
</ > ,
315
- { wrapper : storeRef . wrapper , legacyRoot : true }
315
+ { wrapper : storeRef . wrapper }
316
316
)
317
317
const c1 = screen . getByTestId ( 'C1' )
318
318
const c2 = screen . getByTestId ( 'C2' )
319
319
expect ( getByTestId ( c1 , 'status' ) . textContent ) . toBe ( 'uninitialized' )
320
320
expect ( getByTestId ( c2 , 'status' ) . textContent ) . toBe ( 'uninitialized' )
321
321
322
- act ( ( ) => {
322
+ await act ( async ( ) => {
323
323
getByTestId ( c1 , 'trigger' ) . click ( )
324
+ await Promise . resolve ( )
324
325
} )
325
326
326
327
expect ( getByTestId ( c1 , 'status' ) . textContent ) . toBe ( 'pending' )
@@ -333,17 +334,19 @@ describe('fixedCacheKey', () => {
333
334
expect ( getByTestId ( c1 , 'status' ) . textContent ) . toBe ( 'pending' )
334
335
expect ( getByTestId ( c1 , 'data' ) . textContent ) . toBe ( '' )
335
336
336
- act ( ( ) => {
337
+ await act ( async ( ) => {
337
338
resolve1 ! ( 'this should not show up any more' )
339
+ await Promise . resolve ( )
338
340
} )
339
341
340
342
await waitMs ( )
341
343
342
344
expect ( getByTestId ( c1 , 'status' ) . textContent ) . toBe ( 'pending' )
343
345
expect ( getByTestId ( c1 , 'data' ) . textContent ) . toBe ( '' )
344
346
345
- act ( ( ) => {
347
+ await act ( async ( ) => {
346
348
resolve2 ! ( 'this should be visible' )
349
+ await Promise . resolve ( )
347
350
} )
348
351
349
352
await waitMs ( )
0 commit comments