File tree Expand file tree Collapse 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 Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ define([
149
149
if ( data . items && ids . length ) {
150
150
//we can extend only items
151
151
data = data . items ;
152
- this . data ( _ . extend ( data , currentData ) ) ;
152
+ this . data ( _ . extend ( currentData , data ) ) ;
153
153
}
154
154
} ,
155
155
Original file line number Diff line number Diff line change @@ -119,7 +119,8 @@ define([
119
119
obj . data = function ( data ) {
120
120
if ( ! data ) {
121
121
return {
122
- dataProperty : 'dataValue'
122
+ existingKey1 : 'existingKey1Value' ,
123
+ existingKey2 : 'existingKey2Value'
123
124
} ;
124
125
}
125
126
@@ -130,14 +131,16 @@ define([
130
131
it ( 'check calls "providerHandler" method with data' , function ( ) {
131
132
var data = {
132
133
items : {
133
- key : 'value'
134
+ newKey : 'newKeyValue' ,
135
+ existingKey2 : 'existingKey2NewValue'
134
136
}
135
137
} ;
136
138
137
139
obj . providerHandler ( data ) ;
138
140
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' ) ;
141
144
} ) ;
142
145
it ( 'check calls "providerHandler" method without data' , function ( ) {
143
146
obj . providerHandler ( { } ) ;
You can’t perform that action at this time.
0 commit comments