@@ -174,7 +174,7 @@ describe('Catalog Hooks', () => {
174174 mockedGetCatalogDetails . mockResolvedValueOnce ( mockCatalog ) ;
175175
176176 const { result } = renderHook (
177- ( ) => useCatalogDetails ( { partnerId : '1' , selectedCatalog : '1' } ) ,
177+ ( ) => useCatalogDetails ( { partnerId : '1' , catalogId : '1' } ) ,
178178 { wrapper : createWrapper } ,
179179 ) ;
180180
@@ -202,7 +202,7 @@ describe('Catalog Hooks', () => {
202202 queryClient . setQueryData ( [ 'partnerCatalogs' , '1' , 1 , 10 ] , mockCatalogsResponse ) ;
203203
204204 const { result } = renderHook (
205- ( ) => useCatalogDetails ( { partnerId : '1' , selectedCatalog : '1' } ) ,
205+ ( ) => useCatalogDetails ( { partnerId : '1' , catalogId : '1' } ) ,
206206 { wrapper : createWrapper } ,
207207 ) ;
208208
@@ -212,23 +212,23 @@ describe('Catalog Hooks', () => {
212212 expect ( result . current . isLoadingCatalogDetails ) . toBe ( false ) ;
213213 } ) ;
214214
215- it ( 'should not fetch when partnerId or selectedCatalog is missing' , ( ) => {
215+ it ( 'should not fetch when partnerId or catalogId is missing' , ( ) => {
216216 const { result : resultNoPartner } = renderHook (
217- ( ) => useCatalogDetails ( { partnerId : '' , selectedCatalog : '1' } ) ,
217+ ( ) => useCatalogDetails ( { partnerId : '' , catalogId : '1' } ) ,
218218 { wrapper : createWrapper } ,
219219 ) ;
220220
221221 const { result : resultNoCatalog } = renderHook (
222- ( ) => useCatalogDetails ( { partnerId : '1' , selectedCatalog : '' } ) ,
222+ ( ) => useCatalogDetails ( { partnerId : '1' , catalogId : '' } ) ,
223223 { wrapper : createWrapper } ,
224224 ) ;
225225
226226 expect ( mockedGetCatalogDetails ) . not . toHaveBeenCalled ( ) ;
227227
228- expect ( resultNoPartner . current . catalogDetails ) . toBeNull ( ) ;
228+ expect ( resultNoPartner . current . catalogDetails ) . toBeUndefined ( ) ;
229229 expect ( resultNoPartner . current . isLoadingCatalogDetails ) . toBe ( false ) ;
230230
231- expect ( resultNoCatalog . current . catalogDetails ) . toBeNull ( ) ;
231+ expect ( resultNoCatalog . current . catalogDetails ) . toBeUndefined ( ) ;
232232 expect ( resultNoCatalog . current . isLoadingCatalogDetails ) . toBe ( false ) ;
233233 } ) ;
234234 } ) ;
0 commit comments