aboutsummaryrefslogtreecommitdiff
path: root/test/shared/utils/keys.test.js
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2019-02-11 20:19:34 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2019-02-11 20:19:34 +0900
commitfd125422e03cc5c9ee14bd913eea379202e76f9a (patch)
tree801dd1dc096d85b0285f7b4cfe1881238a5dfffe /test/shared/utils/keys.test.js
parent1731bf1f5f9b0327aba3ec71b9b2a395404719d0 (diff)
Enable to bind space key
Diffstat (limited to 'test/shared/utils/keys.test.js')
-rw-r--r--test/shared/utils/keys.test.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/shared/utils/keys.test.js b/test/shared/utils/keys.test.js
index 770b530..b2ad3cb 100644
--- a/test/shared/utils/keys.test.js
+++ b/test/shared/utils/keys.test.js
@@ -35,6 +35,17 @@ describe("keys util", () => {
expect(k.altKey).to.be.false;
expect(k.metaKey).to.be.false;
});
+
+ it('returns from keyboard input Crtl+Space', () => {
+ let k = keys.fromKeyboardEvent({
+ key: ' ', shiftKey: false, ctrlKey: true, altKey: false, metaKey: false
+ });
+ expect(k.key).to.equal('Space');
+ expect(k.shiftKey).to.be.false;
+ expect(k.ctrlKey).to.be.true;
+ expect(k.altKey).to.be.false;
+ expect(k.metaKey).to.be.false;
+ });
});
describe('fromMapKey', () => {
@@ -100,6 +111,15 @@ describe("keys util", () => {
expect(key.altKey).to.be.false;
expect(key.metaKey).to.be.false;
});
+
+ it('returns for Ctrl+Esc', () => {
+ let key = keys.fromMapKey('<C-Space>');
+ expect(key.key).to.equal('Space');
+ expect(key.shiftKey).to.be.false;
+ expect(key.ctrlKey).to.be.true;
+ expect(key.altKey).to.be.false;
+ expect(key.metaKey).to.be.false;
+ });
});
describe('fromMapKeys', () => {