mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2026-01-20 11:49:20 -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>
25 lines
871 B
JavaScript
25 lines
871 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", ( ) => ( {
|
|
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( );
|
|
} );
|
|
} );
|