Skip to content

test: add Playwright coverage and test ids for radio group - #830

Open
fateeand wants to merge 2 commits into
masterfrom
799-cover-radio-component-with-playwright-tests
Open

test: add Playwright coverage and test ids for radio group#830
fateeand wants to merge 2 commits into
masterfrom
799-cover-radio-component-with-playwright-tests

Conversation

@fateeand

@fateeand fateeand commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Added 4 tests covering the three-component family (CpsRadioGroupComponent, CpsRadioComponent, CpsRadioButtonComponent).
    • Real native radio-group keyboard navigation: ArrowDown from an enabled radio natively skips a disabled sibling and moves real focus + real checked state to the next enabled one.
    • Real form validation: selecting the wrong option and blurring shows the real error text with real aria-describedby wiring; selecting the right option clears it.
    • Real inert blocks focus: a nested, real cps-select inside an unselected <cps-radio>'s projected content genuinely refuses .focus() calls until its radio is selected.
    • Real hideDetails suppresses both a hint and a validation error: one example's lifecycle proves both - a set hint stays absent while untouched, and once driven genuinely invalid (aria-invalid="true") the error stays absent too.
  • Added two new demo examples ("Radio group with a hint", "Required radio group with hidden details").
  • Added testids to the components' templates.

TODO: Merge with feat: add test ids to radio group


Release notes:

  • added Playwright E2E coverage for radio group
  • added test ids to radio group

Copilot AI lite review requested due to automatic review settings August 6, 2026 10:56
@fateeand fateeand linked an issue Aug 6, 2026 that may be closed by this pull request
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Coverage report for library

St.
Category Percentage Covered / Total
🟡 Statements 77.85% 6267/8050
🟡 Branches 66.98% 2889/4313
🟡 Functions 79.61% 1183/1486
🟡 Lines 78.83% 5859/7432

Test suite run success

2474 tests passing in 76 suites.

Report generated by 🧪jest coverage report action from 96c89ba

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.

🟡 Changes recommended

There are correctness/maintainability issues in newly added test id wiring and a broken TS documentation snippet that should be fixed before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

This PR expands the radio-group component family’s E2E coverage and improves testability by introducing data-testid hooks across the radio group/radio/radio-button templates, plus adding new composition demo examples to exercise hint/hideDetails and validation behaviors.

Changes:

  • Added Playwright E2E tests for native radio keyboarding, validation/error wiring, inert focus blocking, and hideDetails behavior.
  • Added data-testid attributes throughout the radio-group templates (and host for cps-radio).
  • Added two new composition examples and updated the radio page form setup to support them.
File summaries
File Description
projects/cps-ui-kit/src/lib/components/cps-radio-group/cps-radio/cps-radio.component.ts Adds a host-level data-testid to cps-radio.
projects/cps-ui-kit/src/lib/components/cps-radio-group/cps-radio-group.component.html Adds multiple data-testid hooks to the radio-group structure and generated options.
projects/cps-ui-kit/src/lib/components/cps-radio-group/cps-radio-button/cps-radio-button.component.html Adds data-testid hooks to radio-button wrapper/input/content/label.
projects/composition/src/app/pages/radio-page/radio-page.examples.ts Adds new examples (“hint”, “required hidden details”) and associated code strings.
projects/composition/src/app/pages/radio-page/radio-page.component.ts Refactors to inject() and adds a second required control for the new example.
projects/composition/src/app/pages/radio-page/radio-page.component.html Renders the two new radio-group examples on the composition page.
playwright/cps-ui-kit/components/cps-radio-group.spec.ts Introduces new Playwright coverage for radio-group behaviors.
Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 3
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

Comment thread playwright/cps-ui-kit/components/cps-radio-group.spec.ts Outdated
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Playwright test results

passed  516 passed

Details

stats  516 tests across 20 suites
duration  16 minutes, 40 seconds
commit  96c89ba
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 Radio component with Playwright tests

2 participants