Files
iNaturalistReactNative/tests/unit/components/ObsDetailsDefaultMode/NotesSection/NotesSection.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

28 lines
960 B
JavaScript

import { screen } from "@testing-library/react-native";
import NotesSection from "components/ObsDetailsDefaultMode/NotesSection/NotesSection.tsx";
import React from "react";
import factory from "tests/factory";
import faker from "tests/helpers/faker";
import { renderComponent } from "tests/helpers/render";
// Before migrating to Jest 27 this line was:
// jest.useFakeTimers();
// TODO: replace with modern usage of jest.useFakeTimers
// jest.useFakeTimers( {
// legacyFakeTimers: true
// } );
const mockObservation = factory( "LocalObservation", {
created_at: "2022-11-27T19:07:41-08:00",
description: faker.lorem.paragraph( )
} );
describe( "NotesSection", ( ) => {
test( "should show description of observation", async ( ) => {
renderComponent( <NotesSection description={mockObservation.description} /> );
const description = await screen.findByText( mockObservation.description );
expect( description ).toBeTruthy( );
} );
} );