mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2026-01-21 04:09:23 -05:00
* Don't require TS extensions in imports * Resolve all import extension errors * Remove file extension from import paths used in mocks * Remove .d of type definition file paths * Remove .d of type definition file and import as type --------- Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
22 lines
649 B
JavaScript
22 lines
649 B
JavaScript
import { render, screen } from "@testing-library/react-native";
|
|
import AddObsModal from "components/AddObsModal/AddObsModal";
|
|
import i18next from "i18next";
|
|
import React from "react";
|
|
|
|
// Make sure the mock is using a recent-ish version
|
|
jest.mock( "react-native/Libraries/Utilities/Platform", ( ) => ( {
|
|
OS: "ios",
|
|
select: jest.fn( ),
|
|
Version: 11
|
|
} ) );
|
|
|
|
describe( "AddObsModal", ( ) => {
|
|
it( "shows the AI camera button", async ( ) => {
|
|
render( <AddObsModal closeModal={jest.fn( )} /> );
|
|
const aiCameraButton = screen.getByLabelText(
|
|
i18next.t( "AI-Camera" )
|
|
);
|
|
expect( aiCameraButton ).toBeOnTheScreen();
|
|
} );
|
|
} );
|