-
Notifications
You must be signed in to change notification settings - Fork 204
fix: Restore legacy test util selectors for Radio Group #4058
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
||
| findButtons(): Array<RadioButtonWrapper> { | ||
| return this.findAllByClassName(radioButtonStyles.root).map(r => new RadioButtonWrapper(r.getElement())); | ||
| return this.findAll(`:is(.${radioButtonStyles.root}, .${legacyStyles.radio})`).map( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For finding the radio group with the old test utils, adding the static legacyRootSelector statement above is enough (related: cloudscape-design/test-utils#100), but in order to find the radio buttons inside the radio group, it is necessary to manually construct the selector here.
| ], | ||
| "radio-group": [ | ||
| "awsui_radio_1mabk", | ||
| "awsui_root_1mabk", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the two classnames that were removed here: https://github.com/cloudscape-design/components/pull/4021/files#diff-ce8e8ee722d906e9038b89e1e23cddc59e5a144eab9f63e99751ddd309ce7fd2L517-L518
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4058 +/- ##
==========================================
+ Coverage 96.99% 97.12% +0.12%
==========================================
Files 862 863 +1
Lines 25226 25295 +69
Branches 9111 9119 +8
==========================================
+ Hits 24469 24567 +98
- Misses 710 722 +12
+ Partials 47 6 -41 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
src/radio-group/styles.scss
Outdated
| /* used for backwards-compatibility with older versions of test-utils */ | ||
| } | ||
|
|
||
| .radio { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to add .radio to the styles if we don't use it anywhere? Is it just for the snapshot-tests to generate correctly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description
Ticket:
AWSUI-61492Related doc:
zOhkAQWpDXKqHow has this been tested?
npm run build && npx jest -c jest.unit.config.js -u src/__tests__/snapshot-tests/test-utils-selectors.test.tsxand verified the change in the snapshot (part of this PR's diff)Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
CONTRIBUTING.md.CONTRIBUTING.md.Security
checkSafeUrlfunction.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.