Challenge: Where is the rendered component?

Welcome to this section of HowToTestFrontend.com which gives you test challenges to complete. These challenges are all typical kind of issues you will face when writing tests for your React app.

We also have similar challenges for regular Jest/Vitest (without React) - see here

In this test challenge, you are presented (use the tabs above) with a simple component and three failing tests.

You might spot the error immediately. This is a very easy one to fix.

i
Challenge Mode: This lesson is actually a challenge - you are given a half working test and have to figure out how to get it working correctly.

You can use our courses to learn how to solve this challenge - there are courses on everything from basic Jest/Vitest fundamentals, down to how to test frontend code (using React Testing Library).

Loading full lesson content & code...

Ready to try running tests for this lesson?