diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-03 06:08:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-03 06:08:02 +0300 |
commit | 173b547fb98ab12ae41f295915453e598be3a647 (patch) | |
tree | 2ade7b72b501275292e6984c6cba2cbaba9d9aa6 /spec | |
parent | a77c9fccd057514a8b78a10642779f54a22f3f76 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
4 files changed, 25 insertions, 45 deletions
diff --git a/spec/features/merge_request/user_merges_only_if_pipeline_succeeds_spec.rb b/spec/features/merge_request/user_merges_only_if_pipeline_succeeds_spec.rb index cdc00017ab3..43c8f793147 100644 --- a/spec/features/merge_request/user_merges_only_if_pipeline_succeeds_spec.rb +++ b/spec/features/merge_request/user_merges_only_if_pipeline_succeeds_spec.rb @@ -43,7 +43,7 @@ RSpec.describe 'Merge request > User merges only if pipeline succeeds', :js, fea wait_for_requests - expect(page).to have_button 'Merge when pipeline succeeds' + expect(page).to have_button 'Set auto-merge' expect(page).not_to have_button '.js-merge-moment' end end @@ -112,7 +112,7 @@ RSpec.describe 'Merge request > User merges only if pipeline succeeds', :js, fea wait_for_requests - expect(page).to have_button 'Merge when pipeline succeeds' + expect(page).to have_button 'Set auto-merge' page.find('.js-merge-moment').click expect(page).to have_content 'Merge immediately' 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 6d2c8f15a82..d0abf3439c0 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 @@ -30,10 +30,10 @@ RSpec.describe 'Merge request > User merges when pipeline succeeds', :js, featur visit project_merge_request_path(project, merge_request) end - describe 'enabling Merge when pipeline succeeds' do - shared_examples 'Merge when pipeline succeeds activator' do - it 'activates the Merge when pipeline succeeds feature' do - click_button "Merge when pipeline succeeds" + describe 'enabling set auto-merge' do + shared_examples 'auto-merge activator' do + it 'activates the set auto-merge feature' do + click_button "Set auto-merge" expect(page).to have_content "Set by #{user.name} to be merged automatically when the pipeline succeeds" expect(page).to have_content "Source branch will not be deleted" @@ -44,7 +44,7 @@ RSpec.describe 'Merge request > User merges when pipeline succeeds', :js, featur end context "when enabled immediately" do - it_behaves_like 'Merge when pipeline succeeds activator' + it_behaves_like 'auto-merge activator' end context 'when enabled after pipeline status changed', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/258667' do @@ -58,12 +58,12 @@ RSpec.describe 'Merge request > User merges when pipeline succeeds', :js, featur expect(page).to have_content "Pipeline ##{pipeline.id} running" end - it_behaves_like 'Merge when pipeline succeeds activator' + it_behaves_like 'auto-merge activator' end context 'when enabled after it was previously canceled' do before do - click_button "Merge when pipeline succeeds" + click_button "Set auto-merge" wait_for_requests @@ -71,10 +71,10 @@ RSpec.describe 'Merge request > User merges when pipeline succeeds', :js, featur wait_for_requests - expect(page).to have_content 'Merge when pipeline succeeds' + expect(page).to have_content 'Set auto-merge' end - it_behaves_like 'Merge when pipeline succeeds activator' + it_behaves_like 'auto-merge activator' end context 'when it was enabled and then canceled' do @@ -93,12 +93,12 @@ RSpec.describe 'Merge request > User merges when pipeline succeeds', :js, featur click_button "Cancel auto-merge" end - it_behaves_like 'Merge when pipeline succeeds activator' + it_behaves_like 'auto-merge activator' end end end - context 'when merge when pipeline succeeds is enabled' do + context 'when set auto-merge is enabled' do let(:merge_request) do create(:merge_request_with_diffs, :simple, :merge_when_pipeline_succeeds, source_project: project, @@ -119,7 +119,7 @@ RSpec.describe 'Merge request > User merges when pipeline succeeds', :js, featur it 'allows to cancel the automatic merge' do click_button "Cancel auto-merge" - expect(page).to have_button "Merge when pipeline succeeds" + expect(page).to have_button "Set auto-merge" refresh @@ -138,7 +138,7 @@ RSpec.describe 'Merge request > User merges when pipeline succeeds', :js, featur end end - context 'view merge request with MWPS enabled but automatically merge fails' do + context 'view merge request with set auto-merge enabled but automatically merge fails' do before do merge_request.update!( merge_user: merge_request.author, @@ -157,7 +157,7 @@ RSpec.describe 'Merge request > User merges when pipeline succeeds', :js, featur end end - context 'view merge request with MWPS enabled but automatically merge fails' do + context 'view merge request with set auto-merge enabled but automatically merge fails' do before do merge_request.update!( merge_user: merge_request.author, @@ -181,7 +181,7 @@ RSpec.describe 'Merge request > User merges when pipeline succeeds', :js, featur it 'does not allow to enable merge when pipeline succeeds' do visit project_merge_request_path(project, merge_request) - expect(page).not_to have_link 'Merge when pipeline succeeds' + expect(page).not_to have_link 'Set auto-merge' 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 458746f0854..e9eb8a90b14 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 @@ -145,7 +145,7 @@ RSpec.describe 'Merge request > User sees pipelines triggered by merge request', context 'when a user merges a merge request in the parent project', :sidekiq_might_not_need_inline do before do click_link 'Overview' - click_button 'Merge when pipeline succeeds' + click_button 'Set auto-merge' wait_for_requests end @@ -358,10 +358,10 @@ RSpec.describe 'Merge request > User sees pipelines triggered by merge request', project.update!(only_allow_merge_if_pipeline_succeeds: true) end - it 'shows MWPS button' do + it 'shows set auto-merge button' do visit project_merge_request_path(project, merge_request) - expect(page).to have_button('Merge when pipeline succeeds') + expect(page).to have_button('Set auto-merge') end end end @@ -371,7 +371,7 @@ RSpec.describe 'Merge request > User sees pipelines triggered by merge request', before do click_link("Overview") - click_button 'Merge when pipeline succeeds' + click_button 'Set auto-merge' wait_for_requests end diff --git a/spec/frontend/vue_merge_request_widget/components/states/mr_widget_ready_to_merge_spec.js b/spec/frontend/vue_merge_request_widget/components/states/mr_widget_ready_to_merge_spec.js index 1e4e089e7c1..080e3af5254 100644 --- a/spec/frontend/vue_merge_request_widget/components/states/mr_widget_ready_to_merge_spec.js +++ b/spec/frontend/vue_merge_request_widget/components/states/mr_widget_ready_to_merge_spec.js @@ -180,26 +180,6 @@ describe('ReadyToMerge', () => { expect(wrapper.vm.status).toEqual('failed'); }); }); - - describe('status icon', () => { - it('defaults to tick icon', () => { - createComponent({ mr: { mergeable: true } }); - - expect(wrapper.vm.iconClass).toEqual('success'); - }); - - it('shows tick for success status', () => { - createComponent({ mr: { pipeline: { status: 'SUCCESS' }, mergeable: true } }); - - expect(wrapper.vm.iconClass).toEqual('success'); - }); - - it('shows tick for pending status', () => { - createComponent({ mr: { pipeline: { active: true }, mergeable: true } }); - - expect(wrapper.vm.iconClass).toEqual('success'); - }); - }); }); describe('merge button text', () => { @@ -209,18 +189,18 @@ describe('ReadyToMerge', () => { expect(findMergeButton().text()).toBe('Merge'); }); - it('should return "Merge when pipeline succeeds" when the MWPS auto merge strategy is available', () => { + it('should return "Set auto-merge" when the MWPS auto merge strategy is available', () => { createComponent({ mr: { preferredAutoMergeStrategy: MWPS_MERGE_STRATEGY }, }); - expect(findMergeButton().text()).toBe('Merge when pipeline succeeds'); + expect(findMergeButton().text()).toBe('Set auto-merge'); }); - it('should return Merge when pipeline succeeds', () => { + it('should return set auto-merge', () => { createComponent({ mr: { preferredAutoMergeStrategy: MWPS_MERGE_STRATEGY } }); - expect(findMergeButton().text()).toBe('Merge when pipeline succeeds'); + expect(findMergeButton().text()).toBe('Set auto-merge'); }); }); |