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 66/**
77 * @api
88 */
9- define ( [ ] , function ( ) {
9+ define ( [ 'underscore' ] , function ( _ ) {
1010 'use strict' ;
1111
1212 /**
@@ -44,7 +44,7 @@ define([], function () {
4444 vatId : addressData [ 'vat_id' ] ,
4545 sameAsBilling : addressData [ 'same_as_billing' ] ,
4646 saveInAddressBook : addressData [ 'save_in_address_book' ] ,
47- customAttributes : addressData [ 'custom_attributes' ] ,
47+ customAttributes : _ . toArray ( addressData [ 'custom_attributes' ] ) . reverse ( ) ,
4848
4949 /**
5050 * @return {* }
Original file line number Diff line number Diff line change @@ -22,9 +22,12 @@ define([
2222 it ( 'Check on empty object.' , function ( ) {
2323 var addressData = {
2424 region : { }
25+ } ,
26+ expected = {
27+ customAttributes : [ ]
2528 } ;
2629
27- expect ( JSON . stringify ( customerAddress ( addressData ) ) ) . toEqual ( JSON . stringify ( { } ) ) ;
30+ expect ( JSON . stringify ( customerAddress ( addressData ) ) ) . toEqual ( JSON . stringify ( expected ) ) ;
2831 } ) ;
2932
3033 it ( 'Check on function call with empty address data.' , function ( ) {
@@ -49,7 +52,8 @@ define([
4952 }
5053 } ) ,
5154 expected = {
52- regionId : '1'
55+ regionId : '1' ,
56+ customAttributes : [ ]
5357 } ;
5458
5559 expect ( JSON . stringify ( result ) ) . toEqual ( JSON . stringify ( expected ) ) ;
You can’t perform that action at this time.
0 commit comments