diff options
author | Felipe Artur <fcardozo@gitlab.com> | 2018-06-21 12:22:40 +0000 |
---|---|---|
committer | Tim Zallmann <tzallmann@gitlab.com> | 2018-06-21 12:22:40 +0000 |
commit | 3e66795ef1ff1228906239763910b051d8afcc37 (patch) | |
tree | df6424d9ec008f5d1da455f8465681b371c4a11e /spec/javascripts/pipelines | |
parent | 14e35ac9b19d358d84e0cfd167f74036937285b6 (diff) | |
download | gitlab-ce-3e66795ef1ff1228906239763910b051d8afcc37.tar.gz |
Changes tab VUE refactoring
Diffstat (limited to 'spec/javascripts/pipelines')
-rw-r--r-- | spec/javascripts/pipelines/pipelines_table_row_spec.js | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/spec/javascripts/pipelines/pipelines_table_row_spec.js b/spec/javascripts/pipelines/pipelines_table_row_spec.js index 68043b91bd0..78d8e9e572e 100644 --- a/spec/javascripts/pipelines/pipelines_table_row_spec.js +++ b/spec/javascripts/pipelines/pipelines_table_row_spec.js @@ -4,7 +4,7 @@ import eventHub from '~/pipelines/event_hub'; describe('Pipelines Table Row', () => { const jsonFixtureName = 'pipelines/pipelines.json'; - const buildComponent = (pipeline) => { + const buildComponent = pipeline => { const PipelinesTableRowComponent = Vue.extend(tableRowComp); return new PipelinesTableRowComponent({ el: document.querySelector('.test-dom-element'), @@ -52,9 +52,9 @@ describe('Pipelines Table Row', () => { }); it('should render status text', () => { - expect( - component.$el.querySelector('.table-section.commit-link a').textContent, - ).toContain(pipeline.details.status.text); + expect(component.$el.querySelector('.table-section.commit-link a').textContent).toContain( + pipeline.details.status.text, + ); }); }); @@ -78,11 +78,15 @@ describe('Pipelines Table Row', () => { describe('when a user is provided', () => { it('should render user information', () => { expect( - component.$el.querySelector('.table-section:nth-child(2) a:nth-child(3)').getAttribute('href'), + component.$el + .querySelector('.table-section:nth-child(2) a:nth-child(3)') + .getAttribute('href'), ).toEqual(pipeline.user.path); expect( - component.$el.querySelector('.table-section:nth-child(2) img').getAttribute('data-original-title'), + component.$el + .querySelector('.table-section:nth-child(2) img') + .getAttribute('data-original-title'), ).toEqual(pipeline.user.name); }); }); @@ -105,7 +109,9 @@ describe('Pipelines Table Row', () => { } const commitAuthorLink = commitAuthorElement.getAttribute('href'); - const commitAuthorName = commitAuthorElement.querySelector('img.avatar').getAttribute('data-original-title'); + const commitAuthorName = commitAuthorElement + .querySelector('img.avatar') + .getAttribute('data-original-title'); return { commitAuthorElement, commitAuthorLink, commitAuthorName }; }; @@ -145,7 +151,8 @@ describe('Pipelines Table Row', () => { it('should render an icon for each stage', () => { expect( - component.$el.querySelectorAll('.table-section:nth-child(4) .js-builds-dropdown-button').length, + component.$el.querySelectorAll('.table-section:nth-child(4) .js-builds-dropdown-button') + .length, ).toEqual(pipeline.details.stages.length); }); }); @@ -167,7 +174,7 @@ describe('Pipelines Table Row', () => { }); it('emits `retryPipeline` event when retry button is clicked and toggles loading', () => { - eventHub.$on('retryPipeline', (endpoint) => { + eventHub.$on('retryPipeline', endpoint => { expect(endpoint).toEqual('/retry'); }); @@ -176,7 +183,7 @@ describe('Pipelines Table Row', () => { }); it('emits `openConfirmationModal` event when cancel button is clicked and toggles loading', () => { - eventHub.$on('openConfirmationModal', (data) => { + eventHub.$once('openConfirmationModal', data => { expect(data.endpoint).toEqual('/cancel'); expect(data.pipelineId).toEqual(pipeline.id); }); |