From 61806a4e7ff01e8b5fdfdcef0308a2c41fc98778 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 1 Oct 2017 10:59:47 +0900 Subject: setting as redux --- test/reducers/setting.test.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test/reducers/setting.test.js (limited to 'test/reducers/setting.test.js') 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', + }); + }); +}); -- cgit v1.2.3