-
Notifications
You must be signed in to change notification settings - Fork 231
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
Test suite: Clicking on track does not set the slider to the new value #265
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I also have this issue, but only on mobile. Any solution you found? |
No solution found. The only turn around for test suite to pass is to test user interaction through keyboard instead of click. |
I found out that there was a PR created with a fix: #311 |
Description
I ran into issues when I created a test when user clicks on steps to update slider value. However, testing using keyboard
Arrow Rigth
works as expected.Also when testing with the preview the click on the steps works as expected.
Package versions:
Relevant code
Component
App
Tests
Notes:
The span for each mark contains an aria-label useful with testing so we can query this mark with
getByLabelText
. Even though aria-label does not make much sense on span tags. We are able to query and click marks butonChange
get called with old value or not called at all. So slider value does not get updated.Tested this code with react-slider v2.0.1 with a local app however, sandbox throws some errors. So I set and older version. But same error on related to test suite happens when testing with either 1.3.1 or 2.0.1.
Maybe this old solved issues could be related: onChange returns old value if used with value prop #197 onAfterChange called with old values #201 but didn't seems to provide a solution since this one is a weird behavior on test.
CodeSandbox
Please replicate on the below sandbox link
https://codesandbox.io/s/react-slider-prompt-level-iun34i?file=/src/App.test.js
Thank you so much for the library, it is an awesome one.
The text was updated successfully, but these errors were encountered: