testing-library / testing-library/user-event
Add a way to clean up userEvent after a test
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 258
- PR merge metrics
- No merged PRs in 30d
Description
Problem description
Introducing testing-library/user-event into a single test has started causing some unrelated tests to fail in another part of the codebase (tests dealing with focus specifically)
Suggested solution
It would be great if I could call userEvent.setup() in my test and then have a user.destroy() or userEvent.destroy() method to call after the test is complete
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the userEvent.setup() entry point and review linked pull request #1270, which is already addressing this request. Verify the intended cleanup behavior against the focus-related failures described in the issue; the work is complete when teardown can be used after a test without causing unrelated focus tests to fail.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100