-
Notifications
You must be signed in to change notification settings - Fork 401
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
fix: .toHaveValue()
/ .toHaveFormValues()
on input type range now expect a number
#365
base: main
Are you sure you want to change the base?
Conversation
Hey there 👋 the PR template mention to Thanks 😄 |
Codecov Report
@@ Coverage Diff @@
## main #365 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 26 26
Lines 630 616 -14
Branches 236 224 -12
=========================================
- Hits 630 616 -14
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
This looks good, but should we leave the breaking changes for a major release or consider this a bug fix? |
FWIW, I was planning to take some time next week to gather this and at least one other PR that are breaking changes, and make a single new major release with them all. I was also planning to include in this major release the removal of all the custom matchers that we already have marked as deprecated for various versions now. There are 2 or 3 of them. |
What:
This PR aim to fix #364.
Why:
In my use case on a react app, i'm using a constant that is a number for a default value of an input type range. I couldn't use it in my test without hacking a bit since
.toHaveValue()
were expecting a string instead of a number.How:
It makes jest-dom consider
<input type="range />
value getter the same as<input type="number" />
Checklist:
I consider this change as a breaking change since it would break any test related to range inputs.