emit mapped keys from input-component

This commit is contained in:
Shin'ya Ueoka 2017-10-21 11:06:58 +09:00
parent c2a663a64d
commit 214a5103f3
6 changed files with 95 additions and 21 deletions

View file

@ -5,16 +5,10 @@ import * as inputActions from 'content/actions/input';
describe("input actions", () => {
describe("keyPress", () => {
it('create INPUT_KEY_PRESS action', () => {
let action = inputActions.keyPress('a', false);
let action = inputActions.keyPress('a');
expect(action.type).to.equal(actions.INPUT_KEY_PRESS);
expect(action.key).to.equal('a');
});
it('create INPUT_KEY_PRESS action from key with ctrl', () => {
let action = inputActions.keyPress('b', true);
expect(action.type).to.equal(actions.INPUT_KEY_PRESS);
expect(action.key).to.equal('<C-B>');
});
});
describe("clearKeys", () => {