Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: jest to vitest of itemModal : fixes #2557 #2715

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading