Reduce number of pipelines created to test pagination

stub pagination in tests
This commit is contained in:
Filipa Lacerda 2017-02-16 20:17:12 +00:00
parent e1af42ce4e
commit 9f00c2b0d2
2 changed files with 6 additions and 7 deletions

View file

@ -56,7 +56,7 @@ const CommitPipelinesStoreWithTimeAgo = require('../commit/pipelines/pipelines_s
*/
change(pagenum, apiScope) {
if (!apiScope) apiScope = 'all';
gl.utils.visitUrl(`?scope=${apiScope}&p=${pagenum}`);
gl.utils.visitUrl(`?scope=${apiScope}&page=${pagenum}`);
},
},
template: `

View file

@ -288,23 +288,22 @@ describe 'Pipelines', :feature, :js do
context 'with pagination' do
before do
create_list(:ci_empty_pipeline, 40, project: project)
allow(Ci::Pipeline).to receive(:default_per_page).and_return(1)
create(:ci_empty_pipeline, project: project)
end
it 'should render pagination' do
visit namespace_project_pipelines_path(project.namespace, project)
wait_for_vue_resource
expect(page).to have_css('.gl-pagination')
expect(page.find_all('tbody tr').length).to eq(20)
expect(page).to have_selector('.gl-pagination')
end
it "should render second page of pipelines" do
it 'should render second page of pipelines' do
visit namespace_project_pipelines_path(project.namespace, project, page: '2')
wait_for_vue_resource
expect(page).to have_css('.gl-pagination')
expect(page.find_all('tbody tr').length).to eq(20)
expect(page).to have_selector('.gl-pagination .page', count: 2)
end
end
end