Open EgoziE opened 1 year ago
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit 34c29652d9fb9d1cfdd60669d8878a50c3d89148:
Sandbox | Source |
---|---|
userEvent-dom | Configuration |
userEvent-react | Configuration |
I didn't notice, it's almost a copy of https://github.com/testing-library/user-event/pull/1176 Please accept either PR 🙏🏼
What: Added a verification that window exists in functions
resetClipboardStubOnView
anddetachClipboardStubFromView
which are called onafterAll
.Why: When testing in SSR environment, window does (and should) not exist, therefore my tests fail.
How: Just added a conditional chaining.
Checklist:
I believe these functions should not be called in
afterAll
at all unless the user is actively using clipboard functionality. Thanks 💛