Skip to content

Instantly share code, notes, and snippets.

@arvinsim
Last active January 4, 2023 01:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arvinsim/87a66fa3dccc396adab1f4c704ec6c84 to your computer and use it in GitHub Desktop.
Save arvinsim/87a66fa3dccc396adab1f4c704ec6c84 to your computer and use it in GitHub Desktop.
Common React Testing Library features
// Setup user events
const user = userEvent.setup()
// Clicking on an element. Using await is important
await user.click(screen.getTextBy('Some button'))
// Output HTML of screen
screen.debug()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment