separate setting actions and reducers
This commit is contained in:
parent
d23c190cad
commit
6083e70ea0
9 changed files with 96 additions and 16 deletions
19
test/background/reducers/setting.test.js
Normal file
19
test/background/reducers/setting.test.js
Normal 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 });
|
||||
});
|
||||
});
|
Reference in a new issue