Fixed spec to the correct method
This commit is contained in:
parent
9f1556f195
commit
16d736d43d
1 changed files with 3 additions and 4 deletions
|
@ -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 }],
|
||||
|
|
Loading…
Reference in a new issue