# testing-library/user-event

🐕 Simulate user events

Repository: https://github.com/testing-library/user-event
Canonical: https://ross.abutalabs.com/products/user-event
Homepage: https://testing-library.com/user-event
Language: TypeScript
License: MIT
License Family: permissive
Topics: testing, javascript, dom, user-interaction, ui, frontend
Last push: 2026-08-22T02:04:35+00:00

## Health v2 (maintenance only)
Score: 98/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 98, release rhythm 98, longevity 100
- inputs: {"age_days": 2904, "days_push": 12, "days_rel": 12, "gap_med": 5.5, "n_releases_24m": 7}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2323, forks 256 (observed 2026-08-28T04:06:37.236571+00:00)

## What it is
user-event is a companion library for Testing Library that simulates real user interactions with the DOM by dispatching the full sequence of events a browser would fire for actions like clicking, typing, and uploading files. It provides higher-level interaction APIs than raw fireEvent, including visibility and interactability checks, making component tests behave more like real user sessions in jsdom or happy-dom environments.

## Use cases
- simulate user typing and clicking in jsdom tests
- test react components with realistic user interactions
- fire full browser event sequences instead of single dom events
- test keyboard input including modifier keys and key sequences
- simulate file uploads and clipboard interactions in tests
- write user-centric tests for frontend ui components
- test that hidden or disabled elements reject interactions like a real browser

## When to choose
- you are writing Testing Library component tests that run in jsdom or happy-dom
- you need realistic multi-event interactions like focus-then-type instead of raw fireEvent calls
- you want built-in checks that prevent interacting with hidden or disabled elements
- you need to simulate keyboard, pointer, clipboard, and upload workflows in unit tests

## When to avoid
- your tests can run in a real browser - prefer Vitest Browser Mode or Playwright instead
- you are writing end-to-end tests where Playwright's auto-waiting locator actions are a better fit
- you need to dispatch a single specific DOM event that user-event does not implement
- you need layout-aware pointer testing since jsdom has no layout and positions are not simulated

## Facets
- artifact type: library
- maturity: active
- function: testing, e2e-testing, mocking
- domain: testing, frontend, web-development, developer-tools
- platform: browser, cross-platform
- tags: dom-testing, user-interaction-simulation, testing-library, jsdom, happy-dom, jest, vitest, event-dispatching, ui-testing, component-testing, nodejs

## Member repositories
- testing-library/user-event (main) score 98

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:37.236571+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:38:36.402188+00:00, confidence not recorded.
  - readme: https://github.com/testing-library/user-event (fetched 2026-08-28T04:06:37.236571+00:00, sha e7ca5a38c37a)
  - homepage: https://testing-library.com/user-event (fetched 2026-08-29T10:19:21.750680+00:00, sha 8e6b835ab312)
  - site_page: https://testing-library.com/docs (fetched 2026-08-29T10:19:21.753367+00:00, sha 294680c6ca00)
  - site_page: https://testing-library.com/docs/recipes (fetched 2026-08-29T10:19:21.755000+00:00, sha e707259ba080)
  - site_page: https://testing-library.com/docs/queries/about (fetched 2026-08-29T10:19:21.756418+00:00, sha 1bb7d31eef5f)
  - site_page: https://testing-library.com/docs/dom-testing-library/intro (fetched 2026-08-29T10:19:21.759277+00:00, sha 273a42fd0eae)
  - site_page: https://testing-library.com/docs/user-event/install (fetched 2026-08-29T10:19:21.761418+00:00, sha 6cc048b7b85c)
  - site_page: https://testing-library.com/docs/user-event/setup (fetched 2026-08-29T10:19:21.763200+00:00, sha f69153c6b2dd)
  - site_page: https://testing-library.com/docs/user-event/options (fetched 2026-08-29T10:19:21.764922+00:00, sha 20ec4228d2dc)
  - site_page: https://testing-library.com/docs/user-event/pointer (fetched 2026-08-29T10:19:21.766422+00:00, sha 467110a64cc6)
- Data as of 2026-08-30T08:39:29.467469+00:00.
