From 4282dc1ac4053d774b0fe6993ae15222fcfe3b3d Mon Sep 17 00:00:00 2001 From: Matthew Shao Date: Wed, 26 Jul 2017 15:16:23 +0800 Subject: [web] Update tests. --- web/src/js/__tests__/ducks/optionsSpec.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'web/src/js/__tests__/ducks') diff --git a/web/src/js/__tests__/ducks/optionsSpec.js b/web/src/js/__tests__/ducks/optionsSpec.js index 0925fcc1..a0d11f9c 100644 --- a/web/src/js/__tests__/ducks/optionsSpec.js +++ b/web/src/js/__tests__/ducks/optionsSpec.js @@ -49,3 +49,18 @@ describe('sendUpdate', () => { ]) }) }) + +describe('dump', () => { + + it('should dump options', () => { + global.fetch = jest.fn() + store.dispatch(OptionsActions.dump()) + expect(fetch).toBeCalledWith( + '/options/dump?_xsrf=undefined', + { + credentials: "same-origin", + method: "POST" + } + ) + }) +}) -- cgit v1.2.3 From 7e5f424c5013a591e71f570b003e34f8e6788869 Mon Sep 17 00:00:00 2001 From: Matthew Shao Date: Thu, 27 Jul 2017 11:22:02 +0800 Subject: [web] Minor fix for frontend and tests. --- web/src/js/__tests__/ducks/optionsSpec.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'web/src/js/__tests__/ducks') diff --git a/web/src/js/__tests__/ducks/optionsSpec.js b/web/src/js/__tests__/ducks/optionsSpec.js index a0d11f9c..9178c14e 100644 --- a/web/src/js/__tests__/ducks/optionsSpec.js +++ b/web/src/js/__tests__/ducks/optionsSpec.js @@ -50,13 +50,13 @@ describe('sendUpdate', () => { }) }) -describe('dump', () => { +describe('save', () => { it('should dump options', () => { global.fetch = jest.fn() - store.dispatch(OptionsActions.dump()) + store.dispatch(OptionsActions.save()) expect(fetch).toBeCalledWith( - '/options/dump?_xsrf=undefined', + '/options/save?_xsrf=undefined', { credentials: "same-origin", method: "POST" -- cgit v1.2.3