user-event icon indicating copy to clipboard operation
user-event copied to clipboard

userEvent.click(elem) injects ["_constructor-name_"] into element object

Open ak99372 opened this issue 1 year ago • 0 comments

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 avatar Nov 24 '23 01:11 ak99372