summaryrefslogtreecommitdiff
path: root/spec/frontend/projects/commit/store/actions_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/projects/commit/store/actions_spec.js')
-rw-r--r--spec/frontend/projects/commit/store/actions_spec.js16
1 files changed, 6 insertions, 10 deletions
diff --git a/spec/frontend/projects/commit/store/actions_spec.js b/spec/frontend/projects/commit/store/actions_spec.js
index 305257c9ca5..56dffcbd48e 100644
--- a/spec/frontend/projects/commit/store/actions_spec.js
+++ b/spec/frontend/projects/commit/store/actions_spec.js
@@ -44,12 +44,12 @@ describe('Commit form modal store actions', () => {
});
describe('fetchBranches', () => {
- it('dispatch correct actions on fetchBranches', (done) => {
+ it('dispatch correct actions on fetchBranches', () => {
jest
.spyOn(axios, 'get')
.mockImplementation(() => Promise.resolve({ data: { Branches: mockData.mockBranches } }));
- testAction(
+ return testAction(
actions.fetchBranches,
{},
state,
@@ -60,19 +60,15 @@ describe('Commit form modal store actions', () => {
},
],
[{ type: 'requestBranches' }],
- () => {
- done();
- },
);
});
- it('should show flash error and set error in state on fetchBranches failure', (done) => {
+ it('should show flash error and set error in state on fetchBranches failure', async () => {
jest.spyOn(axios, 'get').mockRejectedValue();
- testAction(actions.fetchBranches, {}, state, [], [{ type: 'requestBranches' }], () => {
- expect(createFlash).toHaveBeenCalledWith({ message: PROJECT_BRANCHES_ERROR });
- done();
- });
+ await testAction(actions.fetchBranches, {}, state, [], [{ type: 'requestBranches' }]);
+
+ expect(createFlash).toHaveBeenCalledWith({ message: PROJECT_BRANCHES_ERROR });
});
});