Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2018-06-11 17:18:43 +0300
committerAlessio Caiazza <acaiazza@gitlab.com>2018-06-12 12:40:20 +0300
commit49ed712f4cd6a86e31f6c73e09af5f0d97cfa52b (patch)
tree056538ab2f5ea5bd7a4407d6f60721224dc2050a /spec
parenta73f71db0ffd0742ed6236e2ab76f8b93cec6b0d (diff)
Merge branch 'ide-etag-polling' into 'master'
Fix IDE pipelines eTagPoll not stopping Closes #47678 See merge request gitlab-org/gitlab-ce!19636
Diffstat (limited to 'spec')
-rw-r--r--spec/javascripts/ide/components/pipelines/list_spec.js11
-rw-r--r--spec/javascripts/ide/stores/modules/merge_requests/actions_spec.js47
2 files changed, 36 insertions, 22 deletions
diff --git a/spec/javascripts/ide/components/pipelines/list_spec.js b/spec/javascripts/ide/components/pipelines/list_spec.js
index 2bb5aa08c3b..68487733cb9 100644
--- a/spec/javascripts/ide/components/pipelines/list_spec.js
+++ b/spec/javascripts/ide/components/pipelines/list_spec.js
@@ -45,12 +45,15 @@ describe('IDE pipelines list', () => {
setTimeout(done);
});
- afterEach(() => {
- vm.$store.dispatch('pipelines/stopPipelinePolling');
- vm.$store.dispatch('pipelines/clearEtagPoll');
-
+ afterEach(done => {
vm.$destroy();
mock.restore();
+
+ vm.$store
+ .dispatch('pipelines/stopPipelinePolling')
+ .then(() => vm.$store.dispatch('pipelines/clearEtagPoll'))
+ .then(done)
+ .catch(done.fail);
});
it('renders pipeline data', () => {
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 d178a44b76a..03ec08d05c3 100644
--- a/spec/javascripts/ide/stores/modules/merge_requests/actions_spec.js
+++ b/spec/javascripts/ide/stores/modules/merge_requests/actions_spec.js
@@ -199,28 +199,39 @@ describe('IDE merge requests actions', () => {
});
it('commits reset mutations and actions', done => {
- testAction(
- openMergeRequest,
- { projectPath: 'gitlab-org/gitlab-ce', id: '1' },
- mockedState,
- [
- { type: 'CLEAR_PROJECTS' },
- { type: 'SET_CURRENT_MERGE_REQUEST', payload: '1' },
- { type: 'RESET_OPEN_FILES' },
- ],
- [
- { type: 'pipelines/stopPipelinePolling' },
- { type: 'pipelines/clearEtagPoll' },
- { type: 'pipelines/resetLatestPipeline' },
- { type: 'setCurrentBranchId', payload: '' },
- ],
- done,
- );
+ const commit = jasmine.createSpy();
+ const dispatch = jasmine.createSpy().and.returnValue(Promise.resolve());
+ openMergeRequest({ commit, dispatch }, { projectPath: 'gitlab-org/gitlab-ce', id: '1' });
+
+ setTimeout(() => {
+ expect(commit.calls.argsFor(0)).toEqual(['CLEAR_PROJECTS', null, { root: true }]);
+ 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',
+ null,
+ { root: true },
+ ]);
+ expect(dispatch.calls.argsFor(1)).toEqual(['setCurrentBranchId', '', { root: true }]);
+ 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', () => {
openMergeRequest(
- { commit() {}, dispatch() {} },
+ { commit() {}, dispatch: () => Promise.resolve() },
{ projectPath: 'gitlab-org/gitlab-ce', id: '1' },
);