import React from 'react';
import renderer from 'react-test-renderer';
import { render, fireEvent, screen } from '@testing-library/react';
import 'jest-styled-components';
import { PageErrorLoad } from '.';

it('renderizar PageErrorLoad fullscreen', () => {
   const tree = renderer.create(<PageErrorLoad retry={() => {}} />).toJSON();
   expect(tree).toMatchSnapshot();
});

it('renderizar PageErrorLoad sem fullscreen', () => {
   const tree = renderer.create(<PageErrorLoad retry={() => {}} nonFullscreen />).toJSON();
   expect(tree).toMatchSnapshot();
});

it('testar onClick', (done) => {
   function handleClick(): void {
      done();
   }
   render(<PageErrorLoad retry={handleClick} />);

   fireEvent.click(screen.getByTestId('retry-btn'));
});
