summaryrefslogtreecommitdiff
path: root/spec/features/merge_request
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/merge_request')
-rw-r--r--spec/features/merge_request/user_approves_spec.rb2
-rw-r--r--spec/features/merge_request/user_assigns_themselves_spec.rb2
-rw-r--r--spec/features/merge_request/user_comments_on_diff_spec.rb1
-rw-r--r--spec/features/merge_request/user_customizes_merge_commit_message_spec.rb26
-rw-r--r--spec/features/merge_request/user_merges_when_pipeline_succeeds_spec.rb4
-rw-r--r--spec/features/merge_request/user_posts_diff_notes_spec.rb7
-rw-r--r--spec/features/merge_request/user_posts_notes_spec.rb2
-rw-r--r--spec/features/merge_request/user_sees_avatar_on_diff_notes_spec.rb1
-rw-r--r--spec/features/merge_request/user_sees_deployment_widget_spec.rb1
-rw-r--r--spec/features/merge_request/user_sees_merge_widget_spec.rb2
-rw-r--r--spec/features/merge_request/user_sees_suggest_pipeline_spec.rb40
11 files changed, 37 insertions, 51 deletions
diff --git a/spec/features/merge_request/user_approves_spec.rb b/spec/features/merge_request/user_approves_spec.rb
index f401dd598f3..4f7bcb58551 100644
--- a/spec/features/merge_request/user_approves_spec.rb
+++ b/spec/features/merge_request/user_approves_spec.rb
@@ -17,7 +17,7 @@ RSpec.describe 'Merge request > User approves', :js do
it 'approves merge request' do
click_approval_button('Approve')
- expect(page).to have_content('Merge request approved')
+ expect(page).to have_content('Approved by you')
verify_approvals_count_on_index!
diff --git a/spec/features/merge_request/user_assigns_themselves_spec.rb b/spec/features/merge_request/user_assigns_themselves_spec.rb
index 04d401683bf..fc925781a3b 100644
--- a/spec/features/merge_request/user_assigns_themselves_spec.rb
+++ b/spec/features/merge_request/user_assigns_themselves_spec.rb
@@ -15,7 +15,7 @@ RSpec.describe 'Merge request > User assigns themselves' do
visit project_merge_request_path(project, merge_request)
end
- it 'updates related issues', :js do
+ it 'updates related issues', :js, quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/343006' do
click_link 'Assign yourself to these issues'
expect(page).to have_content '2 issues have been assigned to you'
diff --git a/spec/features/merge_request/user_comments_on_diff_spec.rb b/spec/features/merge_request/user_comments_on_diff_spec.rb
index 54c3fe738d2..f9b554c5ed2 100644
--- a/spec/features/merge_request/user_comments_on_diff_spec.rb
+++ b/spec/features/merge_request/user_comments_on_diff_spec.rb
@@ -14,6 +14,7 @@ RSpec.describe 'User comments on a diff', :js do
let(:user) { create(:user) }
before do
+ stub_feature_flags(bootstrap_confirmation_modals: false)
project.add_maintainer(user)
sign_in(user)
diff --git a/spec/features/merge_request/user_customizes_merge_commit_message_spec.rb b/spec/features/merge_request/user_customizes_merge_commit_message_spec.rb
index 1d3d76d3486..06795344c5c 100644
--- a/spec/features/merge_request/user_customizes_merge_commit_message_spec.rb
+++ b/spec/features/merge_request/user_customizes_merge_commit_message_spec.rb
@@ -26,33 +26,27 @@ RSpec.describe 'Merge request < User customizes merge commit message', :js do
].join("\n\n")
end
- let(:message_with_description) do
- [
- "Merge branch 'feature' into 'master'",
- merge_request.title,
- merge_request.description,
- "See merge request #{merge_request.to_reference(full: true)}"
- ].join("\n\n")
- end
-
before do
project.add_maintainer(user)
sign_in(user)
visit project_merge_request_path(project, merge_request)
end
- it 'toggles commit message between message with description and without description' do
+ it 'has commit message without description' do
expect(page).not_to have_selector('#merge-message-edit')
first('.js-mr-widget-commits-count').click
expect(textbox).to be_visible
expect(textbox.value).to eq(default_message)
+ end
- check('Include merge request description')
-
- expect(textbox.value).to eq(message_with_description)
-
- uncheck('Include merge request description')
+ context 'when target project has merge commit template set' do
+ let(:project) { create(:project, :public, :repository, merge_commit_template: '%{title}') }
- expect(textbox.value).to eq(default_message)
+ it 'uses merge commit template' do
+ expect(page).not_to have_selector('#merge-message-edit')
+ first('.js-mr-widget-commits-count').click
+ expect(textbox).to be_visible
+ expect(textbox.value).to eq(merge_request.title)
+ end
end
end
diff --git a/spec/features/merge_request/user_merges_when_pipeline_succeeds_spec.rb b/spec/features/merge_request/user_merges_when_pipeline_succeeds_spec.rb
index af5ba14e310..9057b96bff0 100644
--- a/spec/features/merge_request/user_merges_when_pipeline_succeeds_spec.rb
+++ b/spec/features/merge_request/user_merges_when_pipeline_succeeds_spec.rb
@@ -36,7 +36,7 @@ RSpec.describe 'Merge request > User merges when pipeline succeeds', :js do
click_button "Merge when pipeline succeeds"
expect(page).to have_content "Set by #{user.name} to be merged automatically when the pipeline succeeds"
- expect(page).to have_content "The source branch will not be deleted"
+ expect(page).to have_content "Does not delete the source branch"
expect(page).to have_selector ".js-cancel-auto-merge"
visit project_merge_request_path(project, merge_request) # Needed to refresh the page
expect(page).to have_content /enabled an automatic merge when the pipeline for \h{8} succeeds/i
@@ -126,7 +126,7 @@ RSpec.describe 'Merge request > User merges when pipeline succeeds', :js do
it 'allows to delete source branch' do
click_button "Delete source branch"
- expect(page).to have_content "The source branch will be deleted"
+ expect(page).to have_content "Deletes the source branch"
end
context 'when pipeline succeeds' do
diff --git a/spec/features/merge_request/user_posts_diff_notes_spec.rb b/spec/features/merge_request/user_posts_diff_notes_spec.rb
index c339a7d9976..79e46e69157 100644
--- a/spec/features/merge_request/user_posts_diff_notes_spec.rb
+++ b/spec/features/merge_request/user_posts_diff_notes_spec.rb
@@ -18,6 +18,7 @@ RSpec.describe 'Merge request > User posts diff notes', :js do
project.add_developer(user)
sign_in(user)
+ stub_feature_flags(bootstrap_confirmation_modals: false)
end
context 'when hovering over a parallel view diff file' do
@@ -237,8 +238,10 @@ RSpec.describe 'Merge request > User posts diff notes', :js do
def should_allow_dismissing_a_comment(line_holder, diff_side = nil)
write_comment_on_line(line_holder, diff_side)
- accept_confirm do
- find('.js-close-discussion-note-form').click
+ find('.js-close-discussion-note-form').click
+
+ page.within('.modal') do
+ click_button 'OK'
end
assert_comment_dismissal(line_holder)
diff --git a/spec/features/merge_request/user_posts_notes_spec.rb b/spec/features/merge_request/user_posts_notes_spec.rb
index 83d9388914b..0416474218f 100644
--- a/spec/features/merge_request/user_posts_notes_spec.rb
+++ b/spec/features/merge_request/user_posts_notes_spec.rb
@@ -18,8 +18,10 @@ RSpec.describe 'Merge request > User posts notes', :js do
end
before do
+ stub_feature_flags(bootstrap_confirmation_modals: false)
project.add_maintainer(user)
sign_in(user)
+
visit project_merge_request_path(project, merge_request)
end
diff --git a/spec/features/merge_request/user_sees_avatar_on_diff_notes_spec.rb b/spec/features/merge_request/user_sees_avatar_on_diff_notes_spec.rb
index 90cdc28d1bd..64cd5aa2bb1 100644
--- a/spec/features/merge_request/user_sees_avatar_on_diff_notes_spec.rb
+++ b/spec/features/merge_request/user_sees_avatar_on_diff_notes_spec.rb
@@ -79,6 +79,7 @@ RSpec.describe 'Merge request > User sees avatars on diff notes', :js do
%w(parallel).each do |view|
context "#{view} view" do
before do
+ stub_feature_flags(bootstrap_confirmation_modals: false)
visit diffs_project_merge_request_path(project, merge_request, view: view)
wait_for_requests
diff --git a/spec/features/merge_request/user_sees_deployment_widget_spec.rb b/spec/features/merge_request/user_sees_deployment_widget_spec.rb
index 873cc0a89c6..345404cc28f 100644
--- a/spec/features/merge_request/user_sees_deployment_widget_spec.rb
+++ b/spec/features/merge_request/user_sees_deployment_widget_spec.rb
@@ -110,6 +110,7 @@ RSpec.describe 'Merge request > User sees deployment widget', :js do
let(:manual) { create(:ci_build, :manual, pipeline: pipeline, name: 'close_app') }
before do
+ stub_feature_flags(bootstrap_confirmation_modals: false)
build.success!
deployment.update!(on_stop: manual.name)
visit project_merge_request_path(project, merge_request)
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 f74b097ab3e..0117cf01e53 100644
--- a/spec/features/merge_request/user_sees_merge_widget_spec.rb
+++ b/spec/features/merge_request/user_sees_merge_widget_spec.rb
@@ -426,7 +426,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('The source branch will be deleted')
+ expect(page).to have_content('Deletes the source branch')
end
end
diff --git a/spec/features/merge_request/user_sees_suggest_pipeline_spec.rb b/spec/features/merge_request/user_sees_suggest_pipeline_spec.rb
index 3893a9cdf28..2191849edd9 100644
--- a/spec/features/merge_request/user_sees_suggest_pipeline_spec.rb
+++ b/spec/features/merge_request/user_sees_suggest_pipeline_spec.rb
@@ -16,7 +16,8 @@ RSpec.describe 'Merge request > User sees suggest pipeline', :js do
end
it 'shows the suggest pipeline widget and then allows dismissal correctly' do
- expect(page).to have_content('Are you adding technical debt or code vulnerabilities?')
+ content = 'GitLab CI/CD can automatically build, test, and deploy your application'
+ expect(page).to have_content(content)
page.within '.mr-pipeline-suggest' do
find('[data-testid="close"]').click
@@ -24,17 +25,16 @@ RSpec.describe 'Merge request > User sees suggest pipeline', :js do
wait_for_requests
- expect(page).not_to have_content('Are you adding technical debt or code vulnerabilities?')
+ expect(page).not_to have_content(content)
# Reload so we know the user callout was registered
visit page.current_url
- expect(page).not_to have_content('Are you adding technical debt or code vulnerabilities?')
+ expect(page).not_to have_content(content)
end
- it 'runs tour from start to finish ensuring all nudges are executed' do
- # nudge 1
- expect(page).to have_content('Are you adding technical debt or code vulnerabilities?')
+ it 'takes the user to the pipeline editor with a pre-filled CI config file form' do
+ expect(page).to have_content('GitLab CI/CD can automatically build, test, and deploy your application')
page.within '.mr-pipeline-suggest' do
find('[data-testid="ok"]').click
@@ -42,30 +42,14 @@ RSpec.describe 'Merge request > User sees suggest pipeline', :js do
wait_for_requests
- # nudge 2
- expect(page).to have_content('Choose Code Quality to add a pipeline that tests the quality of your code.')
+ # Drawer is open
+ expect(page).to have_content('This template creates a simple test pipeline. To use it:')
- find('.js-gitlab-ci-yml-selector').click
+ # Editor shows template
+ expect(page).to have_content('This file is a template, and might need editing before it works on your project.')
- wait_for_requests
-
- within '.gitlab-ci-yml-selector' do
- find('.dropdown-input-field').set('Jekyll')
- find('.dropdown-content li', text: 'Jekyll').click
- end
-
- wait_for_requests
-
- expect(page).not_to have_content('Choose Code Quality to add a pipeline that tests the quality of your code.')
- # nudge 3
- expect(page).to have_content('The template is ready!')
-
- find('#commit-changes').click
-
- wait_for_requests
-
- # nudge 4
- expect(page).to have_content("That's it, well done!")
+ # Commit form is shown
+ expect(page).to have_button('Commit changes')
end
context 'when feature setting is disabled' do