Skip to content

Commit 1d1c350

Browse files
committed
Fix static error tests
1 parent 5c8fc68 commit 1d1c350

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

app/code/Magento/Customer/view/frontend/web/js/customer-data.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ define([
9898
sectionNames = sectionConfig.filterClientSideSections(sectionNames);
9999
parameters = _.isArray(sectionNames) && sectionNames.indexOf('*') < 0 ? {
100100
sections: sectionNames.join(',')
101-
} : {};
102-
parameters.force_new_section_timestamp = forceNewSectionTimestamp;
101+
} : [];
102+
parameters['force_new_section_timestamp'] = forceNewSectionTimestamp;
103103

104104
return $.getJSON(options.sectionLoadUrl, parameters).fail(function (jqXHR) {
105105
throw new Error(jqXHR);
@@ -179,7 +179,7 @@ define([
179179
sectionDataIds = $.cookieStorage.get('section_data_ids') || {};
180180

181181
_.each(sections, function (sectionData, sectionName) {
182-
sectionId = sectionData.data_id;
182+
sectionId = sectionData['data_id'];
183183
sectionDataIds[sectionName] = sectionId;
184184
storage.set(sectionName, sectionData);
185185
storageInvalidation.remove(sectionName);
@@ -255,7 +255,7 @@ define([
255255
_.each(options.expirableSectionNames, function (sectionName) {
256256
sectionData = storage.get(sectionName);
257257

258-
if (typeof sectionData === 'object' && sectionData.data_id + sectionLifetime <= currentTimestamp) {
258+
if (typeof sectionData === 'object' && sectionData['data_id'] + sectionLifetime <= currentTimestamp) {
259259
expiredSectionNames.push(sectionName);
260260
}
261261
});
@@ -266,7 +266,7 @@ define([
266266

267267
if (typeof sectionData === 'undefined' ||
268268
typeof sectionData === 'object' &&
269-
cookieSectionTimestamp !== sectionData.data_id
269+
cookieSectionTimestamp !== sectionData['data_id']
270270
) {
271271
expiredSectionNames.push(sectionName);
272272
}

dev/tests/js/jasmine/tests/app/code/Magento/Customer/frontend/js/customer-data.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ define([
8383
sectionDataIds = {};
8484

8585
_.each(sections, function (sectionData, sectionName) {
86-
sectionDataIds[sectionName] = sectionData.data_id;
86+
sectionDataIds[sectionName] = sectionData['data_id'];
8787

8888
if (typeof sectionData.content !== 'undefined') {
8989
mageCacheStorage[sectionName] = sectionData;

lib/web/mage/utils/main.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ define(function (require) {
66
'use strict';
77

88
var utils = {},
9-
_ = require('underscore'),
10-
root = typeof self == 'object' && self.self === self && self ||
11-
typeof global == 'object' && global.global === global && global || Function('return this')() || {};
12-
root._ = _;
9+
_ = require('underscore');
1310

1411
return _.extend(
1512
utils,

lib/web/underscore.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2039,4 +2039,3 @@
20392039
return _;
20402040

20412041
})));
2042-
//# sourceMappingURL=underscore-umd.js.map

0 commit comments

Comments
 (0)