Skip to content

Commit

Permalink
feat: test for one post use case
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyreilly committed Nov 12, 2022
1 parent ffff08e commit e893df6
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,27 @@ exports[`paginateBlogPosts generates one page only 3`] = `
]
`;

exports[`paginateBlogPosts generates one page only 4`] = `
[
{
"items": [
"post1",
],
"metadata": {
"blogDescription": "Blog Description",
"blogTitle": "Blog Title",
"nextPage": undefined,
"page": 1,
"permalink": "/",
"postsPerPage": 1,
"previousPage": undefined,
"totalCount": 5,
"totalPages": 1,
},
},
]
`;

exports[`paginateBlogPosts generates right pages 1`] = `
[
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,17 @@ describe('paginateBlogPosts', () => {
});
expect(paginatedBlogPosts3).toHaveLength(1);
expect(paginatedBlogPosts3).toMatchSnapshot();

const paginatedBlogPosts4 = paginateBlogPosts({
blogPosts,
basePageUrl: '/',
blogTitle: 'Blog Title',
blogDescription: 'Blog Description',
blogPaginationActive: false,
postsPerPageOption: 1,
});
expect(paginatedBlogPosts4).toHaveLength(1);
expect(paginatedBlogPosts4).toMatchSnapshot();
});
});

Expand Down

0 comments on commit e893df6

Please sign in to comment.