File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
tests/react/vanilla-utils Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -262,7 +262,7 @@ it('loadable of a derived async atom with error does not trigger infinite loop (
262262 expect ( screen . getByText ( 'Error: thrown in baseAtom' ) ) . toBeInTheDocument ( )
263263} )
264264
265- it ( 'does not repeatedly attempt to get the value of an unresolved promise atom wrapped in a loadable (#1481)' , ( ) => {
265+ it ( 'does not repeatedly attempt to get the value of an unresolved promise atom wrapped in a loadable (#1481)' , async ( ) => {
266266 const baseAtom = atom ( new Promise < number > ( ( ) => { } ) )
267267
268268 let callsToGetBaseAtom = 0
@@ -277,6 +277,8 @@ it('does not repeatedly attempt to get the value of an unresolved promise atom w
277277 </ StrictMode > ,
278278 )
279279
280+ // we need a small delay to reproduce the issue
281+ await act ( ( ) => vi . advanceTimersByTimeAsync ( 10 ) )
280282 // depending on provider-less mode or versioned-write mode, there will be
281283 // either 2 or 3 calls.
282284 expect ( callsToGetBaseAtom ) . toBeLessThanOrEqual ( 3 )
You can’t perform that action at this time.
0 commit comments