Chatwoot/app/javascript/shared/helpers/specs/KeyboardHelpers.spec.js

22 lines
555 B
JavaScript
Raw Permalink Normal View History

import { isEnter, isEscape, hasPressedShift } from '../KeyboardHelpers';
describe('#KeyboardHelpers', () => {
describe('#isEnter', () => {
it('return correct values', () => {
expect(isEnter({ keyCode: 13 })).toEqual(true);
});
});
describe('#isEscape', () => {
it('return correct values', () => {
expect(isEscape({ keyCode: 27 })).toEqual(true);
});
});
describe('#hasPressedShift', () => {
it('return correct values', () => {
expect(hasPressedShift({ shiftKey: true })).toEqual(true);
});
});
});