RangeControl: Convert unit tests to typescript#41445
Conversation
|
Size Change: 0 B Total Size: 1.25 MB ℹ️ View Unchanged
|
ciampo
left a comment
There was a problem hiding this comment.
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
57fb884 to
35005fa
Compare
6a7bda9 to
a304615
Compare
35005fa to
54554f1
Compare
237923b to
a1fa7d3
Compare
54554f1 to
5744092
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
RangeControlunit tests to typescript.Why?
Completes the process of converting the
RangeControlto TypeScript alongside #40535 & #41444How?
Testing Instructions
npm run test-unit /packages/components/src/range-control/test