add hide action for console

This commit is contained in:
Shin'ya Ueoka 2018-03-04 17:57:56 +09:00
parent 0211d7781f
commit 37410b874f
6 changed files with 26 additions and 1 deletions

View file

@ -3,6 +3,12 @@ import actions from 'console/actions';
import * as consoleActions from 'console/actions/console';
describe("console actions", () => {
describe('hide', () => {
it('create CONSOLE_HIDE action', () => {
let action = consoleActions.hide();
expect(action.type).to.equal(actions.CONSOLE_HIDE);
});
});
describe("showCommand", () => {
it('create CONSOLE_SHOW_COMMAND action', () => {
let action = consoleActions.showCommand('hello');

View file

@ -13,6 +13,12 @@ describe("console reducer", () => {
expect(state).to.have.property('itemSelection', -1);
});
it('return next state for CONSOLE_HIDE', () => {
let action = { type: actions.CONSOLE_HIDE };
let state = reducer({ mode: 'error' }, action);
expect(state).to.have.property('mode', '');
})
it('return next state for CONSOLE_SHOW_COMMAND', () => {
let action = { type: actions.CONSOLE_SHOW_COMMAND, text: 'open ' };
let state = reducer({}, action);