parent
541449b1fc
commit
58123210ab
13 changed files with 17 additions and 34 deletions
@ -0,0 +1,4 @@ |
|||||||
|
export default { |
||||||
|
// Settings
|
||||||
|
SETTING_SET_SETTINGS: 'setting.set.settings', |
||||||
|
}; |
@ -1,4 +1,4 @@ |
|||||||
import actions from 'actions'; |
import actions from 'settings/actions'; |
||||||
import messages from 'shared/messages'; |
import messages from 'shared/messages'; |
||||||
import DefaultSettings from 'shared/default-settings'; |
import DefaultSettings from 'shared/default-settings'; |
||||||
|
|
@ -1,4 +1,4 @@ |
|||||||
import * as settingActions from 'actions/setting'; |
import * as settingActions from 'settings/actions/setting'; |
||||||
import { validate } from 'shared/validators/setting'; |
import { validate } from 'shared/validators/setting'; |
||||||
|
|
||||||
export default class SettingComponent { |
export default class SettingComponent { |
@ -1,6 +1,6 @@ |
|||||||
import './settings.scss'; |
import './site.scss'; |
||||||
import SettingComponent from 'components/setting'; |
import SettingComponent from 'settings/components/setting'; |
||||||
import settingReducer from 'reducers/setting'; |
import settingReducer from 'settings/reducers/setting'; |
||||||
import { createStore } from 'store'; |
import { createStore } from 'store'; |
||||||
|
|
||||||
const store = createStore(settingReducer); |
const store = createStore(settingReducer); |
@ -1,4 +1,4 @@ |
|||||||
import actions from 'actions'; |
import actions from 'settings/actions'; |
||||||
|
|
||||||
const defaultState = { |
const defaultState = { |
||||||
settings: {} |
settings: {} |
@ -1,22 +0,0 @@ |
|||||||
import { expect } from "chai"; |
|
||||||
import actions from 'actions'; |
|
||||||
import settingReducer from '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', |
|
||||||
}); |
|
||||||
}); |
|
||||||
}); |
|
Reference in new issue