Skip to content

Add unit tests for the backend pagination clamping, defaults, and meta math#1121

Merged
1nonlypiece merged 1 commit into
Commitlabs-Org:masterfrom
Baskarayelu:issue-990
Jun 29, 2026
Merged

Add unit tests for the backend pagination clamping, defaults, and meta math#1121
1nonlypiece merged 1 commit into
Commitlabs-Org:masterfrom
Baskarayelu:issue-990

Conversation

@Baskarayelu

Copy link
Copy Markdown
Contributor

Closes #990

Summary

  • Add src/lib/backend/__tests__/pagination.test.ts with 13 focused test cases
  • Cover default page/pageSize values and offset computation
  • Cover clamping: page=0, negative page, pageSize above MAX_PAGE_SIZE, custom maxPageSize
  • Cover non-numeric and float inputs falling back or throwing PaginationParseError
  • Assert totalPages, hasNextPage, hasPrevPage meta math including zero-total edge case
  • Verify correct data slicing for middle and last (partial) pages

Test plan

  • Run pnpm test (requires node_modules installed) — all 13 tests in the new file pass
  • No regressions against existing test suite

🤖 Generated with Claude Code

…nd meta math (Commitlabs-Org#990)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

@Baskarayelu is attempting to deploy a commit to the 1nonly's projects Team on Vercel.

A member of the Team first needs to authorize it.

@1nonlypiece 1nonlypiece merged commit 11ad6d1 into Commitlabs-Org:master Jun 29, 2026
2 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add unit tests for the backend pagination clamping, defaults, and meta math

2 participants