@@ -271,14 +271,14 @@ describe('fixedCacheKey', () => {
271271 test ( 'a component without `fixedCacheKey` has `originalArgs`' , async ( ) => {
272272 render ( < Component name = "C1" /> , {
273273 wrapper : storeRef . wrapper ,
274- legacyRoot : true ,
275274 } )
276275 let c1 = screen . getByTestId ( 'C1' )
277276 expect ( getByTestId ( c1 , 'status' ) . textContent ) . toBe ( 'uninitialized' )
278277 expect ( getByTestId ( c1 , 'originalArgs' ) . textContent ) . toBe ( 'undefined' )
279278
280- act ( ( ) => {
279+ await act ( async ( ) => {
281280 getByTestId ( c1 , 'trigger' ) . click ( )
281+ await Promise . resolve ( )
282282 } )
283283
284284 expect ( getByTestId ( c1 , 'originalArgs' ) . textContent ) . toBe ( 'C1' )
@@ -312,15 +312,16 @@ describe('fixedCacheKey', () => {
312312 < Component name = "C1" fixedCacheKey = "test" value = { p1 } />
313313 < Component name = "C2" fixedCacheKey = "test" value = { p2 } />
314314 </ > ,
315- { wrapper : storeRef . wrapper , legacyRoot : true }
315+ { wrapper : storeRef . wrapper }
316316 )
317317 const c1 = screen . getByTestId ( 'C1' )
318318 const c2 = screen . getByTestId ( 'C2' )
319319 expect ( getByTestId ( c1 , 'status' ) . textContent ) . toBe ( 'uninitialized' )
320320 expect ( getByTestId ( c2 , 'status' ) . textContent ) . toBe ( 'uninitialized' )
321321
322- act ( ( ) => {
322+ await act ( async ( ) => {
323323 getByTestId ( c1 , 'trigger' ) . click ( )
324+ await Promise . resolve ( )
324325 } )
325326
326327 expect ( getByTestId ( c1 , 'status' ) . textContent ) . toBe ( 'pending' )
@@ -333,17 +334,19 @@ describe('fixedCacheKey', () => {
333334 expect ( getByTestId ( c1 , 'status' ) . textContent ) . toBe ( 'pending' )
334335 expect ( getByTestId ( c1 , 'data' ) . textContent ) . toBe ( '' )
335336
336- act ( ( ) => {
337+ await act ( async ( ) => {
337338 resolve1 ! ( 'this should not show up any more' )
339+ await Promise . resolve ( )
338340 } )
339341
340342 await waitMs ( )
341343
342344 expect ( getByTestId ( c1 , 'status' ) . textContent ) . toBe ( 'pending' )
343345 expect ( getByTestId ( c1 , 'data' ) . textContent ) . toBe ( '' )
344346
345- act ( ( ) => {
347+ await act ( async ( ) => {
346348 resolve2 ! ( 'this should be visible' )
349+ await Promise . resolve ( )
347350 } )
348351
349352 await waitMs ( )
0 commit comments