mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2026-01-20 19:59:40 -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.
28 lines
912 B
JavaScript
28 lines
912 B
JavaScript
// Separate tests for iOS 9. AddObsModal sets some OS-specific constants at
|
|
// load time that can't be altered at runtime, so we're using a separate test
|
|
// with a separate mock to control those load time values.
|
|
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 reports OS version 9
|
|
jest.mock( "react-native/Libraries/Utilities/Platform", () => ( {
|
|
__esModule: true,
|
|
default: {
|
|
OS: "ios",
|
|
select: jest.fn(),
|
|
Version: 9
|
|
}
|
|
} ) );
|
|
|
|
describe( "AddObsModal in iOS 9", ( ) => {
|
|
it( "hides AI camera button on older devices", async ( ) => {
|
|
render( <AddObsModal closeModal={jest.fn( )} /> );
|
|
const arCameraButton = screen.queryByLabelText(
|
|
i18next.t( "AI-Camera" )
|
|
);
|
|
expect( arCameraButton ).toBeFalsy( );
|
|
} );
|
|
} );
|