-
Notifications
You must be signed in to change notification settings - Fork 250
.type doesn't work with vue-testing-library #119
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
Comments
Hi, I think the difference between I don't really know how it works in Vue-land. Is it possible that you have this distinction too? |
Hi! Thanks for answering. Vue also maps native events such as Input and Change. However, |
Since we're trying to simulate a browser I think we should fire both events instead of replacing it. |
AFAIK (and correct me if I'm wrong),
If that's the case, would it make sense send an
|
That's what happens for native HTML but not in React. I think in React |
Oh wow you're right, I didn't know that, thanks. I feel Vue works similary to native HTML (see demo) so yeah, an I'll happily submit a PR if you feel that that's the apropiate change (no pun intended). |
You man a PR to replace the vent or to add it? |
(sorry for the late response!) Whatever works best in both frameworks. I guess we could add it, so the workflow would be |
Do you think you could add tests for Vue? Basically, porting the ones we have but render Vue components instead of React. I think we need to have those in place before we start thinking about cross-library support |
Makes total sense! Will work on that :) |
Thank you 👍 |
Can I open a PR to add this? It doesn't look like anyone else got to it yet 👀 |
@afontcu Awesome! I have local changes that make the I might also add tests for vanilla JS. I'm using Preact, which, unlike React, actually adds a
LOL I missed this line while I was skimming through this issue 🙈 I was able to modify this library locally to make
|
@calebeby I am also using Preact, any chance that PR is somewhere? 🙏 |
@Gpx do you think you could review my 4 open PR's pretty soon? I'd love to continue moving forward with making |
I guess this can be closed now :) |
I am still having issues typing things into I made a comment here: #141 (comment) These are the packages I'm using to do typing and to render my component: import userEvent from '@testing-library/user-event';
import { mount } from '@vue/test-utils'; |
Hi! First of all, thank you for your work on this repo!
I wanted to highlight that the current implementation of
.type()
isn't working when used withvue-testing-library
.Not quite sure why yet thou, I believe it has something to do with using
fireEvent.change
instead offireEvent.input
here. I have passing tests usingfireEvent.input
, and the minute I change them to use.change
, they start failing. Is there any reason to prefer change event over input?Thanks!
The text was updated successfully, but these errors were encountered: