mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2026-09-16 23:57:34 -04:00
23 lines
604 B
JavaScript
23 lines
604 B
JavaScript
import { screen } from "@testing-library/react-native";
|
|
import PostList from "components/Journal/PostList";
|
|
import React from "react";
|
|
import factory from "tests/factory";
|
|
import { renderComponent } from "tests/helpers/render";
|
|
|
|
const mockPost = factory( "RemotePost" );
|
|
const renderPostList = ( ) => renderComponent(
|
|
<PostList
|
|
posts={[mockPost]}
|
|
fetchNextPage={jest.fn( )}
|
|
isFetchingNextPage={false}
|
|
/>,
|
|
);
|
|
|
|
describe( "PostList", ( ) => {
|
|
it( "displays a post", async ( ) => {
|
|
renderPostList( );
|
|
|
|
expect( await screen.findByText( mockPost.title ) ).toBeVisible( );
|
|
} );
|
|
} );
|