aboutsummaryrefslogtreecommitdiff
path: root/test/console/reducers/console.test.js
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2017-11-11 11:18:01 +0000
committerGitHub <noreply@github.com>2017-11-11 11:18:01 +0000
commit0630c8f56664ac48f4cf8799dc1d88a6388957a6 (patch)
treed9160c76f4c3435b0859669f1254b12eb92d183f /test/console/reducers/console.test.js
parent86b534b1e1de03d51efb9f28cd32296d037f07fc (diff)
parentfe8a9283172e43e29480c4293c34565859c04c32 (diff)
Merge pull request #142 from ueokande/find-mode
[WIP] Find mode
Diffstat (limited to 'test/console/reducers/console.test.js')
-rw-r--r--test/console/reducers/console.test.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/test/console/reducers/console.test.js b/test/console/reducers/console.test.js
index 4f85e55..438d513 100644
--- a/test/console/reducers/console.test.js
+++ b/test/console/reducers/console.test.js
@@ -7,7 +7,7 @@ describe("console reducer", () => {
let state = reducer(undefined, {});
expect(state).to.have.property('mode', '');
expect(state).to.have.property('messageText', '');
- expect(state).to.have.property('commandText', '');
+ expect(state).to.have.property('consoleText', '');
expect(state).to.have.deep.property('completions', []);
expect(state).to.have.property('groupSelection', -1);
expect(state).to.have.property('itemSelection', -1);
@@ -17,7 +17,7 @@ describe("console reducer", () => {
let action = { type: actions.CONSOLE_SHOW_COMMAND, text: 'open ' };
let state = reducer({}, action);
expect(state).to.have.property('mode', 'command');
- expect(state).to.have.property('commandText', 'open ');
+ expect(state).to.have.property('consoleText', 'open ');
});
it('return next state for CONSOLE_SHOW_INFO', () => {
@@ -43,6 +43,16 @@ describe("console reducer", () => {
expect(state).to.have.property('mode', 'error');
});
+ it('return next state for CONSOLE_SET_CONSOLE_TEXT', () => {
+ let action = {
+ type: actions.CONSOLE_SET_CONSOLE_TEXT,
+ consoleText: 'hello world'
+ }
+ let state = reducer({}, action)
+
+ expect(state).to.have.property('consoleText', 'hello world');
+ });
+
it ('return next state for CONSOLE_SET_COMPLETIONS', () => {
let state = {
groupSelection: 0,