Skip to content

Commit 70dc47a

Browse files
committed
ACP2E-2260: Recently viewed product data not updated as per the store view
1 parent b9f57bd commit 70dc47a

File tree

2 files changed

+8
-5
lines changed
  • app/code/Magento/Catalog/view/frontend/web/js/product/storage
  • dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/product/storage

2 files changed

+8
-5
lines changed

app/code/Magento/Catalog/view/frontend/web/js/product/storage/data-storage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ define([
149149
if (data.items && ids.length) {
150150
//we can extend only items
151151
data = data.items;
152-
this.data(_.extend(data, currentData));
152+
this.data(_.extend(currentData, data));
153153
}
154154
},
155155

dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/product/storage/data-storage.test.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ define([
119119
obj.data = function (data) {
120120
if (!data) {
121121
return {
122-
dataProperty: 'dataValue'
122+
existingKey1: 'existingKey1Value',
123+
existingKey2: 'existingKey2Value'
123124
};
124125
}
125126

@@ -130,14 +131,16 @@ define([
130131
it('check calls "providerHandler" method with data', function () {
131132
var data = {
132133
items: {
133-
key: 'value'
134+
newKey: 'newKeyValue',
135+
existingKey2: 'existingKey2NewValue'
134136
}
135137
};
136138

137139
obj.providerHandler(data);
138140

139-
expect(obj.result.key).toBe('value');
140-
expect(obj.result.dataProperty).toBe('dataValue');
141+
expect(obj.result.existingKey1).toBe('existingKey1Value');
142+
expect(obj.result.existingKey2).toBe('existingKey2NewValue');
143+
expect(obj.result.newKey).toBe('newKeyValue');
141144
});
142145
it('check calls "providerHandler" method without data', function () {
143146
obj.providerHandler({});

0 commit comments

Comments
 (0)