25 lines
1.3 KiB
JavaScript
25 lines
1.3 KiB
JavaScript
|
define(["require", "exports", "./keyboard", "./KeyCodes"], function (require, exports, keyboard_1, KeyCodes_1) {
|
||
|
"use strict";
|
||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
describe('isDirectionalKeyCode', function () {
|
||
|
it('can return the expected value', function () {
|
||
|
expect((0, keyboard_1.isDirectionalKeyCode)(KeyCodes_1.KeyCodes.up)).toBe(true);
|
||
|
expect((0, keyboard_1.isDirectionalKeyCode)(KeyCodes_1.KeyCodes.enter)).toBe(false);
|
||
|
});
|
||
|
});
|
||
|
describe('addDirectionalKeyCode', function () {
|
||
|
it('can register addition of custom keycodes', function () {
|
||
|
expect((0, keyboard_1.isDirectionalKeyCode)(KeyCodes_1.KeyCodes.f6)).toBe(false);
|
||
|
(0, keyboard_1.addDirectionalKeyCode)(KeyCodes_1.KeyCodes.f6);
|
||
|
expect((0, keyboard_1.isDirectionalKeyCode)(KeyCodes_1.KeyCodes.f6)).toBe(true);
|
||
|
});
|
||
|
});
|
||
|
describe('removeDirectionalKeyCode', function () {
|
||
|
it('can remove a custom keycode', function () {
|
||
|
expect((0, keyboard_1.isDirectionalKeyCode)(KeyCodes_1.KeyCodes.up)).toBe(true);
|
||
|
(0, keyboard_1.removeDirectionalKeyCode)(KeyCodes_1.KeyCodes.up);
|
||
|
expect((0, keyboard_1.isDirectionalKeyCode)(KeyCodes_1.KeyCodes.up)).toBe(false);
|
||
|
});
|
||
|
});
|
||
|
});
|
||
|
//# sourceMappingURL=keyboard.test.js.map
|