summaryrefslogtreecommitdiffstats
path: root/src/components/organisms/layout/posts-list.test.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/organisms/layout/posts-list.test.tsx')
-rw-r--r--src/components/organisms/layout/posts-list.test.tsx15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/components/organisms/layout/posts-list.test.tsx b/src/components/organisms/layout/posts-list.test.tsx
index 9b226ac..7429cbd 100644
--- a/src/components/organisms/layout/posts-list.test.tsx
+++ b/src/components/organisms/layout/posts-list.test.tsx
@@ -71,4 +71,19 @@ describe('PostsList', () => {
render(<PostsList posts={posts} total={posts.length} />);
expect(screen.getAllByRole('article')).toHaveLength(posts.length);
});
+
+ it('renders the number of loaded posts', () => {
+ render(<PostsList posts={posts} total={posts.length} />);
+ const info = `${posts.length} loaded articles out of a total of ${posts.length}`;
+ expect(screen.getByText(info)).toBeInTheDocument();
+ });
+
+ it('renders a load more button', () => {
+ render(
+ <PostsList posts={posts} total={posts.length} showLoadMoreBtn={true} />
+ );
+ expect(
+ screen.getByRole('button', { name: /Load more/i })
+ ).toBeInTheDocument();
+ });
});