diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2018-06-14 15:26:30 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2018-06-14 15:26:30 +0000 |
commit | f2e90bc27ce0a1c70747c9547ac1542631c65905 (patch) | |
tree | 477e5d9a2af65ea43f2f3e5ba9a34834016c84f1 /spec/javascripts/ide/stores | |
parent | 3ec72f517a335d962cf5313c29f38e03b40f3b3e (diff) | |
parent | cf22366d79e2a3a332de3d7729c14dcffe45cd98 (diff) | |
download | gitlab-ce-f2e90bc27ce0a1c70747c9547ac1542631c65905.tar.gz |
Merge branch 'ide-pipeline-reset-state' into 'master'
Resets state correctly when switching to merge request in IDE
Closes #47763
See merge request gitlab-org/gitlab-ce!19707
Diffstat (limited to 'spec/javascripts/ide/stores')
-rw-r--r-- | spec/javascripts/ide/stores/modules/merge_requests/actions_spec.js | 13 | ||||
-rw-r--r-- | spec/javascripts/ide/stores/modules/pipelines/actions_spec.js | 17 |
2 files changed, 24 insertions, 6 deletions
diff --git a/spec/javascripts/ide/stores/modules/merge_requests/actions_spec.js b/spec/javascripts/ide/stores/modules/merge_requests/actions_spec.js index 03ec08d05c3..fa4c18931e5 100644 --- a/spec/javascripts/ide/stores/modules/merge_requests/actions_spec.js +++ b/spec/javascripts/ide/stores/modules/merge_requests/actions_spec.js @@ -208,18 +208,19 @@ describe('IDE merge requests actions', () => { expect(commit.calls.argsFor(1)).toEqual(['SET_CURRENT_MERGE_REQUEST', '1', { root: true }]); expect(commit.calls.argsFor(2)).toEqual(['RESET_OPEN_FILES', null, { root: true }]); - expect(dispatch.calls.argsFor(0)).toEqual([ - 'pipelines/resetLatestPipeline', + expect(dispatch.calls.argsFor(0)).toEqual(['setCurrentBranchId', '', { root: true }]); + expect(dispatch.calls.argsFor(1)).toEqual([ + 'pipelines/stopPipelinePolling', null, { root: true }, ]); - expect(dispatch.calls.argsFor(1)).toEqual(['setCurrentBranchId', '', { root: true }]); - expect(dispatch.calls.argsFor(2)).toEqual([ - 'pipelines/stopPipelinePolling', + expect(dispatch.calls.argsFor(2)).toEqual(['setRightPane', null, { root: true }]); + expect(dispatch.calls.argsFor(3)).toEqual([ + 'pipelines/resetLatestPipeline', null, { root: true }, ]); - expect(dispatch.calls.argsFor(3)).toEqual([ + expect(dispatch.calls.argsFor(4)).toEqual([ 'pipelines/clearEtagPoll', null, { root: true }, diff --git a/spec/javascripts/ide/stores/modules/pipelines/actions_spec.js b/spec/javascripts/ide/stores/modules/pipelines/actions_spec.js index f2f8e780cd1..f47e69d6e5b 100644 --- a/spec/javascripts/ide/stores/modules/pipelines/actions_spec.js +++ b/spec/javascripts/ide/stores/modules/pipelines/actions_spec.js @@ -18,6 +18,7 @@ import actions, { receiveJobTraceError, receiveJobTraceSuccess, fetchJobTrace, + resetLatestPipeline, } from '~/ide/stores/modules/pipelines/actions'; import state from '~/ide/stores/modules/pipelines/state'; import * as types from '~/ide/stores/modules/pipelines/mutation_types'; @@ -416,4 +417,20 @@ describe('IDE pipelines actions', () => { }); }); }); + + describe('resetLatestPipeline', () => { + it('commits reset mutations', done => { + testAction( + resetLatestPipeline, + null, + mockedState, + [ + { type: types.RECEIVE_LASTEST_PIPELINE_SUCCESS, payload: null }, + { type: types.SET_DETAIL_JOB, payload: null }, + ], + [], + done, + ); + }); + }); }); |