From d886d7de290b6fee00c55c5487416048f3de4bf2 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 8 Oct 2017 14:57:27 +0900 Subject: move background --- test/settings/reducers/setting.test.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test/settings/reducers/setting.test.js (limited to 'test/settings') diff --git a/test/settings/reducers/setting.test.js b/test/settings/reducers/setting.test.js new file mode 100644 index 0000000..0e84247 --- /dev/null +++ b/test/settings/reducers/setting.test.js @@ -0,0 +1,22 @@ +import { expect } from "chai"; +import actions from 'settings/actions'; +import settingReducer from 'settings/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