mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2026-04-18 22:11:29 -04:00
* (lint) MOB-1063 enforce trailing commas * autofix trailing commas * manually fix newly introduced maxlen violations * add trailing comma convention to i18n build
35 lines
742 B
JavaScript
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();
|
|
} );
|
|
} );
|