What You will learn
In this section we will focus on using react-testin-library. Some of the things you will learn in this section:
- What is
react-testing-library
and why it exists? - Why [we recommend using
react-testing-library
]/why-react-testing-library.md#makes-the-right-the-easy-one) for testing - How to setup
react-testing-library
- How to render a React application for testing using
react-testing-library
- How to use
dom-testing-library
utilities - How to deal with components being added or removed at runtime
- How to simulate user typing in
input
elements without the need ofact
- How to test a custom input component
- How to make a component accessible using a
label
- How to test-drive new features in a component
- How to test validation errors
- How to test components that uses the React Context API
- How to test a component that uses Redux
Author: Jaga Santagostino