-
Notifications
You must be signed in to change notification settings - Fork 240
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
Could not fill input with userEvent.type() #644
Comments
I could not reproduce this behavior. If you can reproduce the behavior in codesandbox, I'll gladly reopen. There might be a problem with your setup. Check the |
I am getting the same error after upgrading to latest user-event. I am using testing-library/vue. |
@cbows You most probably encountered a different issue based on Vue's asynchronous rendering. |
I can reproduce the error with the example above.
<template>
<input type="text" placeholder="some field" />
</template>
<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
@Component
export default class MyComponent extends Vue {}
</script>
import { screen, render } from "@testing-library/vue";
import Component from "@/components/Component.vue";
import userEvent from "@testing-library/user-event";
describe("Component.vue", () => {
it("can change value", async () => {
render(Component);
const input = screen.getByPlaceholderText("some field");
await userEvent.type(input, "abcd", { delay: 50 });
expect(input).toHaveValue("abcd");
});
}); On user-event 12.8.3 I get
On user-event 13.1.8 I get
|
The last working version seems to be 13.0.10, on 13.0.11 I get another error:
Starting with 13.0.12 I get the error described earlier. |
Could this be related to TypeScript? I will try to reproduce on CodeSandbox. |
No, as already mentioned it could be related to |
Oh sorry. I missed that. I have |
I have done the following steps to reproduce the error:
You can find the code here: https://github.com/cbows/user-event-issue-644 Maybe someone is able to generate a CodeSandbox from this, I stopped trying after a whole bunch of unrelated errors (haven't used CodeSandbox before, so probably just some issue with the setup). EDIT: The same happens without TypeScript enabled. |
|
Ah, I had forgotten to explicitly add But the code you pointed at hints towards In the current dev branch, this dependency has already been removed, but it is still present in the latest stable version Thanks for being patient and pointing me towards the error! EDIT: Another solution as suggested in vuejs/vue-cli#5114 might be to use "resolutions": {
"jest": "^26.6.3",
"ts-jest": "^26.4.4",
"babel-jest": "^26.6.3"
} and use the default |
@testing-library/user-event
version: 13.1.2What you did:
I'm trying to fill an input:
What happened:
I got an error message during the test execution:
The text was updated successfully, but these errors were encountered: