From c96627832bf2a971f465c82177b280841db171a7 Mon Sep 17 00:00:00 2001 From: "Kent C. Dodds" Date: Mon, 8 Jun 2020 12:05:05 -0600 Subject: [PATCH] test: add test for backspace on input[type=email] --- src/__tests__/type-modifiers.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/__tests__/type-modifiers.js b/src/__tests__/type-modifiers.js index f398ea99f..be1b3deed 100644 --- a/src/__tests__/type-modifiers.js +++ b/src/__tests__/type-modifiers.js @@ -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() + // 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()