From 3133d506d115fc877165b22e30cf1418420d2ca3 Mon Sep 17 00:00:00 2001 From: Adam Berecz Date: Fri, 18 Nov 2022 14:56:21 +0100 Subject: [PATCH] test: IME enter test --- tests/unit/composables/useKeyboard.spec.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/unit/composables/useKeyboard.spec.js b/tests/unit/composables/useKeyboard.spec.js index 68bc2d3..0c680b5 100644 --- a/tests/unit/composables/useKeyboard.spec.js +++ b/tests/unit/composables/useKeyboard.spec.js @@ -104,6 +104,23 @@ describe('useKeyboard', () => { expect(preventMock).toHaveBeenCalled() }) + it('should prevent on IME enter', async () => { + let select = createSelect({ + value: 1, + options: [1,2,3], + }) + + let preventMock = jest.fn() + + select.vm.handleKeydown({ + preventDefault: preventMock, + key: 'Enter', + keyCode: 229 + }) + + expect(preventMock).toHaveBeenCalled() + }) + it('should remove last tag if focused on enter', async () => { let select = createSelect({ mode: 'tags',