testing-library / dom-testing-library

🐙 Simple and complete DOM testing utilities that encourage good testing practices.
https://testing-library.com/dom
MIT License
3.27k stars 467 forks source link

`fireEvent.keyPress` should change the value of input #1106

Closed dehghani-mehdi closed 2 years ago

dehghani-mehdi commented 2 years ago

Related issue #1104 and #1105, which is closed without any good reason.

KeyPress means there is a value/character entered by the user, so why RTL doesn't change the value of the input?

I don't care about the implementation details, as RTL doesn't, KeyPress cause a change in the input value, so I think fireEvent.keyPress doesn't implement correctly.

timdeschryver commented 2 years ago

@dehghani-mehdi creating new issues without additional information isn't helpful for both parties. keyPress doesn't change the value, you can verify this in the browser by sending the keypress event to an input. I'm going to close this issue, and I hope you don't create a new issue for it.

Again, if you need help to test something, join the discord server. We're using GitHub issues to track bugs, and new features, this case is not a bug but the desired behavior (as we've mentioned in the previous issues).