[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

@ -14,11 +14,11 @@
"unmockedModulePathPatterns": [
"react"
],
"coverageDirectory":"./coverage",
"collectCoverage": true,
"coveragePathIgnorePatterns": [
"<rootDir>/src/js/filt/filt.js"
]
"coverageDirectory":"./coverage",
"collectCoverage": true,
"coveragePathIgnorePatterns": [
"<rootDir>/src/js/filt/filt.js"
]
},
"dependencies": {
"bootstrap": "^3.3.7",

View File

@ -1,8 +1,7 @@
jest.unmock('../../ducks/settings')
jest.mock('../../utils')
import reduceSettings from '../../ducks/settings'
import * as SettingsActions from '../../ducks/settings'
import reduceSettings, * as SettingsActions from '../../ducks/settings'
describe('setting reducer', () => {
it('should return initial state', () => {
@ -17,7 +16,11 @@ describe('setting reducer', () => {
it('should handle update action', () => {
let action = {type: SettingsActions.UPDATE, data: {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({})
})
})