mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2026-05-05 22:25:57 -04:00
* Show simple my obs header only for logged-in users * ActivityCount TS * CommentsCount TS * IdentificationsCount TS * ObsStatus TS initial pass not looking at errors * QualityGradeStatus TS * Update RealmObservation interface * Update RealmObservation interface * ObsUploadStatus TS, plain copy, no errors yet * Update types * Update type * IconicTaxonIcon TS * ObsImage TS * PhotoCount TS * ObsImagePreview TS * Image is only opaque when logged in * DateDisplay TS * Remove debug flag from UploadObsStatus * Update type * Prop to hide ObsUploadStatus * Test observations need those otherwise they appear as needing edit * Update imports
46 lines
1004 B
JavaScript
46 lines
1004 B
JavaScript
import {
|
|
screen
|
|
} from "@testing-library/react-native";
|
|
import ObsStatus from "components/SharedComponents/ObsStatus.tsx";
|
|
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( );
|
|
} );
|
|
} );
|