tests: Fix Compliance distro selector#4445
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #4445 +/- ##
=======================================
Coverage 74.66% 74.66%
=======================================
Files 229 229
Lines 7568 7568
Branches 2834 2831 -3
=======================================
Hits 5651 5651
Misses 1660 1660
Partials 257 257 Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The distroId derivation assumes only whitespace differences and simple lowercase transformations; consider centralizing this logic or aligning it with the actual DOM/id generation function to avoid subtle mismatches if ids change (e.g., special characters, punctuation).
- In
ComplianceCIS.boot.tsyou now hardcodelabel[for="rhel10-input"]whilehelpers.tscomputes the id dynamically; consider reusing the helper logic or a shared utility to keep selection of distro inputs consistent across tests. - Relying on
label[for="..."]selectors ties the tests to specific id attributes; if possible, prefer more stable selectors (e.g., data attributes or accessible names) to reduce brittleness when markup changes.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The distroId derivation assumes only whitespace differences and simple lowercase transformations; consider centralizing this logic or aligning it with the actual DOM/id generation function to avoid subtle mismatches if ids change (e.g., special characters, punctuation).
- In `ComplianceCIS.boot.ts` you now hardcode `label[for="rhel10-input"]` while `helpers.ts` computes the id dynamically; consider reusing the helper logic or a shared utility to keep selection of distro inputs consistent across tests.
- Relying on `label[for="..."]` selectors ties the tests to specific id attributes; if possible, prefer more stable selectors (e.g., data attributes or accessible names) to reduce brittleness when markup changes.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
That's a different issue patternfly/patternfly-react#12422 and it has to be fixed in Patternfly patternfly/patternfly-react#12424. Since we started using Modal, I have discovered a bug where the Modal sometimes sets |
SSIA