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

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

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

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

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