Skip to content

Commit

Permalink
Refactored src/components/AgendaCategory/AgendaCategoryContainer.test…
Browse files Browse the repository at this point in the history
….tsx from jest to vitest (#2938)

* Refactored src/components/AgendaCategory/AgendaCategoryContainer.test.tsx from jest to vitest

* Refactored src/components/AgendaCategory/AgendaCategoryContainer.test.tsx from jest to vitest
  • Loading branch information
AceHunterr authored Dec 26, 2024
1 parent 4386ee0 commit 178a9ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import {
fireEvent,
} from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import 'jest-localstorage-mock';
import { MockedProvider } from '@apollo/client/testing';
import 'jest-location-mock';
import { I18nextProvider } from 'react-i18next';
import { Provider } from 'react-redux';
import { BrowserRouter } from 'react-router-dom';
Expand All @@ -25,14 +23,15 @@ import { StaticMockLink } from 'utils/StaticMockLink';
import AgendaCategoryContainer from './AgendaCategoryContainer';
import { props, props2 } from './AgendaCategoryContainerProps';
import { MOCKS, MOCKS_ERROR_MUTATIONS } from './AgendaCategoryContainerMocks';
import { vi, describe, test, expect } from 'vitest';

const link = new StaticMockLink(MOCKS, true);
const link2 = new StaticMockLink(MOCKS_ERROR_MUTATIONS, true);

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

Expand Down
5 changes: 3 additions & 2 deletions src/components/AgendaCategory/AgendaCategoryContainerProps.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
type AgendaCategoryConnectionType = 'Organization';
import { vi } from 'vitest';

export const props = {
agendaCategoryConnection: 'Organization' as AgendaCategoryConnectionType,
Expand All @@ -24,11 +25,11 @@ export const props = {
},
},
],
agendaCategoryRefetch: jest.fn(),
agendaCategoryRefetch: vi.fn(),
};

export const props2 = {
agendaCategoryConnection: 'Organization' as AgendaCategoryConnectionType,
agendaCategoryData: [],
agendaCategoryRefetch: jest.fn(),
agendaCategoryRefetch: vi.fn(),
};

0 comments on commit 178a9ed

Please sign in to comment.