fix display hook error message
This commit is contained in:
parent
024ca242b4
commit
3ce2ba1afb
3 changed files with 17 additions and 1 deletions
|
@ -101,7 +101,7 @@
|
|||
urlSuffix = deleteSourceBranch ? '?deleted_source_branch=true' : '';
|
||||
return window.location.href = window.location.pathname + urlSuffix;
|
||||
} else if (data.merge_error) {
|
||||
return this.$widgetBody.html("<h4>" + data.merge_error + "</h4>");
|
||||
return _this.$widgetBody.html("<h4>" + data.merge_error + "</h4>");
|
||||
} else {
|
||||
callback = function() {
|
||||
return merge_request_widget.mergeInProgress(deleteSourceBranch);
|
||||
|
|
4
changelogs/unreleased/issue_24020.yml
Normal file
4
changelogs/unreleased/issue_24020.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
title: "fix display hook error message"
|
||||
merge_request: 7775
|
||||
author: basyura
|
|
@ -106,6 +106,18 @@
|
|||
});
|
||||
});
|
||||
|
||||
describe('mergeInProgress', function() {
|
||||
it('should display error with h4 tag', function() {
|
||||
spyOn(this.class.$widgetBody, 'html').and.callFake(function(html) {
|
||||
expect(html).toBe('<h4>Sorry, something went wrong.</h4>');
|
||||
});
|
||||
spyOn($, 'ajax').and.callFake(function(e) {
|
||||
e.success({ merge_error: 'Sorry, something went wrong.' });
|
||||
});
|
||||
this.class.mergeInProgress(null);
|
||||
});
|
||||
});
|
||||
|
||||
return describe('getCIStatus', function() {
|
||||
beforeEach(function() {
|
||||
this.ciStatusData = {
|
||||
|
|
Loading…
Reference in a new issue