diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-10-22 17:45:16 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-10-22 20:14:38 +0900 |
commit | c6eb5553d0477f96b5edd48012b4c4ab342f026c (patch) | |
tree | c782e23fab00da0dc0106a70a50813fee7acec72 /test/content/reducers/setting.test.js | |
parent | 7639e99b755e372712dca36e077a85d9a025cd9f (diff) |
add setting actions in content
Diffstat (limited to 'test/content/reducers/setting.test.js')
-rw-r--r-- | test/content/reducers/setting.test.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/content/reducers/setting.test.js b/test/content/reducers/setting.test.js new file mode 100644 index 0000000..50d1cf0 --- /dev/null +++ b/test/content/reducers/setting.test.js @@ -0,0 +1,18 @@ +import { expect } from "chai"; +import actions from 'content/actions'; +import settingReducer from 'content/reducers/setting'; + +describe("content setting reducer", () => { + it('return the initial state', () => { + let state = settingReducer(undefined, {}); + expect(state).to.deep.equal({}); + }); + + it('return next state for SETTING_SET', () => { + let newSettings = { red: 'apple', yellow: 'banana' }; + let action = { type: actions.SETTING_SET, value: newSettings }; + let state = settingReducer(undefined, action); + expect(state).to.deep.equal(newSettings); + expect(state).not.to.equal(newSettings); // assert deep copy + }); +}); |