Skip to content

test(discover): add unit tests for Pagination component#12263

Open
amarkdotdev wants to merge 1 commit into
opensearch-project:mainfrom
amarkdotdev:test/discover-pagination-coverage
Open

test(discover): add unit tests for Pagination component#12263
amarkdotdev wants to merge 1 commit into
opensearch-project:mainfrom
amarkdotdev:test/discover-pagination-coverage

Conversation

@amarkdotdev

@amarkdotdev amarkdotdev commented Jun 21, 2026

Copy link
Copy Markdown

Description

Adds unit tests for the previously untested Pagination component in src/plugins/discover/public/application/components/default_discover_table/.

Tests added (6 tests)

  • Renders pagination container with correct data-test-subj
  • Displays correct item range (startItem–endItem of totalItems)
  • Calls goToPage callback with 0-indexed page number
  • Shows sample size limit warning when endItem >= sampleSize
  • Hides the warning when results are within the limit
  • Renders the correct number of page buttons

Testing

yarn test:jest src/plugins/discover/public/application/components/default_discover_table/pagination.test.tsx

Related to #7048

@amarkdotdev amarkdotdev requested a review from FriedhelmWS as a code owner June 21, 2026 16:55
@amarkdotdev amarkdotdev force-pushed the test/discover-pagination-coverage branch 2 times, most recently from f7671e5 to 0a38bfa Compare June 21, 2026 18:37
Add unit tests for the previously untested Pagination component in
the default_discover_table directory:

- Renders pagination container with correct data-test-subj
- Displays correct item range (startItem-endItem of totalItems)
- Calls goToPage callback when a page button is clicked
- Shows sample size limit warning when endItem >= sampleSize
- Hides the warning when results are within the limit
- Renders the correct number of page buttons

This continues the test coverage work from opensearch-project#7048.

Signed-off-by: Aaron Mark <64331623+amarkdotdev@users.noreply.github.com>
@amarkdotdev amarkdotdev force-pushed the test/discover-pagination-coverage branch from 0a38bfa to 9068e93 Compare June 21, 2026 18:38
@amarkdotdev

Copy link
Copy Markdown
Author

Same situation as #12261 — the Code-Diff-Analyzer failure is a workflow setup issue (unpinned GitHub Actions blocked by repo policy), not a problem with the Pagination unit tests. Retriggered CI with a2282fe5. DCO and security checks pass.

@amarkdotdev amarkdotdev force-pushed the test/discover-pagination-coverage branch 2 times, most recently from 27fbf3a to 9068e93 Compare June 23, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant