Skip to content

Commit

Permalink
mock useQueryPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
vashjs committed Feb 4, 2024
1 parent ec5d558 commit b45a3d9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/components/BulkEditList/BulkEditList.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { CAPABILITIES, IDENTIFIERS, CRITERIA } from '../../constants';

import { BulkEditList } from './BulkEditList';

jest.useFakeTimers();

jest.mock('../BulkEditLogs/BulkEditLogs', () => {
return jest.fn().mockReturnValue('BulkEditLogs');
Expand All @@ -36,6 +35,17 @@ jest.mock('./BulkEditListResult/BulkEditInAppPreviewModal/BulkEditInAppPreviewMo
return jest.fn().mockReturnValue('BulkEditInAppPreviewModal');
});

jest.mock('../../hooks/api', () => ({
...jest.requireActual('../../hooks/api'),
useQueryPlugin: jest.fn().mockReturnValue({
entityTypeDataSource: jest.fn(),
queryDetailsDataSource: jest.fn(),
testQueryDataSource: jest.fn(),
getParamsSource: jest.fn(),
cancelQueryDataSource: jest.fn(),
}),
}));

const renderBulkEditList = ({ criteria }) => {
const params = new URLSearchParams({
criteria,
Expand Down

0 comments on commit b45a3d9

Please sign in to comment.