aboutsummaryrefslogtreecommitdiff
path: root/test/reducers
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2017-10-01 12:25:49 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2017-10-01 12:25:49 +0900
commit1b2554adee528da1078ad39694a3f8264c639821 (patch)
tree0fcacdad33a51cf7611af77e601443eb827c2498 /test/reducers
parent709fa95aa383b75e88fb12512f772ea55d757b06 (diff)
parent8c9051076f7782b898ab2f848b9afe4a694c3065 (diff)
Merge branch 'settings-validation'
Diffstat (limited to 'test/reducers')
-rw-r--r--test/reducers/setting.test.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/reducers/setting.test.js b/test/reducers/setting.test.js
new file mode 100644
index 0000000..7261be6
--- /dev/null
+++ b/test/reducers/setting.test.js
@@ -0,0 +1,22 @@
+import { expect } from "chai";
+import actions from '../../src/actions';
+import settingReducer from '../../src/reducers/setting';
+
+describe("setting reducer", () => {
+ it('return the initial state', () => {
+ let state = settingReducer(undefined, {});
+ expect(state).to.have.deep.property('settings', {});
+ });
+
+ it('return next state for SETTING_SET_SETTINGS', () => {
+ let action = {
+ type: actions.SETTING_SET_SETTINGS,
+ settings: { value1: 'hello', value2: 'world' },
+ };
+ let state = settingReducer(undefined, action);
+ expect(state).to.have.deep.property('settings', {
+ value1: 'hello',
+ value2: 'world',
+ });
+ });
+});