File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
app/code/Magento/Customer/view/frontend/web/js/model/customer
dev/tests/js/jasmine/tests/app/code/Magento/Customer/frontend/js/model/customer Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 6
6
/**
7
7
* @api
8
8
*/
9
- define ( [ ] , function ( ) {
9
+ define ( [ 'underscore' ] , function ( _ ) {
10
10
'use strict' ;
11
11
12
12
/**
@@ -44,7 +44,7 @@ define([], function () {
44
44
vatId : addressData [ 'vat_id' ] ,
45
45
sameAsBilling : addressData [ 'same_as_billing' ] ,
46
46
saveInAddressBook : addressData [ 'save_in_address_book' ] ,
47
- customAttributes : addressData [ 'custom_attributes' ] ,
47
+ customAttributes : _ . toArray ( addressData [ 'custom_attributes' ] ) . reverse ( ) ,
48
48
49
49
/**
50
50
* @return {* }
Original file line number Diff line number Diff line change @@ -22,9 +22,12 @@ define([
22
22
it ( 'Check on empty object.' , function ( ) {
23
23
var addressData = {
24
24
region : { }
25
+ } ,
26
+ expected = {
27
+ customAttributes : [ ]
25
28
} ;
26
29
27
- expect ( JSON . stringify ( customerAddress ( addressData ) ) ) . toEqual ( JSON . stringify ( { } ) ) ;
30
+ expect ( JSON . stringify ( customerAddress ( addressData ) ) ) . toEqual ( JSON . stringify ( expected ) ) ;
28
31
} ) ;
29
32
30
33
it ( 'Check on function call with empty address data.' , function ( ) {
@@ -49,7 +52,8 @@ define([
49
52
}
50
53
} ) ,
51
54
expected = {
52
- regionId : '1'
55
+ regionId : '1' ,
56
+ customAttributes : [ ]
53
57
} ;
54
58
55
59
expect ( JSON . stringify ( result ) ) . toEqual ( JSON . stringify ( expected ) ) ;
You can’t perform that action at this time.
0 commit comments