Skip to content

Commit

Permalink
Refactor: jest to vitest of itemModal : fixes #2557 (#2715)
Browse files Browse the repository at this point in the history
  • Loading branch information
bandhan-majumder authored Dec 22, 2024
1 parent ca0b0f6 commit ed0a01c
Showing 1 changed file with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
},
}));

Expand All @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit ed0a01c

Please sign in to comment.