Fire events the same way the user does. 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. user-event is a companion library for Testing Library that simulates user interactions by dispatching the events that would happen if the interaction took place in a browser. fireEvent dispatches DOM events, whereas user-event simulates full interactions, which may fire multiple events and do additional checks along the way. Testing Library's built-in fireEvent is a lightweight wrapper around the browser's low-level dispatchEvent API, which allows developers to trigger any event on any element. The problem is that the browser usually does more than just trigger one event for one interaction.

Features

  • user-event allows you to describe a user interaction instead of a concrete event
  • Write tests with userEvent
  • We recommend invoking userEvent.setup() before the component is rendered
  • Testing Library's built-in fireEvent is a lightweight wrapper around the browser's low-level dispatchEvent API
  • fireEvent dispatches DOM events
  • It adds visibility and interactability checks along the way and manipulates the DOM

Project Samples

Project Activity

See All Activity >

Categories

Front-Ends

License

MIT License

Follow user-event

user-event Web Site

Other Useful Business Software
Infor M3 ERP Icon
Infor M3 ERP

Enterprise manufacturers and distributors requiring a solution to manage and execute complex processes

Efficiently executing the complex processes of enterprise manufacturers and distributors. Infor M3 is a cloud-based, manufacturing and distribution ERP system that leverages the latest technologies to provide an exceptional user experience and powerful analytics in a multicompany, multicountry, and multisite platform. Infor M3 and related CloudSuite™ industry solutions include industry-leading functionality for the chemical, distribution, equipment, fashion, food and beverage, and industrial manufacturing industries. Staying ahead of the competition means staying agile. Our new capabilities bring improved data-driven insights and streamlined workflows to help you make informed decisions and take quick action.
Learn More
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of user-event!

Additional Project Details

Programming Language

TypeScript

Related Categories

TypeScript Front-Ends

Registered

2022-12-06