Lesson:DOM Matchers - Element State & Visibility

You often need to show an element's state to users (for example, if it is hidden or visible).

And of course we can easily test that with the DOM matchers provided by React Testing Library.

Lesson covers:

toBeDisabled, toBeEnabled, toBeInTheDocument, toBePartiallyPressed, toBePressed, toBeVisible, toHaveFocus

Loading full lesson content & code...

Share this lessonTweet (X) it

Invite a teammate to learn with you by sharing this lesson or dropping the link in your team chat.

Ready to try running tests for this lesson?