test: add Playwright coverage and test ids for CpsPaginatorComponent - #826
Open
fateeand wants to merge 2 commits into
Open
test: add Playwright coverage and test ids for CpsPaginatorComponent#826fateeand wants to merge 2 commits into
fateeand wants to merge 2 commits into
Conversation
fateeand
requested review from
TerranceKhumalo-absa and
korel-san
as code owners
August 5, 2026 12:29
Contributor
Coverage report for library
Test suite run success2474 tests passing in 76 suites. Report generated by 🧪jest coverage report action from 227684a |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the cps-paginator component’s testability and demo coverage by adding stable data-testid hooks, expanding the composition-page examples, and introducing Playwright E2E tests that validate real browser interactions and accessibility-relevant behavior.
Changes:
- Added
data-testidattributes to key paginator template elements to enable reliable E2E selection and downstream consumer testing. - Updated the composition “Paginator” docs page to use interactive state (first/rows) and added new examples (single-page collapse, custom rows-per-page reset, custom background).
- Added a new Playwright spec covering keyboard navigation, focus redirection, aria-disabled/tabindex behavior, rows-per-page interactions, alwaysShow collapse, reset-on-rows-change, and backgroundColor styling.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| projects/cps-ui-kit/src/lib/components/cps-paginator/cps-paginator.component.html | Adds data-testid hooks for the paginator root and rows-per-page UI elements. |
| projects/composition/src/app/pages/paginator-page/paginator-page.examples.ts | Expands the demo examples and wires Basic usage to interactive state with a TS snippet. |
| projects/composition/src/app/pages/paginator-page/paginator-page.component.ts | Adds state + handler for the interactive example and imports FormsModule/checkbox for toggling. |
| projects/composition/src/app/pages/paginator-page/paginator-page.component.html | Renders updated and new examples (including a toggle-driven single-page collapse). |
| playwright/cps-ui-kit/components/cps-paginator.spec.ts | Introduces Playwright coverage for real browser behavior and accessibility-adjacent states. |
Contributor
Playwright test resultsDetails
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
aria-disabled/tabindexreflecting page state, the real nestedcps-selectrows-per-page dropdown, realalwaysShow=falsecollapse (driven interactively via a real toggle, not just compared against a second static example), realresetPageOnRowsChangebehavior, and real appliedbackgroundColorCSS.cps-checkbox), custom rows-per-page with reset, and custom background color.cps-paginator,cps-paginator-rows-per-page,cps-paginator-rows-per-page-title,cps-paginator-rows-per-page-select) for downstream consumers.TODO: Merge with
feat: add test ids to paginator componentto generate a releaseRelease notes: