What is user-event and why use it?
mainConcept: Simulating real user interactions
user-event is a library designed to simulate real browser events that occur when a user interacts with a web page.
Unlike lower-level utilities like fireEvent (from dom-testing-library), which simply dispatch a single event, user-event provides a higher-level abstraction that simulates the full sequence of events a real user would trigger. For example, calling userEvent.click(checkbox) does more than just dispatch a click event; it handles the state changes and side effects that a real browser would perform when a checkbox is clicked.
Key Principle:
The more your tests resemble the way your software is used, the more confidence they can give you.