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

it('snapshot - PageErrorLoad fullscreen', () => {
   const { toJSON } = render(<PageErrorLoad retry={() => {}} />);
   expect(toJSON()).toMatchSnapshot();
});

it('snapshot - PageErrorLoad sem fullscreen', () => {
   const { toJSON } = render(<PageErrorLoad retry={() => {}} nonFullscreen />);
   expect(toJSON()).toMatchSnapshot();
});

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

   fireEvent.press(getByTestId('retry-btn'));
});
