Welcome to the React Testing Library Course repository! This repository is designed to help you build a solid foundation in testing React components using React Testing Library.
This repository consists of two main sections:
In the Course-Tasks
folder, you will find three tasks aimed at building your skills step by step, after you finish tasks send proof of completion for all tasks with test coverage(you need 100% to pass)
Description: Write tests using various selectors and queries (getBy
, queryBy
, findBy
, etc.) to interact with a simple Todo List component. Additionally, use screen.debug()
to inspect the DOM during testing.
Description: Write tests that simulate various user interactions, such as button clicks, form input changes, and mouse events, verifying that the component's state and behavior update correctly.
Description: Write tests for a login component to verify user authentication, including input handling, API calls, and redirects. Additionally, test a protected component to ensure proper redirection for unauthenticated users.
Each task includes detailed instructions and examples to guide you through the process of writing tests for React components.
In the Capstone-React-Testing-Library
folder, you will find the Capstone Project. This project is a comprehensive, real-world example designed to test your understanding of the concepts you've learned throughout the course. The capstone project will require you to apply all the testing techniques and best practices covered in the tasks.
- Fork this repository to your GitHub account.
- Clone your forked repository to your local machine
- Navigate to the
Course-Tasks
folder to complete the tasks. - Send proof of completion for tasks, there should be all test passed and 100% of coverage
- Once you're comfortable with the tasks, move on to the
Capstone-React-Testing-Library
folder to tackle the capstone project. - Follow the instructions in each folder's
README
for more detailed guidance.
- Basic understanding of React
- Familiarity with JavaScript ES6+
- Node.js installed on your machine
- React Testing Library installed as a dependency
- Clone the repository:
git clone https://github.com/yourusername/react-testing-library-course.git
- Install dependencies:
npm install
- Start working through the tasks in the
Course-Tasks
folder or jump to the capstone project.
Happy testing!