From 9a604b5cfe8bc8af2d3a087372131ab50788e802 Mon Sep 17 00:00:00 2001 From: Matthew Shao Date: Sun, 26 Mar 2017 21:58:47 +0800 Subject: [PATCH] [web] Minor fixes for the test. --- web/package.json | 10 +++++----- web/src/js/__tests__/ducks/settingsSpec.js | 7 +++++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/web/package.json b/web/package.json index a1bd6561a..90ec031ba 100644 --- a/web/package.json +++ b/web/package.json @@ -14,11 +14,11 @@ "unmockedModulePathPatterns": [ "react" ], - "coverageDirectory":"./coverage", - "collectCoverage": true, - "coveragePathIgnorePatterns": [ - "/src/js/filt/filt.js" - ] + "coverageDirectory":"./coverage", + "collectCoverage": true, + "coveragePathIgnorePatterns": [ + "/src/js/filt/filt.js" + ] }, "dependencies": { "bootstrap": "^3.3.7", diff --git a/web/src/js/__tests__/ducks/settingsSpec.js b/web/src/js/__tests__/ducks/settingsSpec.js index 325cc8e26..cb9df9189 100644 --- a/web/src/js/__tests__/ducks/settingsSpec.js +++ b/web/src/js/__tests__/ducks/settingsSpec.js @@ -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({}) }) })