React Testing Library · Method
userEvent.click
userEvent.click simulates a real browser-style click. It performs related interaction steps and checks, rather than dispatching only one DOM event.
Last updated
Syntax
click(element: Element, eventInit?: object, options?: object): Promise<void>In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
fireEventuserEvent.setup()dblClick()tripleClick()hover()pointer()