mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2026-06-21 14:08:31 -04:00
51 lines
1.1 KiB
JavaScript
51 lines
1.1 KiB
JavaScript
import {
|
|
screen
|
|
} from "@testing-library/react-native";
|
|
import ObsStatus from "components/SharedComponents/ObservationsFlashList/ObsStatus";
|
|
import initI18next from "i18n/initI18next";
|
|
import React from "react";
|
|
import factory from "tests/factory";
|
|
import { renderComponent } from "tests/helpers/render";
|
|
|
|
const mockObservation = factory( "LocalObservation", {
|
|
identifications: [
|
|
factory( "LocalIdentification", {
|
|
current: true
|
|
} ),
|
|
factory( "LocalIdentification", {
|
|
current: false
|
|
} )
|
|
],
|
|
comments: []
|
|
} );
|
|
|
|
describe( "ObsStatus", () => {
|
|
beforeAll( async () => {
|
|
await initI18next();
|
|
} );
|
|
|
|
it( "displays count for current ids, not withdrawn ids", () => {
|
|
renderComponent(
|
|
<ObsStatus
|
|
observation={mockObservation}
|
|
/>
|
|
);
|
|
|
|
const idCount = screen.getByText( /1/ );
|
|
|
|
expect( idCount ).toBeVisible( );
|
|
} );
|
|
|
|
it( "displays comment count", () => {
|
|
renderComponent(
|
|
<ObsStatus
|
|
observation={mockObservation}
|
|
/>
|
|
);
|
|
|
|
const commentCount = screen.getByText( /0/ );
|
|
|
|
expect( commentCount ).toBeVisible( );
|
|
} );
|
|
} );
|