separate setting actions and reducers

This commit is contained in:
Shin'ya Ueoka 2018-01-08 21:54:16 +09:00
parent d23c190cad
commit 6083e70ea0
9 changed files with 96 additions and 16 deletions

View file

@ -0,0 +1,19 @@
import { expect } from "chai";
import actions from 'background/actions';
import settingReducer from 'background/reducers/setting';
describe("setting reducer", () => {
it('return the initial state', () => {
let state = settingReducer(undefined, {});
expect(state).to.have.deep.property('value', {});
});
it('return next state for SETTING_SET_SETTINGS', () => {
let action = {
type: actions.SETTING_SET_SETTINGS,
value: { key: 123 },
};
let state = settingReducer(undefined, action);
expect(state).to.have.deep.property('value', { key: 123 });
});
});