test: add Playwright coverage and test ids for CpsSelectComponent - #832
Open
fateeand wants to merge 1 commit into
Open
test: add Playwright coverage and test ids for CpsSelectComponent#832fateeand wants to merge 1 commit into
fateeand wants to merge 1 commit into
Conversation
fateeand
requested review from
TerranceKhumalo-absa,
korel-san and
lukasmatta
as code owners
August 6, 2026 16:06
Contributor
There was a problem hiding this comment.
Pull request overview
This PR strengthens the cps-select component’s end-to-end verification by adding Playwright coverage, introducing stable data-testid hooks in the component template, and extending the composition page with new examples. It also fixes a mouse interaction bug where clicking the clear icon could reopen the dropdown even when openOnClear=false.
Changes:
- Added extensive Playwright E2E coverage for
cps-selectbehaviors (open/select/reselect, required error, chips/select-all, virtual scroll highlighting, keyboard navigation, icons, andopenOnClear=false). - Added
data-testidattributes throughoutcps-select.component.htmland updated bindings to use[style.*]/[class.*]instead ofngStyle/ngClass. - Added two new composition examples (
hideDetailsandopenOnClear=false) and the minimal page wiring to support them.
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-select/cps-select.component.html | Adds test IDs, replaces ngStyle/ngClass with style/class bindings, and fixes clear-icon mousedown bubbling to prevent unwanted reopen when openOnClear=false. |
| projects/composition/src/app/pages/select-page/select-page.examples.ts | Adds example definitions for hideDetails and openOnClear=false. |
| projects/composition/src/app/pages/select-page/select-page.component.ts | Adds hideDetailsSelect form control and openOnClearValue used by the new examples/tests. |
| projects/composition/src/app/pages/select-page/select-page.component.html | Adds test IDs to examples and renders the two new examples on the select composition page. |
| playwright/cps-ui-kit/components/cps-select.spec.ts | New Playwright E2E spec covering cps-select behaviors using the new test IDs. |
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
p-virtualscrollerrendering with arrow-key highlighting, real per-option icon rendering, two-wayngModelbinding withkeepInitialOrder, real keyboard navigation (ArrowUp/Down highlight + wrap-around, Enter, Space, Escape), andopenOnClear=falsebehavior.cps-select.component.html.hideDetails, and "Select without reopening on clear" exercisingopenOnClear=false).cps-select.component.html: the clear icon's(mousedown)handler only calledpreventDefault(), notstopPropagation(), so a mouse click on it bubbled up to the select box's ownonBoxClick()handler, which unconditionally reopens the dropdown - silently defeatingopenOnClear=falsefor mouse users.TODO: Merge with
feat: add test ids to select component and fix openOnClear propRelease notes:
cps-selectcomponentopenOnClearis false