-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: no keypress with ctrlKey and altKey
- Loading branch information
1 parent
2b0632a
commit 7a9a0b8
Showing
3 changed files
with
42 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import userEvent from '../../index' | ||
import {setup} from '../helpers/utils' | ||
|
||
test('no character input if `altKey` or `ctrlKey` is pressed', () => { | ||
const {element, eventWasFired} = setup(`<input/>`) | ||
;(element as HTMLInputElement).focus() | ||
|
||
userEvent.keyboard('[ControlLeft>]g') | ||
|
||
expect(eventWasFired('keypress')).toBe(false) | ||
expect(eventWasFired('input')).toBe(false) | ||
|
||
userEvent.keyboard('[AltLeft>]g') | ||
|
||
expect(eventWasFired('keypress')).toBe(false) | ||
expect(eventWasFired('input')).toBe(false) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters