Skip to content
masterclass Buddy

React Testing Library · Concept

userEvent

user-event simulates browser-like user interactions for Testing Library tests. Prefer a session from userEvent.setup() and use its methods for actions such as clicks and keyboard input.

Last updated

Syntax

userEvent.setup(options?): UserEvent

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • fireEvent
  • userEvent.click
  • userEvent.keyboard
  • userEvent.setup

Source: Introduction | Testing Library. Checked 2026-11-03.