Skip to content

554 pagination test coverage#663

Merged
utksh1 merged 6 commits into
utksh1:mainfrom
jess2937:554-pagination-test-coverage
Jun 9, 2026
Merged

554 pagination test coverage#663
utksh1 merged 6 commits into
utksh1:mainfrom
jess2937:554-pagination-test-coverage

Conversation

@jess2937

@jess2937 jess2937 commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Description

Adds direct unit test coverage for the Pagination component. Tests cover record range calculations and disabled states for prev/next buttons across empty, first-page, and last-page scenarios.

Related Issues

Fixes #554

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

How Has This Been Tested?

Ran tests locally using Vitest:

npm test -- Pagination

All 9 tests passed:

  • shows correct start and end for first page
  • shows correct start and end for middle page
  • shows correct end on last page with partial results
  • shows 0 start and 0 end when total is 0
  • disables prev button on first page
  • enables next button when not on last page
  • disables next button on last page
  • disables both buttons when total is 0
  • disables both buttons when loading
image

Checklist

  • My code follows the code style of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.

@utksh1 utksh1 added level:beginner 20 pts difficulty label for small beginner-friendly PRs type:testing Testing work category bonus label area:frontend Frontend React/UI work labels Jun 8, 2026

@utksh1 utksh1 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Pagination coverage is relevant, but this PR also carries the preferred-export-format hook test that has already been merged via #634. Please rebase on latest main and remove frontend/testing/unit/hooks/usePreferredExportFormat.test.ts from this PR so it stays focused on Pagination coverage only.

@jess2937

jess2937 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Hi @utksh1 , thank you for the review! I'm working on this right now.
I will rebase on latest main and remove frontend/testing/unit/hooks/usePreferredExportFormat.test.ts from this PR since it was already merged via #634. This PR will then focus solely on Pagination coverage.
I'll push the updated branch shortly. Please allow me a few hours to complete the rebase and cleanup. Thank you for your patience!

@jess2937 jess2937 force-pushed the 554-pagination-test-coverage branch from 142019e to 8ff7ebc Compare June 9, 2026 16:38
@jess2937

jess2937 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Hi @utksh1, I've cleaned up this PR. It now contains only the Pagination test coverage. The branch was rebased on latest main and all unrelated files (including usePreferredExportFormat.test.ts already merged in #634) have been removed. Please re-review when you have a moment. Thank you!

@utksh1 utksh1 added the gssoc:approved Admin validation: approved for GSSoC scoring label Jun 9, 2026

@utksh1 utksh1 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latest net diff is now focused on Pagination component coverage only, resolving the earlier unrelated hook-test concern. Approved pending a fresh branch update.

@utksh1 utksh1 merged commit 0e0089d into utksh1:main Jun 9, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:frontend Frontend React/UI work gssoc:approved Admin validation: approved for GSSoC scoring level:beginner 20 pts difficulty label for small beginner-friendly PRs type:testing Testing work category bonus label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TEST] Add Pagination coverage for range math and disabled edge states

2 participants