Skip to content
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

userEvent.paste possibly casts string to a number #1053

Open
jnous-5 opened this issue Sep 6, 2022 · 0 comments
Open

userEvent.paste possibly casts string to a number #1053

jnous-5 opened this issue Sep 6, 2022 · 0 comments
Labels
bug Something isn't working needs investigation Someone has to do research on this

Comments

@jnous-5
Copy link

jnous-5 commented Sep 6, 2022

Reproduction example

https://codesandbox.io/s/happy-architecture-1crzb7?file=/src/App.test.js

Prerequisites

  1. Go to Tests tab and run the test
  2. Notice that the test fails due to mismatched paste value
  3. If you check console log of App, the raw e.target.value equals to 0.8 (instead of .80)

Expected behavior

userEvent.paste should return .80.

Actual behavior

userEvent.paste returns 0.8 (was somehow cast to a number?).

User-event version

14.4.3

Environment

N/A. Can be reproduced in codesandbox.

Additional context

This used to work in v13+. Please see repro below.
https://codesandbox.io/s/hungry-wildflower-e5o25n?file=/src/App.test.js

@jnous-5 jnous-5 added bug Something isn't working needs assessment This needs to be looked at by a team member labels Sep 6, 2022
@ph-fritsche ph-fritsche added needs investigation Someone has to do research on this and removed needs assessment This needs to be looked at by a team member labels Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs investigation Someone has to do research on this
Projects
None yet
Development

No branches or pull requests

2 participants