Skip to content

Commit

Permalink
getByTestId doesn't work (#525)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaleSeo committed Dec 22, 2020
1 parent d9b3e4e commit f1ccaad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -149,8 +149,8 @@ import userEvent from '@testing-library/user-event'

test('double click', () => {
const onChange = jest.fn()
render(<input type="checkbox" id="checkbox" onChange={onChange} />)
const checkbox = screen.getByTestId('checkbox')
render(<input type="checkbox" onChange={onChange} />)
const checkbox = screen.getByRole('checkbox')
userEvent.dblClick(checkbox)
expect(onChange).toHaveBeenCalledTimes(2)
expect(checkbox).not.toBeChecked()
Expand Down

0 comments on commit f1ccaad

Please sign in to comment.