What you will learn
In this section, we will discuss the basics of testing React components using Jest and ReactDOM:
- How to render a React application for testing
- How to simulate user events such as clicks
- How to test a stateful class component
- How to test a component that uses
useState
hook - How to test a component that uses
useEffect
hook - How to make an assertion on DOM elements status such as being
disabled
- How to check that a DOM element is present (or not) in the DOM
- How to register custom matchers globally using Jest setup files
- How to check that a DOM element is visible (or not) to the final user
Author: Jaga Santagostino