From 178a9edf1a7c4d1c9124e07743d86cae8ed2c895 Mon Sep 17 00:00:00 2001 From: Mehul Aggarwal <88583647+AceHunterr@users.noreply.github.com> Date: Thu, 26 Dec 2024 23:58:58 +0530 Subject: [PATCH] Refactored src/components/AgendaCategory/AgendaCategoryContainer.test.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 --- ...ntainer.test.tsx => AgendaCategoryContainer.spec.tsx} | 9 ++++----- .../AgendaCategory/AgendaCategoryContainerProps.ts | 5 +++-- 2 files changed, 7 insertions(+), 7 deletions(-) rename src/components/AgendaCategory/{AgendaCategoryContainer.test.tsx => AgendaCategoryContainer.spec.tsx} (98%) diff --git a/src/components/AgendaCategory/AgendaCategoryContainer.test.tsx b/src/components/AgendaCategory/AgendaCategoryContainer.spec.tsx similarity index 98% rename from src/components/AgendaCategory/AgendaCategoryContainer.test.tsx rename to src/components/AgendaCategory/AgendaCategoryContainer.spec.tsx index d8e27c3cb2..74880558b4 100644 --- a/src/components/AgendaCategory/AgendaCategoryContainer.test.tsx +++ b/src/components/AgendaCategory/AgendaCategoryContainer.spec.tsx @@ -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'; @@ -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(), }, })); diff --git a/src/components/AgendaCategory/AgendaCategoryContainerProps.ts b/src/components/AgendaCategory/AgendaCategoryContainerProps.ts index 5181eec153..3d8128128c 100644 --- a/src/components/AgendaCategory/AgendaCategoryContainerProps.ts +++ b/src/components/AgendaCategory/AgendaCategoryContainerProps.ts @@ -1,4 +1,5 @@ type AgendaCategoryConnectionType = 'Organization'; +import { vi } from 'vitest'; export const props = { agendaCategoryConnection: 'Organization' as AgendaCategoryConnectionType, @@ -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(), };