Skip to content

Commit

Permalink
refactor : src\components\MemberDetail\customTableCell.test.tsx and s…
Browse files Browse the repository at this point in the history
…rc\components\OrganizationScreen\OrganizationScreen.test.tsx from jest to vitest
  • Loading branch information
im-vedant committed Dec 17, 2024
1 parent 8aea843 commit 650f431
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { MockedProvider } from '@apollo/client/testing';
import { BrowserRouter } from 'react-router-dom';
import { CustomTableCell } from './customTableCell';
import { EVENT_DETAILS } from 'GraphQl/Queries/Queries';

jest.mock('react-toastify', () => ({
import { vi } from 'vitest';
vi.mock('react-toastify', () => ({
toast: {
success: jest.fn(),
error: jest.fn(),
success: vi.fn(),
error: vi.fn(),
},
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react';
import { MockedProvider } from '@apollo/react-testing';
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
import { I18nextProvider } from 'react-i18next';
import 'jest-location-mock';
import { Provider } from 'react-redux';
import { BrowserRouter } from 'react-router-dom';
import { store } from 'state/store';
Expand All @@ -11,10 +10,10 @@ import OrganizationScreen from './OrganizationScreen';
import { ORGANIZATION_EVENT_LIST } from 'GraphQl/Queries/Queries';
import { StaticMockLink } from 'utils/StaticMockLink';
import styles from './OrganizationScreen.module.css';

import { vi } from 'vitest';
const mockID: string | undefined = '123';
jest.mock('react-router-dom', () => ({
...jest.requireActual('react-router-dom'),
vi.mock('react-router-dom', async () => ({
...(await vi.importActual('react-router-dom')),
useParams: () => ({ orgId: mockID }),
useMatch: () => ({ params: { eventId: 'event123', orgId: '123' } }),
}));
Expand Down

0 comments on commit 650f431

Please sign in to comment.