diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-09-11 21:45:48 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-09-11 21:45:48 +0900 |
commit | b2cddcd69b4ae06770d66808624fc43f3dcbcb0e (patch) | |
tree | 548eb65f678cfa1dca36773f01c635ec6c0e2066 /test/actions/console.test.js | |
parent | 15d39a479aa7f2c4b804bac8c4352dd0a120bc75 (diff) | |
parent | 7bc569eac745b97137e1db8b9271493b3e5c8a20 (diff) |
Merge branch 'message-passing-refactoring'
Diffstat (limited to 'test/actions/console.test.js')
-rw-r--r-- | test/actions/console.test.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/actions/console.test.js b/test/actions/console.test.js new file mode 100644 index 0000000..512ee40 --- /dev/null +++ b/test/actions/console.test.js @@ -0,0 +1,37 @@ +import { expect } from "chai"; +import actions from '../../src/actions'; +import * as consoleActions from '../../src/actions/console'; + +describe("console actions", () => { + describe("showCommand", () => { + it('create CONSOLE_SHOW_COMMAND action', () => { + let action = consoleActions.showCommand('hello'); + expect(action.type).to.equal(actions.CONSOLE_SHOW_COMMAND); + expect(action.text).to.equal('hello'); + }); + }); + + describe("setCompletions", () => { + it('create CONSOLE_SET_COMPLETIONS action', () => { + let action = consoleActions.setCompletions([1,2,3]); + expect(action.type).to.equal(actions.CONSOLE_SET_COMPLETIONS); + expect(action.completions).to.deep.equal([1, 2, 3]); + }); + }); + + describe("showError", () => { + it('create CONSOLE_SHOW_ERROR action', () => { + let action = consoleActions.showError('an error'); + expect(action.type).to.equal(actions.CONSOLE_SHOW_ERROR); + expect(action.text).to.equal('an error'); + }); + }); + + describe("hide", () => { + it('create CONSOLE_HIDE action', () => { + let action = consoleActions.hide(); + expect(action.type).to.equal(actions.CONSOLE_HIDE); + }); + }); +}); + |