summaryrefslogtreecommitdiff
path: root/spec/javascripts
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2018-05-16 12:24:59 +0100
committerFilipa Lacerda <filipa@gitlab.com>2018-05-16 13:20:29 +0100
commitf4aced6f6d7419f17fcaeacaab623edc8205baed (patch)
tree7d78639f78b5483b5fe219e6b8562aa9b7cec080 /spec/javascripts
parenta55da0a95a7d38caed4070006f611e9eaea3e387 (diff)
downloadgitlab-ce-f4aced6f6d7419f17fcaeacaab623edc8205baed.tar.gz
Reloads pipeline table when dropdown action is clicked and closes the dropdown in the MR widget
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/pipelines/graph/action_component_spec.js12
-rw-r--r--spec/javascripts/pipelines/stage_spec.js26
2 files changed, 2 insertions, 36 deletions
diff --git a/spec/javascripts/pipelines/graph/action_component_spec.js b/spec/javascripts/pipelines/graph/action_component_spec.js
index 97f8ae3cd89..568e679abe9 100644
--- a/spec/javascripts/pipelines/graph/action_component_spec.js
+++ b/spec/javascripts/pipelines/graph/action_component_spec.js
@@ -48,23 +48,11 @@ describe('pipeline graph action component', () => {
expect(component.$el.querySelector('svg')).toBeDefined();
});
- it('renders a loading icon while component is loading', done => {
- component.isLoading = true;
-
- component.$nextTick()
- .then(() => {
- expect(component.$el.querySelector('.fa-spin')).not.toBeNull();
- })
- .then(done)
- .catch(done.fail);
- });
-
describe('on click', () => {
it('emits `pipelineActionRequestComplete` after a successfull request', done => {
spyOn(component, '$emit');
component.$el.click();
- expect(component.isLoading).toEqual(true);
component.$nextTick()
.then(() => {
diff --git a/spec/javascripts/pipelines/stage_spec.js b/spec/javascripts/pipelines/stage_spec.js
index 2ba5ecf92e7..16f6db39d6a 100644
--- a/spec/javascripts/pipelines/stage_spec.js
+++ b/spec/javascripts/pipelines/stage_spec.js
@@ -111,7 +111,7 @@ describe('Pipelines stage component', () => {
});
describe('within pipeline table', () => {
- it('emits `clickedDropdown` event when `pipelineActionRequestComplete` is triggered', done => {
+ it('emits `refreshPipelinesTable` event when `pipelineActionRequestComplete` is triggered', done => {
spyOn(eventHub, '$emit');
component.type = 'PIPELINES_TABLE';
@@ -121,34 +121,12 @@ describe('Pipelines stage component', () => {
component.$el.querySelector('.js-ci-action').click();
component.$nextTick()
.then(() => {
- expect(eventHub.$emit).toHaveBeenCalledWith('clickedDropdown');
-
- expect(eventHub.$emit).toHaveBeenCalledTimes(2);
+ expect(eventHub.$emit).toHaveBeenCalledWith('refreshPipelinesTable');
})
.then(done)
.catch(done.fail);
}, 0);
});
});
-
- describe('without a type', () => {
- it('fetches dropdown content again', done => {
- spyOn(component, 'fetchJobs').and.callThrough();
-
- component.$el.querySelector('button').click();
-
- expect(component.fetchJobs).toHaveBeenCalledTimes(1);
-
- setTimeout(() => {
- component.$el.querySelector('.js-ci-action').click();
- component.$nextTick()
- .then(() => {
- expect(component.fetchJobs).toHaveBeenCalledTimes(2);
- })
- .then(done)
- .catch(done.fail);
- }, 0);
- });
- });
});
});