Skip to content

Commit

Permalink
refactor:vitest to componenets/EventCalendar/*
Browse files Browse the repository at this point in the history
  • Loading branch information
shivasankaran18 committed Dec 26, 2024
1 parent 0cede94 commit 53d6d00
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import i18nForTest from 'utils/i18nForTest';
import { StaticMockLink } from 'utils/StaticMockLink';
import { weekdays, months } from './constants';
import { BrowserRouter as Router } from 'react-router-dom';
import { vi } from 'vitest';

const eventData = [
{
Expand Down Expand Up @@ -122,7 +123,7 @@ describe('Calendar', () => {
});

afterEach(() => {
jest.clearAllMocks();
vi.clearAllMocks();
});

it('should render the current month and year', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,20 @@ import EventHeader from './EventHeader';
import { ViewType } from '../../screens/OrganizationEvents/OrganizationEvents';
import { I18nextProvider } from 'react-i18next';
import i18nForTest from 'utils/i18nForTest';
import { vi } from 'vitest';

describe('EventHeader Component', () => {
const viewType = ViewType.MONTH;
const handleChangeView = jest.fn();
const showInviteModal = jest.fn();

/**
* Mock function to handle view type changes.
*/
const handleChangeView = vi.fn();

/**
* Mock function to handle the display of the invite modal.
*/
const showInviteModal = vi.fn();

it('renders correctly', () => {
const { getByTestId } = render(
Expand Down

0 comments on commit 53d6d00

Please sign in to comment.