Skip to content

Commit 85126f5

Browse files
committed
Merge remote-tracking branch 'origin/MC-35989' into 2.4-develop-pr34
2 parents fc43e28 + 65b221d commit 85126f5

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

2 files changed

+8
-4
lines changed

app/code/Magento/Customer/view/frontend/web/js/model/customer/address.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
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 {*}

dev/tests/js/jasmine/tests/app/code/Magento/Customer/frontend/js/model/customer/address.test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff 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));

0 commit comments

Comments
 (0)