diff --git a/app/assets/javascripts/boards/components/board_list.vue b/app/assets/javascripts/boards/components/board_list.vue index 552973e96cbefcb57d6710dc2c01a2c9b16ccf04..1a3a49972804d980e08153b64598b620304623a4 100644 --- a/app/assets/javascripts/boards/components/board_list.vue +++ b/app/assets/javascripts/boards/components/board_list.vue @@ -239,7 +239,7 @@ export default { data-testid="count-loading-icon" /> <span v-if="showingAllItems">{{ showingAllItemsText }}</span> - <gl-intersection-observer v-else @update="onReachingListBottom"> + <gl-intersection-observer v-else @appear="onReachingListBottom"> <span>{{ paginatedIssueText }}</span> </gl-intersection-observer> </li> diff --git a/spec/features/boards/boards_spec.rb b/spec/features/boards/boards_spec.rb index 5d9bb8d808759b616f1c69f553c14001397f9d11..02bb7574fb01fdc20c2808c221bb7dc86ba10105 100644 --- a/spec/features/boards/boards_spec.rb +++ b/spec/features/boards/boards_spec.rb @@ -147,14 +147,23 @@ end it 'infinite scrolls list' do - create_list(:labeled_issue, 50, project: project, labels: [planning]) + create_list(:labeled_issue, 30, project: project, labels: [planning]) visit_project_board_path_without_query_limit(project, board) page.within(find('.board:nth-child(2)')) do - expect(page.find('.board-header')).to have_content('58') + expect(page.find('.board-header')).to have_content('38') + expect(page).to have_selector('.board-card', count: 10) + expect(page).to have_content('Showing 10 of 38 issues') + + find('.board .board-list') + + inspect_requests(inject_headers: { 'X-GITLAB-DISABLE-SQL-QUERY-LIMIT' => 'https://gitlab.com/gitlab-org/gitlab/-/issues/323426' }) do + evaluate_script("document.querySelectorAll('.board .board-list')[1].scrollTop = document.querySelectorAll('.board .board-list')[1].scrollHeight") + end + expect(page).to have_selector('.board-card', count: 20) - expect(page).to have_content('Showing 20 of 58 issues') + expect(page).to have_content('Showing 20 of 38 issues') find('.board .board-list') @@ -162,8 +171,8 @@ evaluate_script("document.querySelectorAll('.board .board-list')[1].scrollTop = document.querySelectorAll('.board .board-list')[1].scrollHeight") end - expect(page).to have_selector('.board-card', count: 40) - expect(page).to have_content('Showing 40 of 58 issues') + expect(page).to have_selector('.board-card', count: 30) + expect(page).to have_content('Showing 30 of 38 issues') find('.board .board-list') @@ -171,7 +180,7 @@ evaluate_script("document.querySelectorAll('.board .board-list')[1].scrollTop = document.querySelectorAll('.board .board-list')[1].scrollHeight") end - expect(page).to have_selector('.board-card', count: 58) + expect(page).to have_selector('.board-card', count: 38) expect(page).to have_content('Showing all issues') end end @@ -464,7 +473,7 @@ end it 'infinite scrolls list with label filter' do - create_list(:labeled_issue, 50, project: project, labels: [planning, testing]) + create_list(:labeled_issue, 30, project: project, labels: [planning, testing]) set_filter("label", testing.title) click_filter_link(testing.title) @@ -475,9 +484,18 @@ wait_for_requests page.within(find('.board:nth-child(2)')) do - expect(page.find('.board-header')).to have_content('51') + expect(page.find('.board-header')).to have_content('31') + expect(page).to have_selector('.board-card', count: 10) + expect(page).to have_content('Showing 10 of 31 issues') + + find('.board .board-list') + + inspect_requests(inject_headers: { 'X-GITLAB-DISABLE-SQL-QUERY-LIMIT' => 'https://gitlab.com/gitlab-org/gitlab/-/issues/323426' }) do + evaluate_script("document.querySelectorAll('.board .board-list')[1].scrollTop = document.querySelectorAll('.board .board-list')[1].scrollHeight") + end + expect(page).to have_selector('.board-card', count: 20) - expect(page).to have_content('Showing 20 of 51 issues') + expect(page).to have_content('Showing 20 of 31 issues') find('.board .board-list') @@ -485,15 +503,15 @@ evaluate_script("document.querySelectorAll('.board .board-list')[1].scrollTop = document.querySelectorAll('.board .board-list')[1].scrollHeight") end - expect(page).to have_selector('.board-card', count: 40) - expect(page).to have_content('Showing 40 of 51 issues') + expect(page).to have_selector('.board-card', count: 30) + expect(page).to have_content('Showing 30 of 31 issues') find('.board .board-list') inspect_requests(inject_headers: { 'X-GITLAB-DISABLE-SQL-QUERY-LIMIT' => 'https://gitlab.com/gitlab-org/gitlab/-/issues/323426' }) do evaluate_script("document.querySelectorAll('.board .board-list')[1].scrollTop = document.querySelectorAll('.board .board-list')[1].scrollHeight") end - expect(page).to have_selector('.board-card', count: 51) + expect(page).to have_selector('.board-card', count: 31) expect(page).to have_content('Showing all issues') end end