diff options
Diffstat (limited to 'spec/features/boards')
-rw-r--r-- | spec/features/boards/boards_spec.rb | 42 | ||||
-rw-r--r-- | spec/features/boards/issue_ordering_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/boards/multi_select_spec.rb | 4 | ||||
-rw-r--r-- | spec/features/boards/new_issue_spec.rb | 34 | ||||
-rw-r--r-- | spec/features/boards/sidebar_assignee_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/boards/sidebar_milestones_spec.rb | 4 |
6 files changed, 66 insertions, 22 deletions
diff --git a/spec/features/boards/boards_spec.rb b/spec/features/boards/boards_spec.rb index 5d9bb8d8087..02bb7574fb0 100644 --- a/spec/features/boards/boards_spec.rb +++ b/spec/features/boards/boards_spec.rb @@ -147,14 +147,23 @@ RSpec.describe 'Project issue boards', :js do 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 @@ RSpec.describe 'Project issue boards', :js 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: 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 @@ RSpec.describe 'Project issue boards', :js 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: 58) + expect(page).to have_selector('.board-card', count: 38) expect(page).to have_content('Showing all issues') end end @@ -464,7 +473,7 @@ RSpec.describe 'Project issue boards', :js do 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 @@ RSpec.describe 'Project issue boards', :js do 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 @@ RSpec.describe 'Project issue boards', :js 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: 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 diff --git a/spec/features/boards/issue_ordering_spec.rb b/spec/features/boards/issue_ordering_spec.rb index 87d29eed68d..57f2bf26752 100644 --- a/spec/features/boards/issue_ordering_spec.rb +++ b/spec/features/boards/issue_ordering_spec.rb @@ -157,7 +157,7 @@ RSpec.describe 'Issue Boards', :js do end it 'moves to bottom of another list' do - drag(list_from_index: 1, list_to_index: 2, to_index: 2, duration: 1020) + drag(list_from_index: 1, list_to_index: 2, to_index: 3, duration: 1020) wait_for_requests diff --git a/spec/features/boards/multi_select_spec.rb b/spec/features/boards/multi_select_spec.rb index ca322355b8f..057464326fa 100644 --- a/spec/features/boards/multi_select_spec.rb +++ b/spec/features/boards/multi_select_spec.rb @@ -41,9 +41,9 @@ RSpec.describe 'Multi Select Issue', :js do before do project.add_maintainer(user) - # multi-drag disabled with feature flag for now + # Multi select drag&drop support is temporarily disabled # https://gitlab.com/gitlab-org/gitlab/-/issues/289797 - stub_feature_flags(graphql_board_lists: false) + stub_feature_flags(graphql_board_lists: false, board_multi_select: project) sign_in(user) end diff --git a/spec/features/boards/new_issue_spec.rb b/spec/features/boards/new_issue_spec.rb index 129d03d17f3..e055e8092d4 100644 --- a/spec/features/boards/new_issue_spec.rb +++ b/spec/features/boards/new_issue_spec.rb @@ -120,6 +120,32 @@ RSpec.describe 'Issue Boards new issue', :js do expect(page).to have_content 'Label 1' end end + + it 'allows creating an issue in newly created list' do + click_button 'Create list' + wait_for_all_requests + + click_button 'Select a label' + find('label', text: label.title).click + click_button 'Add to board' + + wait_for_all_requests + + page.within('.board:nth-child(2)') do + click_button('New issue') + + page.within(first('.board-new-issue-form')) do + find('.form-control').set('new issue') + click_button 'Create issue' + end + + wait_for_all_requests + + page.within('.board-card') do + expect(page).to have_content 'new issue' + end + end + end end context 'unauthorized user' do @@ -128,8 +154,8 @@ RSpec.describe 'Issue Boards new issue', :js do wait_for_requests end - it 'displays new issue button in open list' do - expect(first('.board')).to have_button('New issue', count: 1) + it 'does not display new issue button in open list' do + expect(first('.board')).not_to have_button('New issue') end it 'does not display new issue button in label list' do @@ -166,8 +192,8 @@ RSpec.describe 'Issue Boards new issue', :js do context 'when backlog list already exists' do let_it_be(:backlog_list) { create(:backlog_list, board: group_board) } - it 'displays new issue button in open list' do - expect(first('.board')).to have_button('New issue', count: 1) + it 'does not display new issue button in open list' do + expect(first('.board')).not_to have_button('New issue') end it 'does not display new issue button in label list' do diff --git a/spec/features/boards/sidebar_assignee_spec.rb b/spec/features/boards/sidebar_assignee_spec.rb index d6adefea6e3..63553cec89b 100644 --- a/spec/features/boards/sidebar_assignee_spec.rb +++ b/spec/features/boards/sidebar_assignee_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Project issue boards sidebar assignee', :js do +RSpec.describe 'Project issue boards sidebar assignee', :js, quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/332230' do include BoardHelpers let_it_be(:user) { create(:user) } diff --git a/spec/features/boards/sidebar_milestones_spec.rb b/spec/features/boards/sidebar_milestones_spec.rb index 54182781a30..be7435263b1 100644 --- a/spec/features/boards/sidebar_milestones_spec.rb +++ b/spec/features/boards/sidebar_milestones_spec.rb @@ -38,7 +38,7 @@ RSpec.describe 'Project issue boards sidebar milestones', :js do wait_for_requests - page.within('.value') do + page.within('[data-testid="select-milestone"]') do expect(page).to have_content(milestone.title) end end @@ -56,7 +56,7 @@ RSpec.describe 'Project issue boards sidebar milestones', :js do wait_for_requests - page.within('.value') do + page.within('[data-testid="select-milestone"]') do expect(page).not_to have_content(milestone.title) end end |