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...

Ready to try running tests for this lesson?