Skip to content

Commit 8c5e74d

Browse files
committed
Merge branch 'ACP2E-2400' of https://github.com/magento-l3/magento2ce into PR-10122023
2 parents 9ac3eb3 + d0e69b1 commit 8c5e74d

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

app/code/Magento/Ui/view/base/web/js/grid/provider.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,8 @@ define([
153153
if (xhr.statusText === 'abort') {
154154
return;
155155
}
156-
156+
this.trigger('reloaded');
157157
this.set('lastError', true);
158-
159158
this.firstLoad = false;
160159
this.triggerDataReload = false;
161160

dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/grid/provider.test.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,16 @@ define(['squire', 'underscore'], function (Squire, _) {
6363
expect(storage.requestConfig.method).toEqual('PATCH');
6464
});
6565
});
66+
describe('"onError" method', function () {
67+
it('test onError.', function () {
68+
model.trigger = jasmine.createSpy();
69+
model.set = jasmine.createSpy();
70+
model.onError({statusText: 'error'});
71+
expect(model.set).toHaveBeenCalledWith('lastError', true);
72+
expect(model.trigger).toHaveBeenCalledWith('reloaded');
73+
expect(model.firstLoad).toEqual(false);
74+
expect(model.triggerDataReload).toEqual(false);
75+
});
76+
});
6677
});
6778
});

0 commit comments

Comments
 (0)