You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.1 KiB
41 lines
1.1 KiB
import settingsReducer, {
|
|
SET_SETTINGS_OPEN,
|
|
SET_ACTIVE_SUBMENU,
|
|
DISABLE_SUBMENU
|
|
} from 'reducers/settings'
|
|
|
|
describe('reducers', () => {
|
|
describe('settingsReducer', () => {
|
|
it('should handle initial state', () => {
|
|
expect(settingsReducer(undefined, {})).toMatchSnapshot()
|
|
})
|
|
|
|
it('should have SET_SETTINGS_OPEN', () => {
|
|
expect(SET_SETTINGS_OPEN).toEqual('SET_SETTINGS_OPEN')
|
|
})
|
|
|
|
it('should have SET_ACTIVE_SUBMENU', () => {
|
|
expect(SET_ACTIVE_SUBMENU).toEqual('SET_ACTIVE_SUBMENU')
|
|
})
|
|
|
|
it('should have DISABLE_SUBMENU', () => {
|
|
expect(DISABLE_SUBMENU).toEqual('DISABLE_SUBMENU')
|
|
})
|
|
|
|
it('should correctly setSettingsOpen', () => {
|
|
expect(
|
|
settingsReducer(undefined, { type: SET_SETTINGS_OPEN, settingsOpen: true })
|
|
).toMatchSnapshot()
|
|
})
|
|
|
|
it('should correctly setActiveSubmenu', () => {
|
|
expect(
|
|
settingsReducer(undefined, { type: SET_ACTIVE_SUBMENU, activeSubMenu: true })
|
|
).toMatchSnapshot()
|
|
})
|
|
|
|
it('should correctly disableSubmenu', () => {
|
|
expect(settingsReducer(undefined, { type: DISABLE_SUBMENU })).toMatchSnapshot()
|
|
})
|
|
})
|
|
})
|
|
|