Commit 3ce2ba1a authored by basyura's avatar basyura

fix display hook error message

parent 024ca242
......@@ -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);
......
---
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 = {
......
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