From c50b08c6fd7355247257b1bd26519a89e82a663e Mon Sep 17 00:00:00 2001 From: bandhan-majumder Date: Sun, 22 Dec 2024 13:27:16 +0530 Subject: [PATCH] Refactor: jest to vitest of itemModal : fixes #2557 --- ...{ItemModal.test.tsx => ItemModal.spec.tsx} | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) rename src/screens/OrganizationActionItems/{ItemModal.test.tsx => ItemModal.spec.tsx} (98%) diff --git a/src/screens/OrganizationActionItems/ItemModal.test.tsx b/src/screens/OrganizationActionItems/ItemModal.spec.tsx similarity index 98% rename from src/screens/OrganizationActionItems/ItemModal.test.tsx rename to src/screens/OrganizationActionItems/ItemModal.spec.tsx index a58496e6df..1fe3d6fca5 100644 --- a/src/screens/OrganizationActionItems/ItemModal.test.tsx +++ b/src/screens/OrganizationActionItems/ItemModal.spec.tsx @@ -21,12 +21,13 @@ import { StaticMockLink } from 'utils/StaticMockLink'; import { toast } from 'react-toastify'; import type { InterfaceItemModalProps } from './ItemModal'; import ItemModal from './ItemModal'; +import { vi } from 'vitest'; -jest.mock('react-toastify', () => ({ +vi.mock('react-toastify', () => ({ toast: { - success: jest.fn(), - error: jest.fn(), - warning: jest.fn(), + success: vi.fn(), + error: vi.fn(), + warning: vi.fn(), }, })); @@ -45,28 +46,28 @@ const t = { const itemProps: InterfaceItemModalProps[] = [ { isOpen: true, - hide: jest.fn(), + hide: vi.fn(), orgId: 'orgId', eventId: undefined, - actionItemsRefetch: jest.fn(), + actionItemsRefetch: vi.fn(), editMode: false, actionItem: null, }, { isOpen: true, - hide: jest.fn(), + hide: vi.fn(), orgId: 'orgId', eventId: 'eventId', - actionItemsRefetch: jest.fn(), + actionItemsRefetch: vi.fn(), editMode: false, actionItem: null, }, { isOpen: true, - hide: jest.fn(), + hide: vi.fn(), orgId: 'orgId', eventId: undefined, - actionItemsRefetch: jest.fn(), + actionItemsRefetch: vi.fn(), editMode: true, actionItem: { _id: 'actionItemId1', @@ -106,10 +107,10 @@ const itemProps: InterfaceItemModalProps[] = [ }, { isOpen: true, - hide: jest.fn(), + hide: vi.fn(), orgId: 'orgId', eventId: undefined, - actionItemsRefetch: jest.fn(), + actionItemsRefetch: vi.fn(), editMode: true, actionItem: { _id: 'actionItemId2', @@ -149,10 +150,10 @@ const itemProps: InterfaceItemModalProps[] = [ }, { isOpen: true, - hide: jest.fn(), + hide: vi.fn(), orgId: 'orgId', eventId: 'eventId', - actionItemsRefetch: jest.fn(), + actionItemsRefetch: vi.fn(), editMode: true, actionItem: { _id: 'actionItemId2', @@ -202,10 +203,10 @@ const itemProps: InterfaceItemModalProps[] = [ }, { isOpen: true, - hide: jest.fn(), + hide: vi.fn(), orgId: 'orgId', eventId: 'eventId', - actionItemsRefetch: jest.fn(), + actionItemsRefetch: vi.fn(), editMode: true, actionItem: { _id: 'actionItemId2',