Files
iNaturalistReactNative/tests/unit/components/AddObsModal.test.js
budowski a1792bb507 Dismissable add obs modal help (#2236)
Closing the add-obs help text, only closes the help text + never shows up again

Close #2039

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2024-10-17 11:03:19 -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 arCameraButton = screen.getByLabelText(
i18next.t( "AI-Camera" )
);
expect( arCameraButton ).toBeOnTheScreen();
} );
} );