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.click(elem) injects ["_constructor-name_"] into element object #1181

Open
ak99372 opened this issue Nov 24, 2023 · 0 comments
Open
Labels
bug Something isn't working needs assessment This needs to be looked at by a team member

Comments

@ak99372
Copy link

ak99372 commented Nov 24, 2023

Reproduction example

userEvent.click(inputElement)

Prerequisites

await userEvent.click(input);

Expected behavior

user event doesn't mutate/modify the element (and related properties/objects)

Actual behavior

element (and related objects) being injected with and _constructor-name_ property.

image

including parentElement and related objects

image

This breaks and messes our code that relies on certain properties and object structure (like NodeList).
Is there any way to disable this type of injection?

User-event version

14.5.1

Environment

Testing Library framework:

JS framework:

Test environment:

DOM implementation:

Additional context

No response

@ak99372 ak99372 added bug Something isn't working needs assessment This needs to be looked at by a team member labels Nov 24, 2023
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 assessment This needs to be looked at by a team member
Projects
None yet
Development

No branches or pull requests

1 participant