Files
iNaturalistReactNative/tests/unit/components/SharedComponents/ObservationsFlashList/ObsStatus.test.js
Corey Farwell a43446909c Remove the need to specify TypeScript file extensions in imports (#3094)
* Don't require TS extensions in imports

* Resolve all import extension errors

* Remove file extension from import paths used in mocks

* Remove .d of type definition file paths

* Remove .d of type definition file and import as type

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2025-09-07 23:41:42 +02:00

46 lines
1000 B
JavaScript

import {
screen
} from "@testing-library/react-native";
import ObsStatus from "components/SharedComponents/ObsStatus";
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", () => {
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( );
} );
} );