From b823bae66eebe8525369a1bc1db454807f81970b Mon Sep 17 00:00:00 2001 From: Ramneet04 Date: Sun, 22 Dec 2024 18:53:35 +0530 Subject: [PATCH 1/2] name changed to spec.tsx --- ...aItemsCreateModal.test.tsx => AgendaItemsCreateModal.spec.tsx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/components/AgendaItems/{AgendaItemsCreateModal.test.tsx => AgendaItemsCreateModal.spec.tsx} (100%) diff --git a/src/components/AgendaItems/AgendaItemsCreateModal.test.tsx b/src/components/AgendaItems/AgendaItemsCreateModal.spec.tsx similarity index 100% rename from src/components/AgendaItems/AgendaItemsCreateModal.test.tsx rename to src/components/AgendaItems/AgendaItemsCreateModal.spec.tsx From b3b238c946ea47aa2425b128cd52c902a5404cbb Mon Sep 17 00:00:00 2001 From: Ramneet04 Date: Sun, 22 Dec 2024 18:58:33 +0530 Subject: [PATCH 2/2] migrated from jest to vitest --- .../AgendaItemsCreateModal.spec.tsx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/components/AgendaItems/AgendaItemsCreateModal.spec.tsx b/src/components/AgendaItems/AgendaItemsCreateModal.spec.tsx index 5b7339ad67..3e039a6096 100644 --- a/src/components/AgendaItems/AgendaItemsCreateModal.spec.tsx +++ b/src/components/AgendaItems/AgendaItemsCreateModal.spec.tsx @@ -12,6 +12,8 @@ import { Provider } from 'react-redux'; import { BrowserRouter } from 'react-router-dom'; import { store } from 'state/store'; import i18nForTest from 'utils/i18nForTest'; +import '@testing-library/jest-dom'; +import { describe, test, expect, vi } from 'vitest'; import { LocalizationProvider } from '@mui/x-date-pickers'; import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'; @@ -28,9 +30,9 @@ const mockFormState = { urls: ['https://example.com'], agendaItemCategoryIds: ['category'], }; -const mockHideCreateModal = jest.fn(); -const mockSetFormState = jest.fn(); -const mockCreateAgendaItemHandler = jest.fn(); +const mockHideCreateModal = vi.fn(); +const mockSetFormState = vi.fn(); +const mockCreateAgendaItemHandler = vi.fn(); const mockT = (key: string): string => key; const mockAgendaItemCategories = [ { @@ -64,14 +66,14 @@ const mockAgendaItemCategories = [ }, }, ]; -jest.mock('react-toastify', () => ({ +vi.mock('react-toastify', () => ({ toast: { - success: jest.fn(), - error: jest.fn(), + success: vi.fn(), + error: vi.fn(), }, })); -jest.mock('utils/convertToBase64'); -const mockedConvertToBase64 = convertToBase64 as jest.MockedFunction< +vi.mock('utils/convertToBase64'); +const mockedConvertToBase64 = convertToBase64 as vi.MockedFunction< typeof convertToBase64 >;