Commit d5dae8e5 authored by Phil Hughes's avatar Phil Hughes

fixed specs

parent 7469b58e
...@@ -199,28 +199,39 @@ describe('IDE merge requests actions', () => { ...@@ -199,28 +199,39 @@ describe('IDE merge requests actions', () => {
}); });
it('commits reset mutations and actions', done => { it('commits reset mutations and actions', done => {
testAction( const commit = jasmine.createSpy();
openMergeRequest, const dispatch = jasmine.createSpy().and.returnValue(Promise.resolve());
{ projectPath: 'gitlab-org/gitlab-ce', id: '1' }, openMergeRequest({ commit, dispatch }, { projectPath: 'gitlab-org/gitlab-ce', id: '1' });
mockedState,
[ setTimeout(() => {
{ type: 'CLEAR_PROJECTS' }, expect(commit.calls.argsFor(0)).toEqual(['CLEAR_PROJECTS', null, { root: true }]);
{ type: 'SET_CURRENT_MERGE_REQUEST', payload: '1' }, expect(commit.calls.argsFor(1)).toEqual(['SET_CURRENT_MERGE_REQUEST', '1', { root: true }]);
{ type: 'RESET_OPEN_FILES' }, expect(commit.calls.argsFor(2)).toEqual(['RESET_OPEN_FILES', null, { root: true }]);
],
[ expect(dispatch.calls.argsFor(0)).toEqual([
{ type: 'pipelines/stopPipelinePolling' }, 'pipelines/resetLatestPipeline',
{ type: 'pipelines/clearEtagPoll' }, null,
{ type: 'pipelines/resetLatestPipeline' }, { root: true },
{ type: 'setCurrentBranchId', payload: '' }, ]);
], expect(dispatch.calls.argsFor(1)).toEqual(['setCurrentBranchId', '', { root: true }]);
done, expect(dispatch.calls.argsFor(2)).toEqual([
); 'pipelines/stopPipelinePolling',
null,
{ root: true },
]);
expect(dispatch.calls.argsFor(3)).toEqual([
'pipelines/clearEtagPoll',
null,
{ root: true },
]);
done();
});
}); });
it('pushes new route', () => { it('pushes new route', () => {
openMergeRequest( openMergeRequest(
{ commit() {}, dispatch() {} }, { commit() {}, dispatch: () => Promise.resolve() },
{ projectPath: 'gitlab-org/gitlab-ce', id: '1' }, { projectPath: 'gitlab-org/gitlab-ce', id: '1' },
); );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment