diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
commit | a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch) | |
tree | fb69158581673816a8cd895f9d352dcb3c678b1e /spec/features/merge_request | |
parent | d16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff) |
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'spec/features/merge_request')
9 files changed, 82 insertions, 18 deletions
diff --git a/spec/features/merge_request/user_allows_commits_from_memebers_who_can_merge_spec.rb b/spec/features/merge_request/user_allows_commits_from_memebers_who_can_merge_spec.rb index d36abf86518..75912238501 100644 --- a/spec/features/merge_request/user_allows_commits_from_memebers_who_can_merge_spec.rb +++ b/spec/features/merge_request/user_allows_commits_from_memebers_who_can_merge_spec.rb @@ -32,7 +32,7 @@ RSpec.describe 'create a merge request, allowing commits from members who can me wait_for_requests - expect(page).to have_content('Allows commits from members who can merge to the target branch') + expect(page).to have_content('Members who can merge are allowed to add commits.') end it 'shows a message when one of the projects is private', :sidekiq_might_not_need_inline do @@ -59,7 +59,7 @@ RSpec.describe 'create a merge request, allowing commits from members who can me visit_new_merge_request - expect(page).not_to have_content('Allows commits from members who can merge to the target branch') + expect(page).not_to have_content('The fork project allows commits from members who can write to the target branch.') end end @@ -81,7 +81,7 @@ RSpec.describe 'create a merge request, allowing commits from members who can me it 'hides the option from members' do visit edit_project_merge_request_path(target_project, merge_request) - expect(page).not_to have_content('Allows commits from members who can merge to the target branch') + expect(page).not_to have_content('The fork project allows commits from members who can write to the target branch.') end end end diff --git a/spec/features/merge_request/user_awards_emoji_spec.rb b/spec/features/merge_request/user_awards_emoji_spec.rb index 6f46cc20cba..240b8f996c8 100644 --- a/spec/features/merge_request/user_awards_emoji_spec.rb +++ b/spec/features/merge_request/user_awards_emoji_spec.rb @@ -18,7 +18,7 @@ RSpec.describe 'Merge request > User awards emoji', :js do it 'adds award to merge request' do first('[data-testid="award-button"]').click - expect(page).to have_selector('[data-testid="award-button"].is-active') + expect(page).to have_selector('[data-testid="award-button"].selected') expect(first('[data-testid="award-button"]')).to have_content '1' visit project_merge_request_path(project, merge_request) @@ -27,7 +27,7 @@ RSpec.describe 'Merge request > User awards emoji', :js do it 'removes award from merge request' do first('[data-testid="award-button"]').click - find('[data-testid="award-button"].is-active').click + find('[data-testid="award-button"].selected').click expect(first('[data-testid="award-button"]')).to have_content '0' visit project_merge_request_path(project, merge_request) diff --git a/spec/features/merge_request/user_edits_assignees_sidebar_spec.rb b/spec/features/merge_request/user_edits_assignees_sidebar_spec.rb index 7d55a72c2b1..1087be3d8c6 100644 --- a/spec/features/merge_request/user_edits_assignees_sidebar_spec.rb +++ b/spec/features/merge_request/user_edits_assignees_sidebar_spec.rb @@ -68,14 +68,14 @@ RSpec.describe 'Merge request > User edits assignees sidebar', :js do end end - context 'with invite members experiment considerations' do + context 'with invite members considerations' do let_it_be(:user) { create(:user) } before do sign_in(user) end - include_examples 'issuable invite members experiments' do + include_examples 'issuable invite members' do let(:issuable_path) { project_merge_request_path(project, merge_request) } end end diff --git a/spec/features/merge_request/user_edits_reviewers_sidebar_spec.rb b/spec/features/merge_request/user_edits_reviewers_sidebar_spec.rb new file mode 100644 index 00000000000..45ee914de9d --- /dev/null +++ b/spec/features/merge_request/user_edits_reviewers_sidebar_spec.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'Merge request > User edits reviewers sidebar', :js do + context 'with invite members considerations' do + let_it_be(:merge_request) { create(:merge_request) } + let_it_be(:project) { merge_request.project } + let_it_be(:user) { create(:user) } + + before do + sign_in(user) + end + + context 'when a privileged user can invite in reviewer dropdown' do + before do + project.add_maintainer(user) + end + + it 'shows a link for inviting members and launches invite modal' do + visit project_merge_request_path(project, merge_request) + + reviewer_edit_link.click + + wait_for_requests + + page.within '.dropdown-menu-user' do + expect(page).to have_link('Invite Members') + expect(page).to have_selector('[data-track-event="click_invite_members"]') + expect(page).to have_selector('[data-track-label="edit_reviewer"]') + end + + click_link 'Invite Members' + + expect(page).to have_content("You're inviting members to the") + end + end + + context 'when user cannot invite members in reviewer dropdown' do + before do + project.add_developer(user) + end + + it 'shows author in assignee dropdown and no invite link' do + visit project_merge_request_path(project, merge_request) + + reviewer_edit_link.click + + wait_for_requests + + page.within '.dropdown-menu-user' do + expect(page).not_to have_link('Invite Members') + end + end + end + + def reviewer_edit_link + find('.block.reviewer .edit-link') + end + end +end diff --git a/spec/features/merge_request/user_merges_immediately_spec.rb b/spec/features/merge_request/user_merges_immediately_spec.rb index 64a357de1f7..bca6e6ceba5 100644 --- a/spec/features/merge_request/user_merges_immediately_spec.rb +++ b/spec/features/merge_request/user_merges_immediately_spec.rb @@ -36,7 +36,7 @@ RSpec.describe 'Merge requests > User merges immediately', :js do Sidekiq::Testing.fake! do click_button 'Merge immediately' - expect(find('.accept-merge-request.btn-info')).to have_content('Merge in progress') + expect(find('.accept-merge-request.btn-confirm')).to have_content('Merge in progress') wait_for_requests end diff --git a/spec/features/merge_request/user_sees_merge_request_pipelines_spec.rb b/spec/features/merge_request/user_sees_merge_request_pipelines_spec.rb index 85eb956033b..d555519eb43 100644 --- a/spec/features/merge_request/user_sees_merge_request_pipelines_spec.rb +++ b/spec/features/merge_request/user_sees_merge_request_pipelines_spec.rb @@ -25,6 +25,8 @@ RSpec.describe 'Merge request > User sees pipelines triggered by merge request', } end + let_it_be(:runner) { create(:ci_runner, :online) } + before do stub_application_setting(auto_devops_enabled: false) stub_ci_pipeline_yaml_file(YAML.dump(config)) diff --git a/spec/features/merge_request/user_sees_merge_widget_spec.rb b/spec/features/merge_request/user_sees_merge_widget_spec.rb index d9b5ec17a4a..a85700fc721 100644 --- a/spec/features/merge_request/user_sees_merge_widget_spec.rb +++ b/spec/features/merge_request/user_sees_merge_widget_spec.rb @@ -104,7 +104,7 @@ RSpec.describe 'Merge request > User sees merge widget', :js do before do create(:service, project: project, active: true, - type: 'CiService', + type: 'DroneCiService', category: 'ci') visit project_merge_request_path(project, merge_request) @@ -154,9 +154,9 @@ RSpec.describe 'Merge request > User sees merge widget', :js do end it 'shows information about blocked pipeline' do - expect(page).to have_content("Pipeline blocked") + expect(page).to have_content("Merge blocked") expect(page).to have_content( - "The pipeline for this merge request requires a manual action") + "pipeline must succeed. It's waiting for a manual action to continue.") expect(page).to have_css('.ci-status-icon-manual') end end @@ -274,10 +274,10 @@ RSpec.describe 'Merge request > User sees merge widget', :js do visit project_merge_request_path(project, merge_request) end - it 'has info button when MWBS button' do + it 'has confirm button when MWBS button' do # Wait for the `ci_status` and `merge_check` requests wait_for_requests - expect(page).to have_selector('.accept-merge-request.btn-info') + expect(page).to have_selector('.accept-merge-request.btn-confirm') end end @@ -432,7 +432,7 @@ RSpec.describe 'Merge request > User sees merge widget', :js do it 'user cannot remove source branch', :sidekiq_might_not_need_inline do expect(page).not_to have_field('remove-source-branch-input') - expect(page).to have_content('Deletes source branch') + expect(page).to have_content('The source branch will be deleted') end end diff --git a/spec/features/merge_request/user_sees_versions_spec.rb b/spec/features/merge_request/user_sees_versions_spec.rb index 8999c4d6656..34ae082750b 100644 --- a/spec/features/merge_request/user_sees_versions_spec.rb +++ b/spec/features/merge_request/user_sees_versions_spec.rb @@ -129,8 +129,8 @@ RSpec.describe 'Merge request > User sees versions', :js do ) expect(page).to have_content '4 files' - additions_content = page.find('.diff-stats.is-compare-versions-header .diff-stats-group .js-file-addition-line').text - deletions_content = page.find('.diff-stats.is-compare-versions-header .diff-stats-group .js-file-deletion-line').text + additions_content = page.find('.diff-stats.is-compare-versions-header .diff-stats-group [data-testid="js-file-addition-line"]').text + deletions_content = page.find('.diff-stats.is-compare-versions-header .diff-stats-group [data-testid="js-file-deletion-line"]').text expect(additions_content).to eq '15' expect(deletions_content).to eq '6' @@ -152,8 +152,8 @@ RSpec.describe 'Merge request > User sees versions', :js do end it 'show diff between new and old version' do - additions_content = page.find('.diff-stats.is-compare-versions-header .diff-stats-group .js-file-addition-line').text - deletions_content = page.find('.diff-stats.is-compare-versions-header .diff-stats-group .js-file-deletion-line').text + additions_content = page.find('.diff-stats.is-compare-versions-header .diff-stats-group [data-testid="js-file-addition-line"]').text + deletions_content = page.find('.diff-stats.is-compare-versions-header .diff-stats-group [data-testid="js-file-deletion-line"]').text expect(page).to have_content '4 files' expect(additions_content).to eq '15' diff --git a/spec/features/merge_request/user_views_diffs_spec.rb b/spec/features/merge_request/user_views_diffs_spec.rb index a0b3067994c..d5061657c59 100644 --- a/spec/features/merge_request/user_views_diffs_spec.rb +++ b/spec/features/merge_request/user_views_diffs_spec.rb @@ -66,6 +66,7 @@ RSpec.describe 'User views diffs', :js do expect(page).to have_button('Expand all') click_button 'Expand all' + wait_for_requests expect(page).not_to have_button('Expand all') end |