Commit 47691f47 authored by Fatih Acet's avatar Fatih Acet

Merge branch 'sh-trim-extra-periods-merge-error' into 'master'

Trim extra period when merge error displayed

See merge request gitlab-org/gitlab!23737
parents 7b1d23ab 09799220
...@@ -121,8 +121,14 @@ export default { ...@@ -121,8 +121,14 @@ export default {
); );
}, },
mergeError() { mergeError() {
let { mergeError } = this.mr;
if (mergeError && mergeError.slice(-1) === '.') {
mergeError = mergeError.slice(0, -1);
}
return sprintf(s__('mrWidget|Merge failed: %{mergeError}. Please try again.'), { return sprintf(s__('mrWidget|Merge failed: %{mergeError}. Please try again.'), {
mergeError: this.mr.mergeError, mergeError,
}); });
}, },
}, },
......
---
title: Trim extra period when merge error displayed
merge_request: 23737
author:
type: fixed
...@@ -152,7 +152,7 @@ describe 'Merge request > User merges when pipeline succeeds', :js do ...@@ -152,7 +152,7 @@ describe 'Merge request > User merges when pipeline succeeds', :js do
before do before do
merge_request.update( merge_request.update(
merge_user: merge_request.author, merge_user: merge_request.author,
merge_error: 'Something went wrong' merge_error: 'Something went wrong.'
) )
refresh refresh
end end
...@@ -162,7 +162,7 @@ describe 'Merge request > User merges when pipeline succeeds', :js do ...@@ -162,7 +162,7 @@ describe 'Merge request > User merges when pipeline succeeds', :js do
wait_for_requests wait_for_requests
page.within('.mr-section-container') do page.within('.mr-section-container') do
expect(page).to have_content('Merge failed: Something went wrong') expect(page).to have_content('Merge failed: Something went wrong. Please try again.')
end end
end end
end end
...@@ -171,7 +171,7 @@ describe 'Merge request > User merges when pipeline succeeds', :js do ...@@ -171,7 +171,7 @@ describe 'Merge request > User merges when pipeline succeeds', :js do
before do before do
merge_request.update( merge_request.update(
merge_user: merge_request.author, merge_user: merge_request.author,
merge_error: 'Something went wrong' merge_error: 'Something went wrong.'
) )
refresh refresh
end end
...@@ -181,7 +181,7 @@ describe 'Merge request > User merges when pipeline succeeds', :js do ...@@ -181,7 +181,7 @@ describe 'Merge request > User merges when pipeline succeeds', :js do
wait_for_requests wait_for_requests
page.within('.mr-section-container') do page.within('.mr-section-container') do
expect(page).to have_content('Merge failed: Something went wrong') expect(page).to have_content('Merge failed: Something went wrong. Please try again.')
end end
end end
end end
......
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