@@ -3,6 +3,7 @@ import { BenchmarkWizardStepResponse } from '@openops/shared';
33import { useMutation , useQueryClient } from '@tanstack/react-query' ;
44import { act , renderHook } from '@testing-library/react' ;
55
6+ import { QueryKeys } from '@/app/constants/query-keys' ;
67import { benchmarkApi } from './benchmark-api' ;
78import { useBenchmarkWizardNavigation } from './use-benchmark-wizard-navigation' ;
89
@@ -588,6 +589,11 @@ describe('useBenchmarkWizardNavigation', () => {
588589 mockGetWizardStep . mockResolvedValue ( lastStep ) ;
589590 mockCreateBenchmark . mockResolvedValue ( benchmarkResult ) ;
590591
592+ const mockInvalidateQueries = jest . fn ( ) ;
593+ mockUseQueryClient . mockReturnValue ( {
594+ invalidateQueries : mockInvalidateQueries ,
595+ } ) ;
596+
591597 const { result } = renderHook ( ( ) =>
592598 useBenchmarkWizardNavigation ( connectedProviders ) ,
593599 ) ;
@@ -603,6 +609,12 @@ describe('useBenchmarkWizardNavigation', () => {
603609 } ) ;
604610 expect ( result . current . wizardPhase ) . toBe ( 'benchmark-ready' ) ;
605611 expect ( result . current . benchmarkCreateResult ) . toEqual ( benchmarkResult ) ;
612+ expect ( mockInvalidateQueries ) . toHaveBeenCalledWith ( {
613+ queryKey : [ QueryKeys . foldersFlows ] ,
614+ } ) ;
615+ expect ( mockInvalidateQueries ) . toHaveBeenCalledWith ( {
616+ queryKey : [ QueryKeys . flags ] ,
617+ } ) ;
606618 } ) ;
607619
608620 it ( 'should call onBenchmarkCreated callback with the result' , async ( ) => {
0 commit comments