diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
commit | 0653e08efd039a5905f3fa4f6e9cef9f5d2f799c (patch) | |
tree | 4dcc884cf6d81db44adae4aa99f8ec1233a41f55 /spec/features/boards/user_adds_lists_to_board_spec.rb | |
parent | 744144d28e3e7fddc117924fef88de5d9674fe4c (diff) |
Add latest changes from gitlab-org/gitlab@14-3-stable-eev14.3.0-rc42
Diffstat (limited to 'spec/features/boards/user_adds_lists_to_board_spec.rb')
-rw-r--r-- | spec/features/boards/user_adds_lists_to_board_spec.rb | 67 |
1 files changed, 29 insertions, 38 deletions
diff --git a/spec/features/boards/user_adds_lists_to_board_spec.rb b/spec/features/boards/user_adds_lists_to_board_spec.rb index 5128fc4004e..26c310a6f56 100644 --- a/spec/features/boards/user_adds_lists_to_board_spec.rb +++ b/spec/features/boards/user_adds_lists_to_board_spec.rb @@ -3,8 +3,6 @@ require 'spec_helper' RSpec.describe 'User adds lists', :js do - using RSpec::Parameterized::TableSyntax - let_it_be(:group) { create(:group, :nested) } let_it_be(:project) { create(:project, :public, namespace: group) } let_it_be(:group_board) { create(:board, group: group) } @@ -17,6 +15,8 @@ RSpec.describe 'User adds lists', :js do let_it_be(:project_label) { create(:label, project: project) } let_it_be(:group_backlog_list) { create(:backlog_list, board: group_board) } let_it_be(:project_backlog_list) { create(:backlog_list, board: project_board) } + let_it_be(:backlog) { create(:group_label, group: group, name: 'Backlog') } + let_it_be(:closed) { create(:group_label, group: group, name: 'Closed') } let_it_be(:issue) { create(:labeled_issue, project: project, labels: [group_label, project_label]) } @@ -25,15 +25,8 @@ RSpec.describe 'User adds lists', :js do group.add_owner(user) end - where(:board_type, :graphql_board_lists_enabled, :board_new_list_enabled) do - :project | true | true - :project | false | true - :project | true | false - :project | false | false - :group | true | true - :group | false | true - :group | true | false - :group | false | false + where(:board_type) do + [[:project], [:group]] end with_them do @@ -42,11 +35,6 @@ RSpec.describe 'User adds lists', :js do set_cookie('sidebar_collapsed', 'true') - stub_feature_flags( - graphql_board_lists: graphql_board_lists_enabled, - board_new_list: board_new_list_enabled - ) - if board_type == :project visit project_board_path(project, project_board) elsif board_type == :group @@ -56,40 +44,43 @@ RSpec.describe 'User adds lists', :js do wait_for_all_requests end - it 'creates new column for label containing labeled issue' do - click_button button_text(board_new_list_enabled) + it 'creates new column for label containing labeled issue', :aggregate_failures do + click_button 'Create list' wait_for_all_requests - select_label(board_new_list_enabled, group_label) - - wait_for_all_requests + select_label(group_label) expect(page).to have_selector('.board', text: group_label.title) expect(find('.board:nth-child(2) .board-card')).to have_content(issue.title) end - end - def select_label(board_new_list_enabled, label) - if board_new_list_enabled - click_button 'Select a label' + it 'creates new list for Backlog and closed labels' do + click_button 'Create list' + wait_for_requests - find('label', text: label.title).click + select_label(backlog) - click_button 'Add to board' + click_button 'Create list' + wait_for_requests - wait_for_all_requests - else - page.within('.dropdown-menu-issues-board-new') do - click_link label.title - end + select_label(closed) + + wait_for_requests + + expect(page).to have_selector('.board', text: closed.title) + expect(find('.board:nth-child(2) .board-header')).to have_content(backlog.title) + expect(find('.board:nth-child(3) .board-header')).to have_content(closed.title) + expect(find('.board:nth-child(4) .board-header')).to have_content('Closed') end end - def button_text(board_new_list_enabled) - if board_new_list_enabled - 'Create list' - else - 'Add list' - end + def select_label(label) + click_button 'Select a label' + + find('label', text: label.title).click + + click_button 'Add to board' + + wait_for_all_requests end end |