summaryrefslogtreecommitdiff
path: root/client/src/components/Schedule.test.tsx
blob: 76f0f91f39168763fce1af9cefde16eaa826d3a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import '@testing-library/jest-dom';
import React from 'react';
import { fireEvent } from '@testing-library/react';
import { userEvent } from '@testing-library/user-event';
import { describe, expect, it } from 'vitest';
import { createMemoryRouter, RouterProvider } from 'react-router-dom';
import { renderWithProviders } from '../renderWithProviders';
import routes from '../routes';

describe('Schedule', async () => {
  const memoryRouter = createMemoryRouter(routes, {
    initialEntries: ['/schedule'],
  });
  it('displays calendar dialog', async () => {
    const { getByLabelText, findByText } = renderWithProviders(
      <RouterProvider router={memoryRouter} />
    );

    fireEvent.click(getByLabelText(/insert invitation/i));
    expect(await findByText(/calendar invitation/i)).toBeInTheDocument();
  });
});