mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2026-01-03 19:38:28 -05:00
* Add eslint-plugin-testing-library dependency * Enable plugin inside tests folder * Fix errors given by eslint-plugin
19 lines
590 B
JavaScript
19 lines
590 B
JavaScript
import { fireEvent, screen } from "@testing-library/react-native";
|
|
import About from "components/About";
|
|
import React from "react";
|
|
import Mailer from "react-native-mail";
|
|
|
|
import { renderComponent } from "../../helpers/render";
|
|
|
|
jest.mock( "react-native-mail", ( ) => ( {
|
|
mail: jest.fn( )
|
|
} ) );
|
|
|
|
test( "native email client is opened on button press", ( ) => {
|
|
renderComponent( <About /> );
|
|
const debugLogButton = screen.getByText( /EMAIL-DEBUG-LOGS/ );
|
|
expect( debugLogButton ).toBeTruthy( );
|
|
fireEvent.press( debugLogButton );
|
|
expect( Mailer.mail ).toHaveBeenCalled( );
|
|
} );
|