Files
iNaturalistReactNative/tests/unit/components/AddObsModal.test.js
Johannes Klein 5c8e3be12c test AI camera in e2e (#2188)
* Add a cameraZoomRange default
* Small detox version bump
* Add a mocked camera with a take photo button
* An e2e mock for the computer vision plugin predicting a frame
* Mock taking a photo by loading the first photo from the CameraRoll

Closes #1981
2024-11-01 10:38:37 -07:00

22 lines
641 B
JavaScript

import { render, screen } from "@testing-library/react-native";
import AddObsModal from "components/AddObsModal.tsx";
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();
} );
} );