Commit 063e081c authored by Marcel van Remmerden's avatar Marcel van Remmerden Committed by Ezekiel Kigbo

Resolve "Fix inconsistent cancel merge train button label"

parent f963a7b0
...@@ -9,7 +9,7 @@ export default { ...@@ -9,7 +9,7 @@ export default {
return s__('mrWidget|to be merged automatically when the pipeline succeeds'); return s__('mrWidget|to be merged automatically when the pipeline succeeds');
}, },
cancelButtonText() { cancelButtonText() {
return s__('mrWidget|Cancel automatic merge'); return s__('mrWidget|Cancel');
}, },
}, },
}; };
---
title: Fix inconsistent cancel merge train button label
merge_request: 61597
author:
type: other
...@@ -32,7 +32,7 @@ export default { ...@@ -32,7 +32,7 @@ export default {
return s__('mrWidget|Remove from merge train'); return s__('mrWidget|Remove from merge train');
} }
return s__('mrWidget|Cancel automatic merge'); return s__('mrWidget|Cancel');
}, },
}, },
}; };
...@@ -59,14 +59,14 @@ RSpec.describe 'User adds to merge train when pipeline succeeds', :js do ...@@ -59,14 +59,14 @@ RSpec.describe 'User adds to merge train when pipeline succeeds', :js do
within('.mr-widget-section') do within('.mr-widget-section') do
expect(page).to have_content("Set by #{user.name} to start a merge train when the pipeline succeeds") expect(page).to have_content("Set by #{user.name} to start a merge train when the pipeline succeeds")
expect(page).to have_content('The source branch will not be deleted') expect(page).to have_content('The source branch will not be deleted')
expect(page).to have_link('Cancel automatic merge') expect(page).to have_link('Cancel')
expect(page).to have_link('Delete source branch') expect(page).to have_link('Delete source branch')
end end
end end
context "when user clicks 'Cancel automatic merge' button" do context "when user clicks 'Cancel' button" do
before do before do
click_link 'Cancel automatic merge' click_link 'Cancel'
end end
it 'cancels automatic merge' do it 'cancels automatic merge' do
......
...@@ -99,7 +99,7 @@ describe('MRWidgetAutoMergeEnabled', () => { ...@@ -99,7 +99,7 @@ describe('MRWidgetAutoMergeEnabled', () => {
it('should return "Cancel start merge train" if MTWPS is selected', () => { it('should return "Cancel start merge train" if MTWPS is selected', () => {
factory({ autoMergeStrategy: MTWPS_MERGE_STRATEGY }); factory({ autoMergeStrategy: MTWPS_MERGE_STRATEGY });
expect(vm.cancelButtonText).toBe('Cancel automatic merge'); expect(vm.cancelButtonText).toBe('Cancel');
}); });
it('should return "Remove from merge train" if the pipeline has been added to the merge train', () => { it('should return "Remove from merge train" if the pipeline has been added to the merge train', () => {
...@@ -108,10 +108,10 @@ describe('MRWidgetAutoMergeEnabled', () => { ...@@ -108,10 +108,10 @@ describe('MRWidgetAutoMergeEnabled', () => {
expect(vm.cancelButtonText).toBe('Remove from merge train'); expect(vm.cancelButtonText).toBe('Remove from merge train');
}); });
it('should return "Cancel automatic merge" if MWPS is selected', () => { it('should return "Cancel" if MWPS is selected', () => {
factory({ autoMergeStrategy: MWPS_MERGE_STRATEGY }); factory({ autoMergeStrategy: MWPS_MERGE_STRATEGY });
expect(vm.cancelButtonText).toBe('Cancel automatic merge'); expect(vm.cancelButtonText).toBe('Cancel');
}); });
}); });
}); });
...@@ -139,12 +139,12 @@ describe('MRWidgetAutoMergeEnabled', () => { ...@@ -139,12 +139,12 @@ describe('MRWidgetAutoMergeEnabled', () => {
expect(statusText).toBe('to be added to the merge train when the pipeline succeeds'); expect(statusText).toBe('to be added to the merge train when the pipeline succeeds');
}); });
it('should render the cancel button as "Cancel automatic merge" if MTWPS is selected', () => { it('should render the cancel button as "Cancel" if MTWPS is selected', () => {
factory({ autoMergeStrategy: MTWPS_MERGE_STRATEGY }); factory({ autoMergeStrategy: MTWPS_MERGE_STRATEGY });
const cancelButtonText = wrapper.find('.js-cancel-auto-merge').text(); const cancelButtonText = wrapper.find('.js-cancel-auto-merge').text();
expect(cancelButtonText).toBe('Cancel automatic merge'); expect(cancelButtonText).toBe('Cancel');
}); });
}); });
......
...@@ -38600,7 +38600,7 @@ msgstr "" ...@@ -38600,7 +38600,7 @@ msgstr ""
msgid "mrWidget|Are you adding technical debt or code vulnerabilities?" msgid "mrWidget|Are you adding technical debt or code vulnerabilities?"
msgstr "" msgstr ""
msgid "mrWidget|Cancel automatic merge" msgid "mrWidget|Cancel"
msgstr "" msgstr ""
msgid "mrWidget|Check out branch" msgid "mrWidget|Check out branch"
......
...@@ -64,7 +64,7 @@ RSpec.describe 'Merge request > User merges when pipeline succeeds', :js do ...@@ -64,7 +64,7 @@ RSpec.describe 'Merge request > User merges when pipeline succeeds', :js do
context 'when enabled after it was previously canceled' do context 'when enabled after it was previously canceled' do
before do before do
click_button "Merge when pipeline succeeds" click_button "Merge when pipeline succeeds"
click_link "Cancel automatic merge" click_link "Cancel"
wait_for_requests wait_for_requests
...@@ -87,7 +87,7 @@ RSpec.describe 'Merge request > User merges when pipeline succeeds', :js do ...@@ -87,7 +87,7 @@ RSpec.describe 'Merge request > User merges when pipeline succeeds', :js do
before do before do
merge_request.merge_params['force_remove_source_branch'] = '0' merge_request.merge_params['force_remove_source_branch'] = '0'
merge_request.save! merge_request.save!
click_link "Cancel automatic merge" click_link "Cancel"
end end
it_behaves_like 'Merge when pipeline succeeds activator' it_behaves_like 'Merge when pipeline succeeds activator'
...@@ -114,7 +114,7 @@ RSpec.describe 'Merge request > User merges when pipeline succeeds', :js do ...@@ -114,7 +114,7 @@ RSpec.describe 'Merge request > User merges when pipeline succeeds', :js do
end end
it 'allows to cancel the automatic merge' do it 'allows to cancel the automatic merge' do
click_link "Cancel automatic merge" click_link "Cancel"
expect(page).to have_button "Merge when pipeline succeeds" expect(page).to have_button "Merge when pipeline succeeds"
......
...@@ -147,7 +147,7 @@ RSpec.describe 'Merge request > User sees pipelines triggered by merge request', ...@@ -147,7 +147,7 @@ RSpec.describe 'Merge request > User sees pipelines triggered by merge request',
context 'when detached merge request pipeline is pending' do context 'when detached merge request pipeline is pending' do
it 'waits the head pipeline' do it 'waits the head pipeline' do
expect(page).to have_content('to be merged automatically when the pipeline succeeds') expect(page).to have_content('to be merged automatically when the pipeline succeeds')
expect(page).to have_link('Cancel automatic merge') expect(page).to have_link('Cancel')
end end
end end
...@@ -174,7 +174,7 @@ RSpec.describe 'Merge request > User sees pipelines triggered by merge request', ...@@ -174,7 +174,7 @@ RSpec.describe 'Merge request > User sees pipelines triggered by merge request',
it 'waits the head pipeline' do it 'waits the head pipeline' do
expect(page).to have_content('to be merged automatically when the pipeline succeeds') expect(page).to have_content('to be merged automatically when the pipeline succeeds')
expect(page).to have_link('Cancel automatic merge') expect(page).to have_link('Cancel')
end end
end end
end end
...@@ -369,7 +369,7 @@ RSpec.describe 'Merge request > User sees pipelines triggered by merge request', ...@@ -369,7 +369,7 @@ RSpec.describe 'Merge request > User sees pipelines triggered by merge request',
context 'when detached merge request pipeline is pending' do context 'when detached merge request pipeline is pending' do
it 'waits the head pipeline' do it 'waits the head pipeline' do
expect(page).to have_content('to be merged automatically when the pipeline succeeds') expect(page).to have_content('to be merged automatically when the pipeline succeeds')
expect(page).to have_link('Cancel automatic merge') expect(page).to have_link('Cancel')
end end
end end
...@@ -395,7 +395,7 @@ RSpec.describe 'Merge request > User sees pipelines triggered by merge request', ...@@ -395,7 +395,7 @@ RSpec.describe 'Merge request > User sees pipelines triggered by merge request',
it 'waits the head pipeline' do it 'waits the head pipeline' do
expect(page).to have_content('to be merged automatically when the pipeline succeeds') expect(page).to have_content('to be merged automatically when the pipeline succeeds')
expect(page).to have_link('Cancel automatic merge') expect(page).to have_link('Cancel')
end end
end end
end end
......
...@@ -46,7 +46,7 @@ exports[`MRWidgetAutoMergeEnabled when graphql is disabled template should have ...@@ -46,7 +46,7 @@ exports[`MRWidgetAutoMergeEnabled when graphql is disabled template should have
> >
<!----> <!---->
Cancel automatic merge Cancel
</a> </a>
</h4> </h4>
...@@ -138,7 +138,7 @@ exports[`MRWidgetAutoMergeEnabled when graphql is enabled template should have c ...@@ -138,7 +138,7 @@ exports[`MRWidgetAutoMergeEnabled when graphql is enabled template should have c
> >
<!----> <!---->
Cancel automatic merge Cancel
</a> </a>
</h4> </h4>
......
...@@ -192,15 +192,13 @@ describe('MRWidgetAutoMergeEnabled', () => { ...@@ -192,15 +192,13 @@ describe('MRWidgetAutoMergeEnabled', () => {
}); });
describe('cancelButtonText', () => { describe('cancelButtonText', () => {
it('should return "Cancel automatic merge" if MWPS is selected', () => { it('should return "Cancel" if MWPS is selected', () => {
factory({ factory({
...defaultMrProps(), ...defaultMrProps(),
autoMergeStrategy: MWPS_MERGE_STRATEGY, autoMergeStrategy: MWPS_MERGE_STRATEGY,
}); });
expect(wrapper.findByTestId('cancelAutomaticMergeButton').text()).toBe( expect(wrapper.findByTestId('cancelAutomaticMergeButton').text()).toBe('Cancel');
'Cancel automatic merge',
);
}); });
}); });
}); });
...@@ -329,7 +327,7 @@ describe('MRWidgetAutoMergeEnabled', () => { ...@@ -329,7 +327,7 @@ describe('MRWidgetAutoMergeEnabled', () => {
expect(statusText).toBe('to be merged automatically when the pipeline succeeds'); expect(statusText).toBe('to be merged automatically when the pipeline succeeds');
}); });
it('should render the cancel button as "Cancel automatic merge" if MWPS is selected', () => { it('should render the cancel button as "Cancel" if MWPS is selected', () => {
factory({ factory({
...defaultMrProps(), ...defaultMrProps(),
autoMergeStrategy: MWPS_MERGE_STRATEGY, autoMergeStrategy: MWPS_MERGE_STRATEGY,
...@@ -337,7 +335,7 @@ describe('MRWidgetAutoMergeEnabled', () => { ...@@ -337,7 +335,7 @@ describe('MRWidgetAutoMergeEnabled', () => {
const cancelButtonText = trimText(wrapper.find('.js-cancel-auto-merge').text()); const cancelButtonText = trimText(wrapper.find('.js-cancel-auto-merge').text());
expect(cancelButtonText).toBe('Cancel automatic merge'); expect(cancelButtonText).toBe('Cancel');
}); });
}); });
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment