Pagination bugs live at the edges: the last page with three items instead of ten, the empty result set, the page number past the end. Set a total that does not divide evenly by the page size and every one of those cases appears.
What you can control
- Four pagination styles covering the conventions in common use.
- Page counts, offsets and navigation links are computed from the total, so the last page really is short.
- The empty-page toggle produces the zero-result state that most list UIs never got designed for.
- The Link header style follows RFC 8288 with
first,prev,nextandlastrelations.
Testing ideas
- Last page. Set the current page to the last one and check that "next" is disabled and the item count is right when the final page is partial.
- Empty page. Simulate an empty page — the state most list UIs forget to design.
- Styles. Compare offset, cursor, RFC 8288
Linkheader and JSON:API styles to build a client that handles the one your API actually uses. - Large totals. Set 100,000 items to test page-number rendering and "showing 99,951–100,000" labels.
What this is not
Cursors are base64-encoded index strings. Real cursor pagination uses an opaque token encoding sort position, so use these for client testing rather than server design.