diff options
Diffstat (limited to 'spec/javascripts/commit')
-rw-r--r-- | spec/javascripts/commit/commit_pipeline_status_component_spec.js | 8 | ||||
-rw-r--r-- | spec/javascripts/commit/pipelines/pipelines_spec.js | 23 |
2 files changed, 27 insertions, 4 deletions
diff --git a/spec/javascripts/commit/commit_pipeline_status_component_spec.js b/spec/javascripts/commit/commit_pipeline_status_component_spec.js index 4fc56fd9a27..f6b36e88a5f 100644 --- a/spec/javascripts/commit/commit_pipeline_status_component_spec.js +++ b/spec/javascripts/commit/commit_pipeline_status_component_spec.js @@ -22,7 +22,7 @@ describe('Commit pipeline status component', () => { Component = Vue.extend(commitPipelineStatus); }); - describe('While polling pipeline data succesfully', () => { + describe('While polling pipeline data successfully', () => { beforeEach(() => { mock = new MockAdapter(axios); mock.onGet('/dummy/endpoint').reply(() => { @@ -59,14 +59,14 @@ describe('Commit pipeline status component', () => { }); }); - it('contains a ciStatus when the polling is succesful ', done => { + it('contains a ciStatus when the polling is successful ', done => { setTimeout(() => { expect(vm.ciStatus).toEqual(mockCiStatus); done(); }); }); - it('contains a ci-status icon when polling is succesful', done => { + it('contains a ci-status icon when polling is successful', done => { setTimeout(() => { expect(vm.$el.querySelector('.ci-status-icon')).not.toBe(null); expect(vm.$el.querySelector('.ci-status-icon').classList).toContain( @@ -77,7 +77,7 @@ describe('Commit pipeline status component', () => { }); }); - describe('When polling data was not succesful', () => { + describe('When polling data was not successful', () => { beforeEach(() => { mock = new MockAdapter(axios); mock.onGet('/dummy/endpoint').reply(502, {}); diff --git a/spec/javascripts/commit/pipelines/pipelines_spec.js b/spec/javascripts/commit/pipelines/pipelines_spec.js index b797cc44ae7..04c8ab44405 100644 --- a/spec/javascripts/commit/pipelines/pipelines_spec.js +++ b/spec/javascripts/commit/pipelines/pipelines_spec.js @@ -72,6 +72,29 @@ describe('Pipelines table in Commits and Merge requests', function() { done(); }, 0); }); + + describe('with pagination', () => { + it('should make an API request when using pagination', done => { + setTimeout(() => { + spyOn(vm, 'updateContent'); + + vm.store.state.pageInfo = { + page: 1, + total: 10, + perPage: 2, + nextPage: 2, + totalPages: 5, + }; + + vm.$nextTick(() => { + vm.$el.querySelector('.js-next-button a').click(); + + expect(vm.updateContent).toHaveBeenCalledWith({ page: '2' }); + done(); + }); + }); + }); + }); }); describe('pipeline badge counts', () => { |