Skip to content

test: add Playwright coverage and test ids for CpsTreeSelectComponent - #843

Open
fateeand wants to merge 5 commits into
masterfrom
810-cover-tree-select-component-with-playwright-tests
Open

test: add Playwright coverage and test ids for CpsTreeSelectComponent#843
fateeand wants to merge 5 commits into
masterfrom
810-cover-tree-select-component-with-playwright-tests

Conversation

@fateeand

@fateeand fateeand commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Added 12 tests: keyboard arrow navigation, Escape close, directory expand/collapse via click, Enter/Space selecting a leaf (+closing), Enter expanding a directory, virtual-scroll rendering, chip removal, prefix icon rendering, required-field validation, two-way binding readout, accessible-name computation, hideDetails, openOnClear=false.
  • Added test ids to the component's template.
  • Added four new demo examples to cover hideDetails, openOnClear=false, ariaLabel and expandAll()/collapseAll().
  • Fixed a bug in case when there is no selected value, where expandAll()/collapseAll() mutated TreeNode.expanded in place but never told PrimeNG's p-tree (which is OnPush) to re-render, so the DOM silently never reflected the call.
  • Fixed a Prettier reformat on CpsTreeSelectAppearanceType.

TODO: Merge with feat: add test ids to tree select component and fix expandAll()/collapseAll() re-render


Release notes:

  • added Playwright E2E coverage for cps-tree-select
  • added test ids to cps-tree-select
  • fixed expandAll()/collapseAll() re-render

@fateeand
fateeand requested a review from korel-san as a code owner August 12, 2026 12:16
Copilot AI lite review requested due to automatic review settings August 12, 2026 12:16
@fateeand fateeand linked an issue Aug 12, 2026 that may be closed by this pull request
@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Coverage report for library

St.
Category Percentage Covered / Total
🟡 Statements 77.81% 6273/8062
🟡 Branches 66.94% 2891/4319
🟡 Functions 79.45% 1183/1489
🟡 Lines 78.8% 5865/7443

Test suite run success

2474 tests passing in 76 suites.

Report generated by 🧪jest coverage report action from cfa280d

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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-testid attributes to CpsTreeSelectComponent template 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.

@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Playwright test results

passed  790 passed

Details

stats  790 tests across 33 suites
duration  23 minutes, 34 seconds
commit  cfa280d
info  For details, download the Playwright report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cover Tree Select component with Playwright tests

2 participants