BackgroundInputComponent

This commit is contained in:
Shin'ya Ueoka 2017-10-01 17:17:20 +09:00
parent 825bb63476
commit a74a8b537e
4 changed files with 60 additions and 51 deletions

View file

@ -1,31 +0,0 @@
import { expect } from "chai";
import * as keys from '../../src/background/keys';
describe("keys", () => {
const KEYMAP = {
'g<C-X>GG': [],
'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('g<C-X>G');
});
describe('#asCaretChars', () => {
let keySequence = [
{ code: g },
{ code: x, ctrl: true },
{ code: G }
];
expect(keys.asCaretChars(keySequence)).to.equal('g^XG');
});
});