Skip to content

Commit

Permalink
Migrated src/components/AgendaItems/AgendaItemsUpdateModal.test.tsx f…
Browse files Browse the repository at this point in the history
…rom Jest to Vitest (#2851)

* Update jest to vitest

* Fix linting issue
  • Loading branch information
mandeepnh5 authored Dec 25, 2024
1 parent f8da9d5 commit 1bc2d3b
Showing 1 changed file with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ import { Provider } from 'react-redux';
import { BrowserRouter } from 'react-router-dom';
import { store } from 'state/store';
import i18nForTest from 'utils/i18nForTest';

import { LocalizationProvider } from '@mui/x-date-pickers';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';

import AgendaItemsUpdateModal from './AgendaItemsUpdateModal';
import { toast } from 'react-toastify';
import convertToBase64 from 'utils/convertToBase64';
import type { MockedFunction } from 'vitest';
import { describe, test, expect, vi } from 'vitest';

const mockFormState = {
title: 'Test Title',
Expand Down Expand Up @@ -67,19 +68,19 @@ const mockAgendaItemCategories = [
},
];

const mockHideUpdateModal = jest.fn();
const mockSetFormState = jest.fn();
const mockUpdateAgendaItemHandler = jest.fn();
const mockHideUpdateModal = vi.fn();
const mockSetFormState = vi.fn();
const mockUpdateAgendaItemHandler = vi.fn();
const mockT = (key: string): string => key;

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 MockedFunction<
typeof convertToBase64
>;

Expand Down

0 comments on commit 1bc2d3b

Please sign in to comment.