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

26 lines
837 B
JavaScript

import { render, screen } from "@testing-library/react-native";
import UserList from "components/UserList/UserList";
import React from "react";
import factory from "tests/factory";
const mockFollowers = [
factory( "RemoteUser", {
observation_count: 35
} )
];
describe( "UserList", () => {
it( "should render first follower in followers list", async ( ) => {
render( <UserList users={mockFollowers} /> );
const follower = await screen.findByText( mockFollowers[0].login );
expect( follower ).toBeVisible();
} );
it( "should render observation count of first follower", async ( ) => {
render( <UserList users={mockFollowers} /> );
const observationCount = await screen
.findByText( `${mockFollowers[0].observation_count} Observations` );
expect( observationCount ).toBeVisible();
} );
} );