setting as redux

This commit is contained in:
Shin'ya Ueoka 2017-10-01 10:59:47 +09:00
parent 709fa95aa3
commit 61806a4e7f
6 changed files with 112 additions and 19 deletions

View file

@ -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',
});
});
});