From 16d736d43db68837e94592aed14f5bc38ebc8e00 Mon Sep 17 00:00:00 2001 From: fayazara Date: Thu, 29 Sep 2022 17:10:58 +0530 Subject: [PATCH] Fixed spec to the correct method --- .../dashboard/store/modules/specs/macros/actions.spec.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/javascript/dashboard/store/modules/specs/macros/actions.spec.js b/app/javascript/dashboard/store/modules/specs/macros/actions.spec.js index d46876629..079552ae7 100644 --- a/app/javascript/dashboard/store/modules/specs/macros/actions.spec.js +++ b/app/javascript/dashboard/store/modules/specs/macros/actions.spec.js @@ -30,17 +30,16 @@ describe('#actions', () => { describe('#getMacroById', () => { it('sends correct actions if API is success', async () => { - axios.get.mockResolvedValue({ data: { payload: macrosList } }); - await actions.get({ commit }); + axios.get.mockResolvedValue({ data: { payload: macrosList[0] } }); + await actions.getSingleMacro({ commit }, 22); expect(commit.mock.calls).toEqual([ [types.default.SET_MACROS_UI_FLAG, { isFetching: true }], - [types.default.SET_MACROS, macrosList], [types.default.SET_MACROS_UI_FLAG, { isFetching: false }], ]); }); it('sends correct actions if API is error', async () => { axios.get.mockRejectedValue({ message: 'Incorrect header' }); - await actions.get({ commit }); + await actions.getSingleMacro({ commit }, 22); expect(commit.mock.calls).toEqual([ [types.default.SET_MACROS_UI_FLAG, { isFetching: true }], [types.default.SET_MACROS_UI_FLAG, { isFetching: false }],