Testing · Junior · Question 54 of 78

What is wrong with this test?

const { container } = render(<Counter />);
container.querySelector(".increment").click();
expect(container.querySelector(".value").textContent).toBe("1");

Explanation

Renaming a class breaks the test although the user sees no change.

Further reading

Problem with a question

Testing · Junior · question 54

Test yourself

Take the Testing · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz