Skip to content
masterclass Buddy

React Testing Library · Matcher

toBeDisabled

Test React behavior by rendering a component, simulating a user action, waiting for async UI changes, and checking the result with accessible queries and jest-dom matchers.

Last updated

Syntax

test(name, async () => { render(ui); await userEvent.click(element); await screen.findByRole(role); expect(element).toHaveTextContent(text) })

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • render
  • screen
  • userEvent
  • findByRole
  • fireEvent
  • toHaveTextContent
  • toBeDisabled
  • setupServer

Source: Example | Testing Library. Checked 2026-11-03.