-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
[docs] Add Testing section to Rating component doc #46268
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
Netlify deploy previewBundle size report |
Hey @mapache-salvaje! May I assign you for review of this docs addition? thanks! |
Signed-off-by: Diego Andai <[email protected]>
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.
Some small copyedits here, otherwise LGTM!
Co-authored-by: mapache-salvaje <[email protected]> Signed-off-by: Shivam Shrivastava <[email protected]>
Hi @DiegoAndai ,The PR has been reviewed and updated with some changes. Could you please proceed further when you get a chance? Thanks! |
Co-authored-by: mapache-salvaje <[email protected]> Signed-off-by: Shivam Shrivastava <[email protected]>
081aa98
to
3a4d75c
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.
Thanks @0210shivam
My pleasure! Thanks for the opportunity — excited to keep contributing to MUI. |
This PR adds a new "Testing" section to the Rating component documentation.
Closes #38828
Motivation
When testing the Rating component in environments like Jest + jsdom, certain user interactions (e.g., hover-based selection) may not behave as expected. This is due to
getBoundingClientRect()
returning0
values by default in jsdom, which can cause issues such asNaN
being passed to theonChange
handler.What’s included
fireEvent
instead ofuserEvent
.userEvent.click()
in such contexts.Example