userEvent.hover
doesn't work: The provided value is not of type 'Element'
(v14.2.1)
#979
Answered
by
ph-fritsche
epodgaetskiy
asked this question in
Q&A
-
https://codesandbox.io/s/solitary-wildflower-0h4f5o?file=/src/app.test.js |
Beta Was this translation helpful? Give feedback.
Answered by
ph-fritsche
Jul 18, 2022
Replies: 1 comment
-
This is a problem with shadowed globals in the test environment. See #892 const user = userEvent.setup({document}) Testing pseudo-classes like this is, unfortunately, impossible because they can not be controlled programmatically. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ph-fritsche
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a problem with shadowed globals in the test environment. See #892
You need to setup
user-event
with thedocument
that is also used byrender
, otherwise it falls back toglobalThis.document
which is a different one:Testing pseudo-classes like this is, unfortunately, impossible because they can not be controlled programmatically.