1 import { KeyboardKey } from '../../lib/interfaces';
2 import { isValidShortcut } from '../../lib/shortcuts/helpers';
4 describe('isValidShortcut - Validate keyboard shortcut', () => {
11 const aKeyWithShift = {
17 const aKeyWithMeta = {
24 it('Should validate a single key shortcut', () => {
25 expect(isValidShortcut([KeyboardKey.A], aKey)).toBe(true);
26 expect(isValidShortcut([KeyboardKey.A], aKeyWithShift)).toBe(false);
27 expect(isValidShortcut([KeyboardKey.A], aKeyWithMeta)).toBe(false);
30 it('Should validate combined keys shortcut', () => {
31 expect(isValidShortcut([KeyboardKey.A, 'Shift'], aKeyWithShift)).toBe(true);
32 expect(isValidShortcut([KeyboardKey.A, 'Shift'], aKeyWithMeta)).toBe(false);
33 expect(isValidShortcut([KeyboardKey.A, 'Shift'], aKey)).toBe(false);