Testing · Junior · Question 53 of 78

When is getByTestId appropriate?

Explanation

A user doesn't see data-testid, so this query doesn't check accessibility. Keep it as a last resort.

Further reading

Problem with a question

Testing · Junior · question 53

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