From b45a3d905bf45fed326c98cc1541ec6b85dd9811 Mon Sep 17 00:00:00 2001 From: vashjs Date: Mon, 5 Feb 2024 00:39:34 +0100 Subject: [PATCH] mock useQueryPlugin --- src/components/BulkEditList/BulkEditList.test.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/BulkEditList/BulkEditList.test.js b/src/components/BulkEditList/BulkEditList.test.js index 6c669acd..0cc95e3c 100644 --- a/src/components/BulkEditList/BulkEditList.test.js +++ b/src/components/BulkEditList/BulkEditList.test.js @@ -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'); @@ -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,