1. 13
    Get Elements With an Associated Test id Attribute Using the byTestId Query
    50s

Get Elements With an Associated Test id Attribute Using the byTestId Query

Share this video with your friends

Send Tweet

Sometimes, none of the queries above will work for you. Instead of focusing on implementation details, the React Testing Library gives you a controlled way of doing so: using data-testid!

In this lesson, we are going to look at the one query that belongs to the TestId family and should be used as a last resort only: the byTestId query.