testing-library/user-event
testing-library/user-event has 2,336 GitHub stars and 263 forks. GitHot measured +1 stars in 24 hours. Last checked 2026-11-07 21:53 UTC. Last push 2026-10-13.
🐕 Simulate user events
Measured star growth
- in 24h
- +1
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Original[!IMPORTANT] > Considering this for new tests? If your tests can run in a real browser, prefer that over simulating events in jsdom.
- Vitest Browser Mode includes a
userEventfromvitest/browserthat mirrors this API but drives a real browser (recommended over this package in browser mode).- Playwright has first-class locator actions (
click(),fill(),press(), etc.) with auto-waiting - usually the better choice for E2E and Playwright component tests.This package is still reasonable for jsdom/happy-dom Testing Library tests. Details and recommendations: #1319.
The problem
From testing-library/dom-testing-library#107:
[...] it is becoming apparent the need to express user actions on a web page using a higher-level abstraction than
fireEvent
The solution
user-event tries to simulate the real events that would happen in the browser
as the user interacts with it. For example userEvent.click(checkbox) would
change the state of the checkbox.
The more your tests resemble the way your software is used, the more confidence they can give you.
Issues
Looking to contribute? Look for the Good First Issue label.
🐛 Bugs
Please file an issue for bugs, missing documentation, or unexpected behavior.
💡 Feature Requests
Please file an issue to suggest new features. Vote on feature requests by adding a 👍. This helps maintainers prioritize what to work on.
❓ Questions
For questions related to using the library, please visit a support community instead of filing an issue on GitHub.
Contributors
We most sincerely thank the people who make this project possible. Contributions of any kind are welcome! 💚
License
Explore related projects
freeCodeCamp/freeCodeCamp
freeCodeCamp.org's open-source codebase and curriculum. Learn math, programming, and computer science for free.
458,722 starsdonnemartin/system-design-primer
Learn how to design large-scale systems. Prep for the system design interview. Includes Anki flashcards.
377,263 starsreact/react
The library for web and native user interfaces.
252,365 starsvuejs/vue
This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
212,629 stars