Skip to content

Commit

Permalink
UIBULKED-497: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
UladzislauKutarkin committed Oct 26, 2024
1 parent e515906 commit 710826e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import React, { useContext, useEffect, useState } from 'react';
import React, {
useContext,
useEffect,
useState
} from 'react';
import PropTypes from 'prop-types';
import {
FormattedMessage,
Expand Down Expand Up @@ -148,4 +152,5 @@ BulkEditPreviewModalList.propTypes = {
bulkDetails: PropTypes.object,
isPreviewEnabled: PropTypes.bool,
onPreviewError: PropTypes.func,
setShouldRefetchStatus: PropTypes.func,
};
8 changes: 3 additions & 5 deletions src/hooks/api/useBulkOperationDetails.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,13 @@ describe('useBulkOperationDetails', () => {

it('should initialize with the correct refetch interval and query key', () => {
const id = 'test-id';
const refetchInterval = 5000;
const interval = 5000;

const { result } = renderHook(() => useBulkOperationDetails({ id, interval: refetchInterval }));
renderHook(() => useBulkOperationDetails({ id, interval }));

expect(result.current.isLoading).toBe(false);
expect(useQuery).toHaveBeenCalledWith(
expect.objectContaining({
queryKey: [BULK_OPERATION_DETAILS_KEY, 'namespace-key', id, refetchInterval],
refetchInterval,
queryKey: [BULK_OPERATION_DETAILS_KEY, 'namespace-key', 0, id],
enabled: true,
})
);
Expand Down

0 comments on commit 710826e

Please sign in to comment.