Skip to content

Commit ea2941d

Browse files
committed
MAGETWO-60982: AJAX calls does not process error responses
1 parent ce92fa2 commit ea2941d

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
/* global jQuery */
6+
/* eslint-disable max-nested-callbacks */
7+
define([
8+
'jquery',
9+
'squire',
10+
'mage/backend/notification'
11+
], function ($, Squire) {
12+
'use strict';
13+
14+
var injector = new Squire();
15+
16+
describe('mage/backend/bootstrap', function () {
17+
beforeEach(function (done) {
18+
injector.require(['mage/backend/bootstrap'], function () {
19+
done();
20+
});
21+
});
22+
describe('"sendPostponeRequest" method', function () {
23+
it('should insert "Error" notification if request failed', function () {
24+
jQuery('<div class="page-main-actions"></div>').appendTo('body');
25+
jQuery('body').notification();
26+
27+
jQuery.ajax().abort();
28+
29+
expect(jQuery('.message-error').length).toBe(1);
30+
expect(jQuery('body:contains("A technical problem with the server created an error")').length).toBe(1);
31+
});
32+
});
33+
});
34+
});

0 commit comments

Comments
 (0)