Files
iNaturalistReactNative/tests/unit/components/ObsDetailsDefaultMode/FaveButton.test.js
Amanda Bullington 1d340eb558 Feat: redesigned ObsDetails screen in debug mode (#2580)
* Create ObsDetailsDefaultMode and rearrange items on top of screen

* Move activity, details, and more into three different sections instead of tabs

* Styling cleanup; change Activity name to Community

* Fix scroll to activity item from Notifications

* Add ObsDetailsDefaultMode unit tests

* Show kebab menu on other users' observations
2024-12-18 19:24:24 -08:00

30 lines
776 B
JavaScript

import FaveButton from "components/ObsDetailsDefaultMode/FaveButton";
import React from "react";
import factory from "tests/factory";
import { renderComponent } from "tests/helpers/render";
describe( "FaveButton", () => {
it( "should survive no currentUser", ( ) => {
expect(
( ) => renderComponent(
<FaveButton
observation={factory( "LocalObservation" )}
/>
)
).not.toThrow( );
} );
it( "should survive no currentUser for an observation w/ existing votes", ( ) => {
const observation = factory( "RemoteObservation", {
votes: [factory( "RemoteVote" )]
} );
expect(
( ) => renderComponent(
<FaveButton
observation={observation}
/>
)
).not.toThrow( );
} );
} );