diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-21 06:09:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-21 06:09:46 +0300 |
commit | a6ebd13ef8a8b95d7b12a442fdb99b03092e98ba (patch) | |
tree | ae5c0944b542fc67e7589dd071b1d8c82d5d40a0 /spec | |
parent | c13bf680779c861d0c77a06217e5e1e4e77dd65e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/groups/board_sidebar_spec.rb | 28 | ||||
-rw-r--r-- | spec/features/labels_hierarchy_spec.rb | 76 | ||||
-rw-r--r-- | spec/migrations/re_schedule_latest_pipeline_id_population_with_logging_spec.rb (renamed from spec/migrations/re_schedule_latest_pipeline_id_population_spec.rb) | 2 | ||||
-rw-r--r-- | spec/support/shared_examples/boards/multiple_issue_boards_shared_examples.rb | 12 |
4 files changed, 110 insertions, 8 deletions
diff --git a/spec/features/groups/board_sidebar_spec.rb b/spec/features/groups/board_sidebar_spec.rb index 690d661ba2f..e2dd2fecab7 100644 --- a/spec/features/groups/board_sidebar_spec.rb +++ b/spec/features/groups/board_sidebar_spec.rb @@ -19,8 +19,6 @@ RSpec.describe 'Group Issue Boards', :js do let(:card) { find('.board:nth-child(1)').first('.board-card') } before do - # stubbing until sidebar work is done: https://gitlab.com/gitlab-org/gitlab/-/issues/230711 - stub_feature_flags(graphql_board_lists: false) sign_in(user) visit group_board_path(group, board) @@ -32,6 +30,32 @@ RSpec.describe 'Group Issue Boards', :js do click_card(card) page.within('.labels') do + click_button 'Edit' + + wait_for_requests + + page.within('[data-testid="dropdown-content"]') do + expect(page).to have_content(project_1_label.title) + expect(page).to have_content(group_label.title) + expect(page).not_to have_content(project_2_label.title) + end + end + end + end + + context 'when graphql_board_lists FF disabled' do + before do + stub_feature_flags(graphql_board_lists: false) + sign_in(user) + + visit group_board_path(group, board) + wait_for_requests + end + + it 'only shows valid labels for the issue project and group' do + click_card(card) + + page.within('.labels') do click_link 'Edit' wait_for_requests diff --git a/spec/features/labels_hierarchy_spec.rb b/spec/features/labels_hierarchy_spec.rb index 0a2f81986be..fca5e946d0c 100644 --- a/spec/features/labels_hierarchy_spec.rb +++ b/spec/features/labels_hierarchy_spec.rb @@ -17,7 +17,6 @@ RSpec.describe 'Labels Hierarchy', :js do let!(:project_label_1) { create(:label, project: project_1, title: 'Label_4') } before do - stub_feature_flags(graphql_board_lists: false) stub_feature_flags(board_new_list: false) grandparent.add_owner(user) @@ -25,20 +24,21 @@ RSpec.describe 'Labels Hierarchy', :js do end shared_examples 'assigning labels from sidebar' do - it 'can assign all ancestors labels', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/27952' do + it 'can assign all ancestors labels' do [grandparent_group_label, parent_group_label, project_label_1].each do |label| page.within('.block.labels') do - find('.edit-link').click + click_on 'Edit' end wait_for_requests find('a.label-item', text: label.title).click - find('.dropdown-menu-close-icon').click + wait_for_requests + click_on 'Close' wait_for_requests - expect(page).to have_selector('.badge', text: label.title) + expect(page).to have_selector('.gl-label', text: label.title) end end @@ -215,6 +215,44 @@ RSpec.describe 'Labels Hierarchy', :js do end end + context 'issuable sidebar when graphql_board_lists FF disabled' do + let!(:issue) { create(:issue, project: project_1) } + + before do + stub_feature_flags(graphql_board_lists: false) + end + + context 'on project board issue sidebar' do + before do + project_1.add_developer(user) + board = create(:board, project: project_1) + + visit project_board_path(project_1, board) + + wait_for_requests + + find('.board-card').click + end + + it_behaves_like 'assigning labels from sidebar' + end + + context 'on group board issue sidebar' do + before do + parent.add_developer(user) + board = create(:board, group: parent) + + visit group_board_path(parent, board) + + wait_for_requests + + find('.board-card').click + end + + it_behaves_like 'assigning labels from sidebar' + end + end + context 'issuable filtering' do let!(:labeled_issue) { create(:labeled_issue, project: project_1, labels: [grandparent_group_label, parent_group_label, project_label_1]) } let!(:issue) { create(:issue, project: project_1) } @@ -302,6 +340,34 @@ RSpec.describe 'Labels Hierarchy', :js do let(:board) { create(:board, group: parent) } before do + parent.add_developer(user) + visit group_board_path(parent, board) + find('.js-new-board-list').click + wait_for_requests + end + + context 'when graphql_board_lists FF enabled' do + it 'creates lists from all ancestor group labels' do + [grandparent_group_label, parent_group_label].each do |label| + find('a', text: label.title).click + end + + wait_for_requests + + expect(page).to have_selector('.board-title-text', text: grandparent_group_label.title) + expect(page).to have_selector('.board-title-text', text: parent_group_label.title) + end + + it 'does not create lists from descendant groups' do + expect(page).not_to have_selector('a', text: child_group_label.title) + end + end + end + + context 'when graphql_board_lists FF disabled' do + let(:board) { create(:board, group: parent) } + + before do stub_feature_flags(graphql_board_lists: false) parent.add_developer(user) visit group_board_path(parent, board) diff --git a/spec/migrations/re_schedule_latest_pipeline_id_population_spec.rb b/spec/migrations/re_schedule_latest_pipeline_id_population_with_logging_spec.rb index 354a0896ac9..7a5e7c469b3 100644 --- a/spec/migrations/re_schedule_latest_pipeline_id_population_spec.rb +++ b/spec/migrations/re_schedule_latest_pipeline_id_population_with_logging_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe ReScheduleLatestPipelineIdPopulation do +RSpec.describe ReScheduleLatestPipelineIdPopulationWithLogging do let(:namespaces) { table(:namespaces) } let(:pipelines) { table(:ci_pipelines) } let(:projects) { table(:projects) } diff --git a/spec/support/shared_examples/boards/multiple_issue_boards_shared_examples.rb b/spec/support/shared_examples/boards/multiple_issue_boards_shared_examples.rb index 9c8006ce4f1..cadc753513d 100644 --- a/spec/support/shared_examples/boards/multiple_issue_boards_shared_examples.rb +++ b/spec/support/shared_examples/boards/multiple_issue_boards_shared_examples.rb @@ -109,6 +109,18 @@ RSpec.shared_examples 'multiple issue boards' do assert_boards_nav_active end + + it 'switches current board back' do + in_boards_switcher_dropdown do + click_link board.name + end + + wait_for_requests + + page.within('.boards-switcher') do + expect(page).to have_content(board.name) + end + end end context 'unauthorized user' do |