A fork of https://github.com/ueokande/vim-vixen
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
695 B
32 lines
695 B
7 years ago
|
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');
|
||
|
});
|
||
|
});
|