diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2019-02-27 09:44:45 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2019-02-27 09:44:45 +0000 |
commit | d6696f819b5b47752c6451f939d24f0f03054663 (patch) | |
tree | 3de24a3a8f5903add8ccee38f1ff42069bcac2d6 /spec/features | |
parent | 079d471e8effe0e3b200cc7023dc81c0d155293a (diff) | |
parent | 43ac2a964ffe5f2713cb3093b4192216ec8525ad (diff) | |
download | gitlab-ce-d6696f819b5b47752c6451f939d24f0f03054663.tar.gz |
Merge branch 'sh-wip-fix-duplicate-env-xhr' into 'master'
Fix pagination and duplicate requests in environments page
Closes #58191
See merge request gitlab-org/gitlab-ce!25582
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/projects/environments/environments_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/features/projects/environments/environments_spec.rb b/spec/features/projects/environments/environments_spec.rb index 0c517d5f490..66c6545204b 100644 --- a/spec/features/projects/environments/environments_spec.rb +++ b/spec/features/projects/environments/environments_spec.rb @@ -38,6 +38,23 @@ describe 'Environments page', :js do end end + describe 'with environments spanning multiple pages', :js do + before do + allow(Kaminari.config).to receive(:default_per_page).and_return(3) + create_list(:environment, 4, project: project, state: :available) + end + + it 'should render second page of pipelines' do + visit_environments(project, scope: 'available') + + find('.js-next-button').click + wait_for_requests + + expect(page).to have_selector('.gl-pagination .page', count: 2) + expect(find('.gl-pagination .page-item.active .page-link').text).to eq("2") + end + end + describe 'in stopped tab page' do it 'should show no environments' do visit_environments(project, scope: 'stopped') |