-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
RangeControl: Convert unit tests to typescript #41445
RangeControl: Convert unit tests to typescript #41445
Conversation
Size Change: 0 B Total Size: 1.25 MB ℹ️ View Unchanged
|
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.
Great work! Code changes LGTM, tests still pass, and there's not TS errors 🚀
Optionally, we could look into partially rewriting these tests using @testing-library/user-event
(similarly to what done in #40697 and #41270). In case you feel like working on it, I'll leave it up to you if you want to add those changes in this PR, or apply them in a follow-up PR.
The key word "partially" 😄. I had a go at it a few days ago and realized there's no user-event way to manipulate a |
Oh well 😅 We could at least stop using |
Thanks for the suggested improvements 👍 I've removed the use of The one catch here was being able to select the icons as they are only spans with no alt, text, or role. I've added a As for leveraging |
I think this is safe, especially since the svg element is But... to be honest I don't think the "should render with icons" test is worth contorting ourselves to avoid a |
I'm actually not sure about adding the |
146713c
to
1f2a73b
Compare
308c826
to
57fb884
Compare
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.
LGTM 🚀
57fb884
to
35005fa
Compare
6a7bda9
to
a304615
Compare
35005fa
to
54554f1
Compare
237923b
to
a1fa7d3
Compare
See: #40535 (comment) for more information on why we are ignoring this error. TL;DR we are looking to address some conflicts between input control types for their value props.
a435f81
to
f19616e
Compare
9471fee
to
1b53957
Compare
Depends on:
Related:
What?
Converts the
RangeControl
unit tests to typescript.Why?
Completes the process of converting the
RangeControl
to TypeScript alongside #40535 & #41444How?
Testing Instructions
npm run test-unit /packages/components/src/range-control/test