File tree Expand file tree Collapse file tree
packages/query-devtools/src/__tests__ Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ describe('Devtools', () => {
3232 let previousRootFontSize = ''
3333
3434 beforeEach ( ( ) => {
35+ vi . useFakeTimers ( )
3536 previousRootFontSize = document . documentElement . style . fontSize
3637 // jsdom doesn't implement `PointerEvent`; the DropdownMenu trigger checks
3738 // `e.pointerType !== 'touch'` on pointerdown to decide whether to open,
@@ -101,6 +102,7 @@ describe('Devtools', () => {
101102 } )
102103
103104 afterEach ( ( ) => {
105+ vi . useRealTimers ( )
104106 vi . unstubAllGlobals ( )
105107 Object . keys ( storage ) . forEach ( ( key ) => delete storage [ key ] )
106108 queryClient . clear ( )
@@ -344,7 +346,7 @@ describe('Devtools', () => {
344346 mutationFn : ( ) => Promise . resolve ( 'ok' ) ,
345347 } )
346348 mutation . execute ( { } )
347- await Promise . resolve ( )
349+ await vi . advanceTimersByTimeAsync ( 0 )
348350
349351 expect (
350352 rendered . getByLabelText ( / M u t a t i o n s u b m i t t e d a t / ) ,
You can’t perform that action at this time.
0 commit comments