-
Notifications
You must be signed in to change notification settings - Fork 255
Closed
Labels
Description
Occurs in master of @testing-library/user-event version: 11.2.1
Here's an example failing test, not really up to this library's standards but I wanted to get as close to the source as possible.
STR:
- Add the following block to src/__tests__/type.js
const create = () => {
const utils = render(<input aria-label="input" type="email"/>)
const input = utils.getByLabelText('input')
return {
input,
...utils,
}
}
it('types text in email input', async () => {
const { input } = create()
await userEvent.type(input, '[email protected]')
expect(input.value).toBe('[email protected]')
})
- Run test
InvalidStateError
What happened: I wanted to follow up on this comment and reproduce: #307 (comment). Sorry @kentcdodds, the type= was abstracted away and it was pretty silly of me to assume it was text. Seems like I ran into 2 completely different issues now, but hopefully I'm just missing something obvious.
Test fails on InvalidStateError, adding an onChange handler with a console.log(event.target.value) shows that type only enters in the first char before breaking.