mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2025-12-23 22:18:36 -05:00
* Upgrade helper: package.json
* Upgrade helper: gems
* Upgrade helper: Android
* Update AppDelegate
* Fix error in compiling
* Update package-lock.json
* Update Podfile.lock
* Update package-lock.json
* Update Podfile.lock
* Remove no longer needed mock
* Comment out entire test and not only the expect call
* Most other unit tests use this render helper function that
wraps the component in the entire app.
* Mock react-native exports as esModule
* Update .flowconfig
* Update Gemfile
* Revert "Comment out entire test and not only the expect call"
This reverts commit 8785f81529.
25 lines
692 B
JavaScript
25 lines
692 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", ( ) => ( {
|
|
__esModule: true,
|
|
default: {
|
|
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();
|
|
} );
|
|
} );
|