Files
iNaturalistReactNative/tests/unit/components/ObsDetails/Sheets/WithdrawIDSheet.test.js
Ryan Stelly b78be9243d lint rule & autofix for "trailing comma" (#3299)
* (lint) MOB-1063 enforce trailing commas

* autofix trailing commas

* manually fix newly introduced maxlen violations

* add trailing comma convention to i18n build
2025-12-22 20:17:13 -06:00

38 lines
1.0 KiB
JavaScript

import { screen } from "@testing-library/react-native";
import WithdrawIDSheet from "components/ObsDetails/Sheets/WithdrawIDSheet";
import { t } from "i18next";
import React from "react";
import factory from "tests/factory";
import { renderComponent } from "tests/helpers/render";
const mockTaxon = factory( "RemoteTaxon", {
name: "Plantae",
iconic_taxon_name: "Plantae",
} );
const mockMutate = jest.fn();
const mockHandleClose = jest.fn();
describe( "WithdrawIDSheet", () => {
it( "renders sheet correctly", async ( ) => {
renderComponent(
<WithdrawIDSheet
onPressClose={mockHandleClose}
withdrawOrRestoreIdentification={mockMutate}
taxon={mockTaxon}
/>,
);
expect( await screen.findByText( t( "WITHDRAW-ID-QUESTION" ) ) ).toBeTruthy( );
expect( screen.getByRole(
"button",
{ name: t( "WITHDRAW-ID" ), disabled: false },
) ).toBeTruthy( );
expect( screen.getByRole(
"button",
{ name: t( "CANCEL" ), disabled: false },
) ).toBeTruthy( );
} );
} );