-
Notifications
You must be signed in to change notification settings - Fork 157
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
Payment don't work with jest #157
Comments
Feel free to submit a PR or suggest a fix! |
Ok, upon further testing, I discovered that with the setup mentioned, the KeyboardEvent I'm getting is: // Keyboard Event for "<Space>"
{
which: 0,
charCode: 0,
keyCode: 32,
} What I assume is happening is that js-dom is setting My suggestion here would be for us to change the implementation of everything to use QJ.normalizeEvent = function(e) {
// ...
e = {
which: original.keyCode || original.charCode || original.which,
// ... instead of the current approach: |
What you think? |
These aren't my libraries but I am able to merge and accept PR's. I don't have access to QJ only to Payment and Card. I like your idea though! @jessepollak |
You should submit a PR over at QJ: https://github.com/jessepollak/qj |
So I have a React application and I wanted to test the formatting of my input, and I couldn't test it properly, because
payment
usesqt
, andqt
uses thewhich
property of the KeyboardEvent which is deprecated (the recommendation being that we should use thekey
event instead). And apperently jest, who (to my knowledge) usesjs-dom
to render the components in the document, doesn't seem to be creating thewhich
property in the KeyboardEvent.I first thought about opening this issue on js-dom, but since this is a deprecated property I just figured they had moved on from using it and it won't come back to it. Then I thought about opening this issue on
qt
, but as the readme says this is a dependency used primarily by this library, and my problem being with this library, I decided to open it here instead.Of course, that is only the case if this is really the problem, in my tests we receive every time from the
which
property on theKeyboardEvent
a value of0
.To make the test I'm using:
the test is more or less:
The text was updated successfully, but these errors were encountered: