Files
iNaturalistReactNative/tests/unit/components/About.test.js
Ken-ichi f7dc08a704 Suggestions fixes (#972)
* Bugfix: TaxonDetails was crashing if it received a null taxon
* Send lat and lng instead of latitude and longitude to the score_image
  endpoint
* Show offline suggestions when you are offline
* Show notice when viewing offline suggestions
* Moved code unique to useOnlineSuggestions into that file
* Ensure we use a medium size image to get suggestions when dealing with
  remote URLs
* More logging around React Query retries
* Use default retry logic for useAuthenticatedQuery
* Made a module-resolver shortcut for tests
* Move offline notice above top suggestion; hide when offlines exist but onlines do too
2023-12-15 19:58:12 -08:00

25 lines
755 B
JavaScript

import { fireEvent, screen } from "@testing-library/react-native";
import About from "components/About";
import initI18next from "i18n/initI18next";
import React from "react";
import Mailer from "react-native-mail";
import { renderComponent } from "tests/helpers/render";
jest.mock( "react-native-mail", ( ) => ( {
mail: jest.fn( )
} ) );
describe( "email logs button", ( ) => {
beforeAll( async ( ) => {
await initI18next( );
} );
it( "should open the native email client", async ( ) => {
renderComponent( <About /> );
const debugLogButton = await screen.findByText( /EMAIL DEBUG LOGS/ );
expect( debugLogButton ).toBeTruthy( );
fireEvent.press( debugLogButton );
expect( Mailer.mail ).toHaveBeenCalled( );
} );
} );