diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
commit | b76ae638462ab0f673e5915986070518dd3f9ad3 (patch) | |
tree | bdab0533383b52873be0ec0eb4d3c66598ff8b91 /spec/features/merge_request | |
parent | 434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff) |
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'spec/features/merge_request')
6 files changed, 44 insertions, 36 deletions
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 9e1b0135932..af5ba14e310 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 @@ -64,7 +64,7 @@ RSpec.describe 'Merge request > User merges when pipeline succeeds', :js do context 'when enabled after it was previously canceled' do before do click_button "Merge when pipeline succeeds" - click_link "Cancel" + click_button "Cancel auto-merge" wait_for_requests @@ -87,7 +87,7 @@ RSpec.describe 'Merge request > User merges when pipeline succeeds', :js do before do merge_request.merge_params['force_remove_source_branch'] = '0' merge_request.save! - click_link "Cancel" + click_button "Cancel auto-merge" end it_behaves_like 'Merge when pipeline succeeds activator' @@ -114,7 +114,7 @@ RSpec.describe 'Merge request > User merges when pipeline succeeds', :js do end it 'allows to cancel the automatic merge' do - click_link "Cancel" + click_button "Cancel auto-merge" expect(page).to have_button "Merge when pipeline succeeds" @@ -124,7 +124,7 @@ RSpec.describe 'Merge request > User merges when pipeline succeeds', :js do end it 'allows to delete source branch' do - click_link "Delete source branch" + click_button "Delete source branch" expect(page).to have_content "The source branch will be deleted" end diff --git a/spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb b/spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb index 73e628bda98..8343e04aef1 100644 --- a/spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb +++ b/spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb @@ -63,7 +63,7 @@ RSpec.describe 'Merge request > User resolves diff notes and threads', :js do it 'allows user to mark thread as resolved' do page.within '.diff-content' do - find('button[data-qa-selector="resolve_discussion_button"]').click + find('button[data-qa-selector="resolve_discussion_button"]').click # rubocop:disable QA/SelectorUsage end expect(page).to have_selector('.discussion-body', visible: false) @@ -80,7 +80,7 @@ RSpec.describe 'Merge request > User resolves diff notes and threads', :js do it 'allows user to unresolve thread' do page.within '.diff-content' do - find('button[data-qa-selector="resolve_discussion_button"]').click + find('button[data-qa-selector="resolve_discussion_button"]').click # rubocop:disable QA/SelectorUsage click_button 'Unresolve thread' end @@ -92,7 +92,7 @@ RSpec.describe 'Merge request > User resolves diff notes and threads', :js do describe 'resolved thread' do before do page.within '.diff-content' do - find('button[data-qa-selector="resolve_discussion_button"]').click + find('button[data-qa-selector="resolve_discussion_button"]').click # rubocop:disable QA/SelectorUsage end visit_merge_request @@ -193,7 +193,7 @@ RSpec.describe 'Merge request > User resolves diff notes and threads', :js do it 'allows user to resolve from reply form without a comment' do page.within '.diff-content' do - find('button[data-qa-selector="resolve_discussion_button"]').click + find('button[data-qa-selector="resolve_discussion_button"]').click # rubocop:disable QA/SelectorUsage end page.within '.line-resolve-all-container' do @@ -230,7 +230,7 @@ RSpec.describe 'Merge request > User resolves diff notes and threads', :js do it 'hides jump to next button when all resolved' do page.within '.diff-content' do - find('button[data-qa-selector="resolve_discussion_button"]').click + find('button[data-qa-selector="resolve_discussion_button"]').click # rubocop:disable QA/SelectorUsage end expect(page).to have_selector('.discussion-next-btn', visible: false) @@ -326,7 +326,7 @@ RSpec.describe 'Merge request > User resolves diff notes and threads', :js do it 'allows user to mark all threads as resolved' do page.all('.discussion-reply-holder', count: 2).each do |reply_holder| page.within reply_holder do - find('button[data-qa-selector="resolve_discussion_button"]').click + find('button[data-qa-selector="resolve_discussion_button"]').click # rubocop:disable QA/SelectorUsage end end @@ -338,7 +338,7 @@ RSpec.describe 'Merge request > User resolves diff notes and threads', :js do it 'allows user to quickly scroll to next unresolved thread' do page.within('.discussion-reply-holder', match: :first) do - find('button[data-qa-selector="resolve_discussion_button"]').click + find('button[data-qa-selector="resolve_discussion_button"]').click # rubocop:disable QA/SelectorUsage end page.within '.line-resolve-all-container' do @@ -410,7 +410,7 @@ RSpec.describe 'Merge request > User resolves diff notes and threads', :js do it 'allows user to mark thread as resolved' do page.within '.diff-content' do - find('button[data-qa-selector="resolve_discussion_button"]').click + find('button[data-qa-selector="resolve_discussion_button"]').click # rubocop:disable QA/SelectorUsage end page.within '.diff-content .note' do @@ -425,7 +425,7 @@ RSpec.describe 'Merge request > User resolves diff notes and threads', :js do it 'allows user to unresolve thread' do page.within '.diff-content' do - find('button[data-qa-selector="resolve_discussion_button"]').click + find('button[data-qa-selector="resolve_discussion_button"]').click # rubocop:disable QA/SelectorUsage click_button 'Unresolve thread' end @@ -453,7 +453,7 @@ RSpec.describe 'Merge request > User resolves diff notes and threads', :js do it 'allows user to comment & unresolve thread' do page.within '.diff-content' do - find('button[data-qa-selector="resolve_discussion_button"]').click + find('button[data-qa-selector="resolve_discussion_button"]').click # rubocop:disable QA/SelectorUsage find_field('Reply…').click diff --git a/spec/features/merge_request/user_sees_closing_issues_message_spec.rb b/spec/features/merge_request/user_sees_closing_issues_message_spec.rb index d6cdc15005b..7b7fff5c936 100644 --- a/spec/features/merge_request/user_sees_closing_issues_message_spec.rb +++ b/spec/features/merge_request/user_sees_closing_issues_message_spec.rb @@ -31,7 +31,7 @@ RSpec.describe 'Merge request > User sees closing issues message', :js do let(:merge_request_description) { "Description\n\nclosing #{issue_1.to_reference}, #{issue_2.to_reference}" } it 'does not display closing issue message' do - expect(page).to have_content("Closes #{issue_1.to_reference} and #{issue_2.to_reference}") + expect(page).to have_content("Closes issues #{issue_1.to_reference} and #{issue_2.to_reference}") end end @@ -39,7 +39,7 @@ RSpec.describe 'Merge request > User sees closing issues message', :js do let(:merge_request_description) { "Description\n\nRefers to #{issue_1.to_reference} and #{issue_2.to_reference}" } it 'does not display closing issue message' do - expect(page).to have_content("Mentions #{issue_1.to_reference} and #{issue_2.to_reference}") + expect(page).to have_content("Mentions issues #{issue_1.to_reference} and #{issue_2.to_reference}") end end @@ -47,8 +47,8 @@ RSpec.describe 'Merge request > User sees closing issues message', :js do let(:merge_request_title) { "closes #{issue_1.to_reference}\n\n refers to #{issue_2.to_reference}" } it 'does not display closing issue message' do - expect(page).to have_content("Closes #{issue_1.to_reference}") - expect(page).to have_content("Mentions #{issue_2.to_reference}") + expect(page).to have_content("Closes issue #{issue_1.to_reference}") + expect(page).to have_content("Mentions issue #{issue_2.to_reference}") end end @@ -56,7 +56,7 @@ RSpec.describe 'Merge request > User sees closing issues message', :js do let(:merge_request_title) { "closing #{issue_1.to_reference}, #{issue_2.to_reference}" } it 'does not display closing issue message' do - expect(page).to have_content("Closes #{issue_1.to_reference} and #{issue_2.to_reference}") + expect(page).to have_content("Closes issues #{issue_1.to_reference} and #{issue_2.to_reference}") end end @@ -64,7 +64,7 @@ RSpec.describe 'Merge request > User sees closing issues message', :js do let(:merge_request_title) { "Refers to #{issue_1.to_reference} and #{issue_2.to_reference}" } it 'does not display closing issue message' do - expect(page).to have_content("Mentions #{issue_1.to_reference} and #{issue_2.to_reference}") + expect(page).to have_content("Mentions issues #{issue_1.to_reference} and #{issue_2.to_reference}") end end @@ -72,8 +72,8 @@ RSpec.describe 'Merge request > User sees closing issues message', :js do let(:merge_request_title) { "closes #{issue_1.to_reference}\n\n refers to #{issue_2.to_reference}" } it 'does not display closing issue message' do - expect(page).to have_content("Closes #{issue_1.to_reference}") - expect(page).to have_content("Mentions #{issue_2.to_reference}") + expect(page).to have_content("Closes issue #{issue_1.to_reference}") + expect(page).to have_content("Mentions issue #{issue_2.to_reference}") end end 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..2a49109d360 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 @@ -43,12 +43,14 @@ RSpec.describe 'Merge request > User sees pipelines triggered by merge request', let!(:push_pipeline) do Ci::CreatePipelineService.new(project, user, ref: 'feature') - .execute(:push) + .execute(:push) + .payload end let!(:detached_merge_request_pipeline) do Ci::CreatePipelineService.new(project, user, ref: 'feature') - .execute(:merge_request_event, merge_request: merge_request) + .execute(:merge_request_event, merge_request: merge_request) + .payload end before do @@ -77,12 +79,14 @@ RSpec.describe 'Merge request > User sees pipelines triggered by merge request', context 'when a user updated a merge request in the parent project', :sidekiq_might_not_need_inline do let!(:push_pipeline_2) do Ci::CreatePipelineService.new(project, user, ref: 'feature') - .execute(:push) + .execute(:push) + .payload end let!(:detached_merge_request_pipeline_2) do Ci::CreatePipelineService.new(project, user, ref: 'feature') - .execute(:merge_request_event, merge_request: merge_request) + .execute(:merge_request_event, merge_request: merge_request) + .payload end before do @@ -147,7 +151,7 @@ RSpec.describe 'Merge request > User sees pipelines triggered by merge request', context 'when detached merge request pipeline is pending' do it 'waits the head pipeline' do expect(page).to have_content('to be merged automatically when the pipeline succeeds') - expect(page).to have_link('Cancel') + expect(page).to have_button('Cancel auto-merge') end end @@ -174,7 +178,7 @@ RSpec.describe 'Merge request > User sees pipelines triggered by merge request', it 'waits the head pipeline' do expect(page).to have_content('to be merged automatically when the pipeline succeeds') - expect(page).to have_link('Cancel') + expect(page).to have_button('Cancel auto-merge') end end end @@ -222,12 +226,14 @@ RSpec.describe 'Merge request > User sees pipelines triggered by merge request', let!(:push_pipeline) do Ci::CreatePipelineService.new(forked_project, user2, ref: 'feature') - .execute(:push) + .execute(:push) + .payload end let!(:detached_merge_request_pipeline) do Ci::CreatePipelineService.new(forked_project, user2, ref: 'feature') - .execute(:merge_request_event, merge_request: merge_request) + .execute(:merge_request_event, merge_request: merge_request) + .payload end let(:forked_project) { fork_project(project, user2, repository: true) } @@ -267,12 +273,14 @@ RSpec.describe 'Merge request > User sees pipelines triggered by merge request', context 'when a user updated a merge request from a forked project to the parent project' do let!(:push_pipeline_2) do Ci::CreatePipelineService.new(forked_project, user2, ref: 'feature') - .execute(:push) + .execute(:push) + .payload end let!(:detached_merge_request_pipeline_2) do Ci::CreatePipelineService.new(forked_project, user2, ref: 'feature') - .execute(:merge_request_event, merge_request: merge_request) + .execute(:merge_request_event, merge_request: merge_request) + .payload end before do @@ -369,7 +377,7 @@ RSpec.describe 'Merge request > User sees pipelines triggered by merge request', context 'when detached merge request pipeline is pending' do it 'waits the head pipeline' do expect(page).to have_content('to be merged automatically when the pipeline succeeds') - expect(page).to have_link('Cancel') + expect(page).to have_button('Cancel auto-merge') end end @@ -395,7 +403,7 @@ RSpec.describe 'Merge request > User sees pipelines triggered by merge request', it 'waits the head pipeline' do expect(page).to have_content('to be merged automatically when the pipeline succeeds') - expect(page).to have_link('Cancel') + expect(page).to have_button('Cancel auto-merge') end end end diff --git a/spec/features/merge_request/user_sees_pipelines_spec.rb b/spec/features/merge_request/user_sees_pipelines_spec.rb index a6c8b10f5ca..4967f58528e 100644 --- a/spec/features/merge_request/user_sees_pipelines_spec.rb +++ b/spec/features/merge_request/user_sees_pipelines_spec.rb @@ -245,7 +245,7 @@ RSpec.describe 'Merge request > User sees pipelines', :js do threads << Thread.new do Sidekiq::Worker.skipping_transaction_check do - @pipeline = Ci::CreatePipelineService.new(project, user, build_push_data).execute(:push) + @pipeline = Ci::CreatePipelineService.new(project, user, build_push_data).execute(:push).payload end end diff --git a/spec/features/merge_request/user_views_diffs_spec.rb b/spec/features/merge_request/user_views_diffs_spec.rb index 09dfe41a718..208ed1f01e7 100644 --- a/spec/features/merge_request/user_views_diffs_spec.rb +++ b/spec/features/merge_request/user_views_diffs_spec.rb @@ -60,7 +60,7 @@ RSpec.describe 'User views diffs', :js do expect(page).not_to have_selector('.mr-loading-status .loading', visible: true) end - it 'expands all diffs' do + it 'expands all diffs', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/333628' do first('.diff-toggle-caret').click expect(page).to have_button('Expand all') |