Skip to content

Instantly share code, notes, and snippets.

@bengrunfeld
Created May 11, 2021 11:53
Show Gist options
  • Save bengrunfeld/003c2fbd8abfcf574bdc0b0a32fbf5b4 to your computer and use it in GitHub Desktop.
Save bengrunfeld/003c2fbd8abfcf574bdc0b0a32fbf5b4 to your computer and use it in GitHub Desktop.
React Testing Library - getByRole
import { render, screen } from '@testing-library/react'
import { App } from './App'
test('Render the App component', () => {
render(<App />)
expect(screen.getByRole('button')).toBeInTheDocument()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment