[web] Minor fixes for the test.

This commit is contained in:
Matthew Shao 2017-03-26 21:58:47 +08:00
parent 17ac1ff6cb
commit 9a604b5cfe
2 changed files with 10 additions and 7 deletions

View File

@ -1,8 +1,7 @@
jest.unmock('../../ducks/settings') jest.unmock('../../ducks/settings')
jest.mock('../../utils') jest.mock('../../utils')
import reduceSettings from '../../ducks/settings' import reduceSettings, * as SettingsActions from '../../ducks/settings'
import * as SettingsActions from '../../ducks/settings'
describe('setting reducer', () => { describe('setting reducer', () => {
it('should return initial state', () => { it('should return initial state', () => {
@ -17,7 +16,11 @@ describe('setting reducer', () => {
it('should handle update action', () => { it('should handle update action', () => {
let action = {type: SettingsActions.UPDATE, data: {id: 1} } let action = {type: SettingsActions.UPDATE, data: {id: 1} }
expect(reduceSettings(undefined, action)).toEqual({id: 1}) expect(reduceSettings(undefined, action)).toEqual({id: 1})
})
})
describe('setting actions', () => {
it('should be possible to update setting', () => {
expect(reduceSettings(undefined, SettingsActions.update())).toEqual({}) expect(reduceSettings(undefined, SettingsActions.update())).toEqual({})
}) })
}) })