Files
iNaturalistReactNative/tests/unit/components/UserList/UserList.test.js
Amanda Bullington bc817e8b80 Add projects, followers, and following lists via UserProfile (#2300)
Show projects, followers, and following lists via UserProfile
2024-10-24 19:04:42 -07:00

26 lines
841 B
JavaScript

import { render, screen } from "@testing-library/react-native";
import UserList from "components/UserList/UserList.tsx";
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();
} );
} );