Skip to content

test: add Playwright coverage and test ids for CpsTreeAutocompleteComponent - #844

Open
fateeand wants to merge 2 commits into
masterfrom
809-cover-tree-autocomplete-component-with-playwright-tests
Open

test: add Playwright coverage and test ids for CpsTreeAutocompleteComponent#844
fateeand wants to merge 2 commits into
masterfrom
809-cover-tree-autocomplete-component-with-playwright-tests

Conversation

@fateeand

@fateeand fateeand commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Added 23 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 (click + double-Backspace), prefix icon rendering, required-field validation, two-way binding readout, accessible-name computation, hideDetails, openOnClear=false, real typing filters the tree, Enter confirms typed text (exact match / no-match revert), custom emptyMessage rendering, clicking the box moves real focus to the input and visually hides the selected-label span (real computed-opacity assertion), expandAll()/collapseAll().
  • Added test ids to the component's template.
  • Added 5 demo examples to cover hideDetails, openOnClear=false, ariaLabel-only, expandAll/collapseAll and custom emptyMessage.
  • Fixed a Prettier reformat on CpsTreeAutocompleteAppearanceType.
  • Fixed the clear icon's (mousedown) handler only called preventDefault(), not stopPropagation(). Since the box wrapper listens on (mousedown)="onBoxClick()", the mousedown still bubbled up and unconditionally reopened the dropdown completely bypassing openOnClear=false.
  • 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.

TODO: Merge with feat: add test ids to tree autocomplete component and fix openOnClear behavior


Release notes:

  • added Playwright E2E coverage for cps-tree-autocomplete
  • added test ids to cps-tree-autocomplete
  • fixed cps-tree-autocomplete openOnClear behavior

Copilot AI lite review requested due to automatic review settings August 12, 2026 14:42
@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.88% 6273/8055
🟡 Branches 66.94% 2891/4319
🟡 Functions 79.45% 1183/1489
🟡 Lines 78.85% 5865/7438

Test suite run success

2474 tests passing in 76 suites.

Report generated by 🧪jest coverage report action from 26fe9fe

@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Playwright test results

passed  804 passed

Details

stats  804 tests across 33 suites
duration  24 minutes, 16 seconds
commit  26fe9fe
info  For details, download the Playwright report

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

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 Autocomplete component with Playwright tests

2 participants