MCPcopy Index your code
hub / github.com/testing-library/user-event

github.com/testing-library/user-event @v14.6.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v14.6.1 ↗ · + Follow
466 symbols 1,365 edges 188 files 2 documented · 0% 485 cross-repo links
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


Build Status Code Coverage version downloads MIT License All Contributors PRs Welcome Code of Conduct Discord

Watch on GitHub Star on GitHub Tweet

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.

See 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

❓ 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

MIT

Extension points exported contracts — how you extend this code

Options (Interface)
(no doc)
src/options.ts
EventConstructor (Interface)
(no doc)
src/utils/misc/cloneEvent.ts
typeOptions (Interface)
(no doc)
src/utility/type.ts
Element (Interface)
(no doc)
src/document/UI.ts
keyboardKey (Interface)
(no doc)
src/system/keyboard.ts
PointerPressAction (Interface)
(no doc)
src/pointer/index.ts
InterfaceMap (Interface)
(no doc)
src/event/createEvent.ts
KeyboardAction (Interface)
(no doc)
src/keyboard/index.ts

Core symbols most depended-on inside this repo

setup
called by 190
tests/_helpers/setup.ts
getEvents
called by 125
tests/_helpers/listeners.ts
render
called by 61
tests/_helpers/setup.ts
getEventSnapshot
called by 54
tests/_helpers/listeners.ts
isElementType
called by 52
src/utils/misc/isElementType.ts
eventWasFired
called by 50
tests/_helpers/listeners.ts
getUISelection
called by 34
src/document/UI.ts
getUIValue
called by 23
src/document/UI.ts

Shape

Function 267
Method 97
Class 67
Interface 28
Enum 7

Languages

TypeScript100%

Modules by API surface

src/event/createEvent.ts44 symbols
src/utils/dataTransfer/DataTransfer.ts22 symbols
src/system/keyboard.ts20 symbols
tests/_helpers/listeners.ts19 symbols
src/utils/dataTransfer/Clipboard.ts19 symbols
testenv/modules/fakeTimers.ts18 symbols
src/system/pointer/mouse.ts16 symbols
src/system/pointer/index.ts16 symbols
src/setup/directApi.ts16 symbols
src/document/UI.ts15 symbols
src/system/pointer/pointer.ts10 symbols
src/utils/focus/cursor.ts9 symbols

For agents

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

⬇ download graph artifact