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