Files
iNaturalistReactNative/tests/unit/components/Explore/ObserversView.test.js
Ryan Stelly b78be9243d lint rule & autofix for "trailing comma" (#3299)
* (lint) MOB-1063 enforce trailing commas

* autofix trailing commas

* manually fix newly introduced maxlen violations

* add trailing comma convention to i18n build
2025-12-22 20:17:13 -06:00

38 lines
957 B
JavaScript

import { screen } from "@testing-library/react-native";
import ExploreFlashList from "components/Explore/ExploreFlashList";
import React from "react";
import factory from "tests/factory";
import { renderComponent } from "tests/helpers/render";
const mockObservers = [{
...factory( "RemoteUser" ),
observation_count: 7,
}, {
...factory( "RemoteUser" ),
observation_count: 44,
}];
jest.mock( "sharedHooks/useInfiniteScroll", () => ( {
__esModule: true,
default: () => ( {
data: mockObservers,
isFetchingNextPage: true,
} ),
} ) );
describe( "ObserversView", () => {
it( "should show number of observations a user has", async ( ) => {
renderComponent(
<ExploreFlashList
hideLoadingWheel
isConnected
data={mockObservers}
layout="user"
/>,
);
const identificationCount = await screen.findByText( "7 Observations" );
expect( identificationCount ).toBeVisible( );
} );
} );