-
Notifications
You must be signed in to change notification settings - Fork 62
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 with keyboard event simulating #102
Comments
I think this is a great suggestion. Are you able to implement it? We could release, along with your other changes, in 4.0.0 |
Yeah, no problem! |
I think we could outsource the work to this module https://github.com/KenanY/create-event ? |
Yes, although we can only use it for keyup, keydown click and dblclick
events
…On Thu, Aug 10, 2017 at 8:24 PM, Fangzhou Li ***@***.***> wrote:
I think we could outsource the work to this module
https://github.com/KenanY/create-event ?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#102 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AMlbW0LzB2CCtAtQi-GEyjv49mvClYYPks5sW1jzgaJpZM4OxUvN>
.
|
These days I have spent some time reading the source code of triggerhappy. It provides a lots more features, including touch events testing. I think we can learn something from it and jest and we will have a lot to discuss about. |
I don't know if anyone is already working on this issue/enhancement, but can that person also look at the feature of key + shiftKey=true (and altKey) because that is currently also not functioning. in specific this line |
@mathijswesterhof Hi, I'm not working on this. Sorry. |
This project isn't actively maintained, although I'm happy to accept PRs. I recommend using Vue Test Utils, which is based on avoriaz—https://github.com/vuejs/vue-test-utils |
good to know, i'll try to migrate then, see if the problem is solvable on vue-test-utils. if not I'll make a pr there |
Though it's possible to simulate some specific keys to test keyboard events, it's actually too limited - only a few keys are allowed:
avoriaz/src/Wrapper.js
Lines 373 to 383 in c6fa79e
So I think it's necessary to make it possible to test any keys.
Also, as this article suggests, it's best to watch
event.which
property rather thanevent.keyCode
. But avoriaz has only set value forkeyCode
property. If onlyevent.which
has been used by the application logic, then we can not test that at all.avoriaz/src/Wrapper.js
Lines 397 to 400 in c6fa79e
In general, the synthetic event should be able to be freely modified to suit any specific needs:
The text was updated successfully, but these errors were encountered: