From a74a8b537e8a82f1af63667fd73869b83d8b7d0d Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 1 Oct 2017 17:17:20 +0900 Subject: BackgroundInputComponent --- test/background/keys.test.js | 31 ------------------------------- test/shared/keys.test.js | 31 +++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 31 deletions(-) delete mode 100644 test/background/keys.test.js create mode 100644 test/shared/keys.test.js (limited to 'test') diff --git a/test/background/keys.test.js b/test/background/keys.test.js deleted file mode 100644 index 2cb9a3a..0000000 --- a/test/background/keys.test.js +++ /dev/null @@ -1,31 +0,0 @@ -import { expect } from "chai"; -import * as keys from '../../src/background/keys'; - -describe("keys", () => { - const KEYMAP = { - 'gGG': [], - 'gg': { type: 'scroll.top' }, - }; - - const g = 'g'.charCodeAt(0); - const G = 'G'.charCodeAt(0); - const x = 'x'.charCodeAt(0); - - describe('#asKeymapChars', () => { - let keySequence = [ - { code: g }, - { code: x, ctrl: true }, - { code: G } - ]; - expect(keys.asKeymapChars(keySequence)).to.equal('gG'); - }); - - describe('#asCaretChars', () => { - let keySequence = [ - { code: g }, - { code: x, ctrl: true }, - { code: G } - ]; - expect(keys.asCaretChars(keySequence)).to.equal('g^XG'); - }); -}); diff --git a/test/shared/keys.test.js b/test/shared/keys.test.js new file mode 100644 index 0000000..53c953d --- /dev/null +++ b/test/shared/keys.test.js @@ -0,0 +1,31 @@ +import { expect } from "chai"; +import * as keys from '../../src/shared/keys'; + +describe("keys", () => { + const KEYMAP = { + 'gGG': [], + 'gg': { type: 'scroll.top' }, + }; + + const g = 'g'.charCodeAt(0); + const G = 'G'.charCodeAt(0); + const x = 'x'.charCodeAt(0); + + describe('#asKeymapChars', () => { + let keySequence = [ + { code: g }, + { code: x, ctrl: true }, + { code: G } + ]; + expect(keys.asKeymapChars(keySequence)).to.equal('gG'); + }); + + describe('#asCaretChars', () => { + let keySequence = [ + { code: g }, + { code: x, ctrl: true }, + { code: G } + ]; + expect(keys.asCaretChars(keySequence)).to.equal('g^XG'); + }); +}); -- cgit v1.2.3