Skip to content

Commit

Permalink
test: add test for backspace on input[type=email]
Browse files Browse the repository at this point in the history
  • Loading branch information
kentcdodds committed Jun 8, 2020
1 parent 0cd759f commit c966278
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/__tests__/type-modifiers.js
Expand Up @@ -117,6 +117,14 @@ test('{backspace} deletes the selected range', async () => {
`)
})

test('{backspace} on an input type that does not support selection ranges', async () => {
const {element} = setup(<input type="email" defaultValue="yo@example.com" />)
// note: you cannot even call setSelectionRange on these kinds of elements...
await userEvent.type(element, '{backspace}')
// removed "m"
expect(element).toHaveValue('yo@example.co')
})

test('{alt}a{/alt}', async () => {
const {element: input, getEventCalls} = setup(<input />)

Expand Down

0 comments on commit c966278

Please sign in to comment.