-
Notifications
You must be signed in to change notification settings - Fork 251
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
Problem testing keyboard interaction with select element #786
Comments
Thanks for opening this issue ❤️ I created a codesandbox with your tests: https://codesandbox.io/s/trusting-platform-r8v1p?file=/src/App.test.js We lack Some remarks on the tests though: |
Thanks so so much for your fast answer and your remarks 😍
I think I do not really understand what you mean by that. Do you mean that replacing the parameter to
I'll have a look into it. Unfortunately, because I have no experience in typescript I can not promise that I'll be able to fix that. |
No it won't work in the test because the default behavior on the select is not implemented yet.
Don't worry. The actual implementation is the least of concerns. Researching what is to be the expected behavior according to specs and living standard is usually the much bigger part of the work needed to solve such issues. |
- behavior for control and functional keys on HTMLSelectElement are not supported in user-event / testing lib at the moment, see testing-library/user-event#786 Signed-off-by: Mirjam Aulbach <mirjam.aulbach@aiven.io>
- behavior for control and functional keys on HTMLSelectElement are not supported in user-event / testing lib at the moment, see testing-library/user-event#786 Signed-off-by: Mirjam Aulbach <mirjam.aulbach@aiven.io>
Relevant code:
What you did:
I ran the tests above.
What happened:
The tests failed with the following message.
Problem description:
I want to test the keyboard interaction with a select component to make sure that it also works for users who can only interact via the keyboard. However, only the first option is selected whether I add any keyboard interaction through
userEvent.keyboard
oruserEvent.type
and the tests fail. Nevertheless, interacting in the browser with the element works fine.Through the sandbox I saw that the space bar is being kept pressed when interacting with the element. However, using
"{space>}{arrowdown}{arrowdown}{/space}"
does not work either.Suggested solution:
Unfortunately, I have no idea for a solution. I am not sure if there is a problem in my code or if testing this kind of interaction is not supported by the user-event library and I would be happy if you could point me in the right direction.
The text was updated successfully, but these errors were encountered: