Course lesson

Simulate All User Interactions With an Element by Using the user-event Library

Whilst fireEvent helps to interact with elements, that is not how a user interacts with them. When a user interacts with an element, more than a single event is fired. This means that by using fireEvent, we might be missing some scenarios that might be...

Duration
1 min
Access
Included
Transcript
Retained from source evidence

Whilst fireEvent helps to interact with elements, that is not how a user interacts with them. When a user interacts with an element, more than a single event is fired. This means that by using fireEvent, we might be missing some scenarios that might be triggered accidentally by other events.

In this lesson, we are going to learn about the companion library of the React Testing Library that allows you to simulate full interactions with your elements: the user-event library.