Skip to content

Commit a1d2a84

Browse files
Fixed static tests
1 parent 7ef0c88 commit a1d2a84

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/grid/data-storage.test.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
/*eslint max-nested-callbacks: 0*/
77
/*jscs:disable requireCamelCaseOrUpperCaseIdentifiers*/
8+
/*eslint newline-after-var: ["error", "always"]*/
9+
/*eslint-env es6*/
810
define([
911
'jquery',
1012
'Magento_Ui/js/grid/data-storage'
@@ -52,6 +54,7 @@ define([
5254

5355
it('initializes _requests property as an empty array', function () {
5456
var model = new DataStorage();
57+
5558
model._requests = null;
5659
model.initConfig();
5760
expect(model._requests).toEqual([]);
@@ -110,7 +113,7 @@ define([
110113
2: {
111114
id_field_name: 'entity_id',
112115
entity_id: '42'
113-
},
116+
}
114117
}
115118
});
116119

@@ -129,8 +132,10 @@ define([
129132
spyOn(model, 'clearRequests');
130133
spyOn(model, 'hasScopeChanged').and.returnValue(true);
131134
spyOn(model, 'requestData').and.returnValue(requestDataResult);
135+
spyOn(model, 'getRequest');
132136
expect(model.getData()).toEqual(requestDataResult);
133137
expect(model.clearRequests).toHaveBeenCalled();
138+
expect(model.getRequest).not.toHaveBeenCalled();
134139
});
135140

136141
it('returns the cached result if scope have not been changed', function () {
@@ -210,7 +215,7 @@ define([
210215
id_field_name: 'entity_id',
211216
entity_id: '1',
212217
field: 'value'
213-
},
218+
}
214219
}
215220
});
216221

@@ -237,7 +242,7 @@ define([
237242
/**
238243
* Success result for ajax request
239244
*
240-
* @param handler
245+
* @param {Function} handler
241246
* @returns {*}
242247
*/
243248
done: function (handler) {
@@ -297,10 +302,11 @@ define([
297302
model = new DataStorage({
298303
cachedRequestDelay: 0
299304
});
305+
300306
spyOn(model, 'getByIds').and.returnValue(items);
301307
model.getRequestData(request).then(function (promiseResult) {
302-
expect(promiseResult).toEqual(result)
303-
})
308+
expect(promiseResult).toEqual(result);
309+
});
304310
});
305311
});
306312

0 commit comments

Comments
 (0)