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();
  });
});
