MCPcopy Create free account
hub / github.com/testing-library/user-event

github.com/testing-library/user-event

Chat with this repo
repository ↗ · DeepWiki ↗ · release v13.5.0 ↗ · + Follow · compare 3 versions
142 symbols 504 edges 93 files ⚖ MIT 1 documented · 1% updated 16d agov14.6.7 · 2026-09-02★ 2,32695 open issues

Browse by type

Functions 122 Types & classes 20
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

user-event

dog

Fire events the same way the user does

Read The Docs | Edit the docs


[![Build Status][build-badge]][build] [![Code Coverage][coverage-badge]][coverage] [![version][version-badge]][package] [![downloads][downloads-badge]][npmtrends] [![MIT License][license-badge]][license] ![All Contributors][all-contributors-badge] [![PRs Welcome][prs-badge]][prs] [![Code of Conduct][coc-badge]][coc] [![Discord][discord-badge]][discord]

[![Watch on GitHub][github-watch-badge]][github-watch] [![Star on GitHub][github-star-badge]][github-star] [![Tweet][twitter-badge]][twitter]

Table of Contents

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][fire-event]

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.][guiding-principle]

Installation

With NPM:

npm install --save-dev @testing-library/user-event @testing-library/dom

With Yarn:

yarn add --dev @testing-library/user-event @testing-library/dom

Docs

Read The Docs | Edit the docs

Known limitations

  • No <input type="color" /> support. #423

Issues

Looking to contribute? Look for the [Good First Issue][good-first-issue] label.

🐛 Bugs

Please file an issue for bugs, missing documentation, or unexpected behavior.

[See Bugs][bugs]

💡 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.

[See Feature Requests][requests]

❓ Questions

For questions related to using the library, please visit a support community instead of filing an issue on GitHub.

  • [Discord][discord]
  • [Stack Overflow][stackoverflow]

Contributors

Thanks goes to these people ([emoji key][emojis]):

Giorgio Polvara 🐛 💻 📖 🤔 🚇 👀 ⚠️ Weyert de Boer 💻 ⚠️ Tim Whitbeck 🐛 💻 Michaël De Boey 📖 Michael Lasky 💻 📖 🤔 Ahmad Esmaeilzadeh 📖 Caleb Eby 💻 🐛 👀
Adrià Fontcuberta 🐛 ⚠️ 💻 Sky Wickenden 🐛 💻 Bodnar Bogdan 🐛 💻 Zach Perrault 📖 Ryan Stelly 📖 Ben Monro 💻 Christopher Martin 💻
Yuancheng Wu 👀 MJ 📖 Jeff McRiffey 💻 ⚠️ Jaga Santagostino 💻 ⚠️ jordyvandomselaar 💻 ⚠️ Ilya Lyamkin 💻 ⚠️ Kenneth Luján Rosas 💻 ⚠️
Joe Morgan 💻 David Hirtle 💻 whiteUnicorn 💻 Matej Šnuderl 👀 Rodrigo Pombo 💻 Jake Verbaten

Extension points exported contracts — how you extend this code

browse all types & interfaces →

Core symbols most depended-on inside this repo

browse all functions →

Shape

Function 117
Interface 10
Enum 8
Method 5
Class 2

Languages

TypeScript100%

Modules by API surface

src/__tests__/helpers/utils.ts20 symbols
src/keyboard/getNextKeyDef.ts12 symbols
src/keyboard/keyboardImplementation.ts9 symbols
src/click.ts9 symbols
src/__tests__/helpers/custom-element.js7 symbols
src/upload.ts5 symbols
src/keyboard/shared/fireInputEvent.ts5 symbols
src/utils/edit/selectionRange.ts4 symbols
src/utils/edit/maxLength.ts4 symbols
src/utils/click/getMouseEventOptions.ts4 symbols
src/utils/edit/isEditable.ts3 symbols
src/type/typeImplementation.ts3 symbols

Dependencies from manifests, versioned

@babel/runtime7.12.5 · 1×
@testing-library/react11.2.5 · 1×
@types/estree0.0.45 · 1×
@types/jest-in-case1.0.3 · 1×
@types/react17.0.3 · 1×
is-ci2.0.0 · 1×
jest-in-case1.0.2 · 1×
jest-serializer-ansi1.0.3 · 1×
kcd-scripts11.1.0 · 1×
react17.0.2 · 1×

For agents

$ claude mcp add user-event \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page