Files
iNaturalistReactNative/tests/unit/components/SharedComponents/TaxonResult.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

35 lines
742 B
JavaScript

import { render, screen } from "@testing-library/react-native";
import { TaxonResult } from "components/SharedComponents";
import React from "react";
const mockTaxon = {
id: 1,
name: "Aves",
preferred_common_name: "Birds",
rank: "family",
rank_level: 60,
};
jest.mock( "sharedHooks/useCurrentUser", ( ) => ( {
__esModule: true,
default: () => undefined,
} ) );
jest.mock( "sharedHooks/useTaxon", () => ( {
__esModule: true,
default: () => ( { taxon: mockTaxon } ),
} ) );
describe( "TaxonResult", () => {
it( "should render correctly", () => {
render(
<TaxonResult
accessibilityLabel="this is the taxon"
taxon={mockTaxon}
/>,
);
expect( screen ).toMatchSnapshot();
} );
} );