test: add Playwright coverage and test ids for CpsTreeSelectComponent - #843
Open
fateeand wants to merge 5 commits into
Open
test: add Playwright coverage and test ids for CpsTreeSelectComponent#843fateeand wants to merge 5 commits into
fateeand wants to merge 5 commits into
Conversation
fateeand
requested review from
TerranceKhumalo-absa and
lukasmatta
as code owners
August 12, 2026 12:16
Contributor
Coverage report for library
Test suite run success2474 tests passing in 76 suites. Report generated by 🧪jest coverage report action from cfa280d |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds end-to-end Playwright coverage for cps-tree-select, introduces stable data-testid hooks across the component template and composition demo page, and fixes expandAll() / collapseAll() so PrimeNG’s p-tree reliably re-renders after in-place expansion state mutations.
Changes:
- Added a new Playwright spec covering keyboard navigation, selection, expand/collapse behaviors, virtual scroll rendering, chip removal, validation, accessibility name, and
hideDetails/openOnClear=false. - Added
data-testidattributes toCpsTreeSelectComponenttemplate and to the composition demo page instances to support stable E2E selectors. - Updated
expandAll()/collapseAll()in the shared base tree dropdown to force a tree refresh and mark the tree for check.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| projects/cps-ui-kit/src/lib/components/internal/cps-base-tree-dropdown/cps-base-tree-dropdown.component.ts | Ensures expand/collapse all triggers a refresh and change detection for PrimeNG tree re-rendering. |
| projects/cps-ui-kit/src/lib/components/cps-tree-select/cps-tree-select.component.ts | Formatting-only change to the appearance type union. |
| projects/cps-ui-kit/src/lib/components/cps-tree-select/cps-tree-select.component.html | Adds data-testid hooks throughout the tree-select UI for stable Playwright selectors. |
| projects/composition/src/app/pages/tree-select-page/tree-select-page.examples.ts | Adds new demo/example snippets for expand/collapse, ariaLabel, hideDetails, and openOnClear=false. |
| projects/composition/src/app/pages/tree-select-page/tree-select-page.component.ts | Imports CpsButtonComponent to support the new expand/collapse demo controls. |
| projects/composition/src/app/pages/tree-select-page/tree-select-page.component.scss | Adds styling for the new expand/collapse action button row. |
| projects/composition/src/app/pages/tree-select-page/tree-select-page.component.html | Adds new demo sections and data-testid attributes used by Playwright tests. |
| playwright/cps-ui-kit/components/cps-tree-select.spec.ts | New Playwright E2E test suite covering key interaction, rendering, a11y name, and option behaviors. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
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
hideDetails,openOnClear=false.hideDetails,openOnClear=false,ariaLabelandexpandAll()/collapseAll().expandAll()/collapseAll()mutatedTreeNode.expandedin place but never told PrimeNG'sp-tree(which isOnPush) to re-render, so the DOM silently never reflected the call.TODO: Merge with
feat: add test ids to tree select component and fix expandAll()/collapseAll() re-renderRelease notes:
expandAll()/collapseAll()re-render