Skip to content

Commit 85ef90f

Browse files
Chhandak.BaruaChhandak.Barua
authored andcommitted
ACP2E-3037: Checkout page Validation message incorrect.
1 parent c555627 commit 85ef90f

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/view/billing-address-validate.test.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ define([
1111
'use strict';
1212

1313
var injector = new Squire(),
14-
checkoutData = jasmine.createSpyObj('checkoutData', ['setSelectedBillingAddress', 'setNewCustomerBillingAddress']),
15-
createBillingAddress = jasmine.createSpy('createBillingAddress').and.callFake(function (addressData) {
14+
checkoutData = jasmine.createSpyObj(
15+
'checkoutData',
16+
['setSelectedBillingAddress', 'setNewCustomerBillingAddress']
17+
),
18+
createBillingAddress = jasmine.createSpy('createBillingAddress').and.callFake(function () {
1619
return {
1720
getKey: function () {
1821
return 'new-billing-address-key';
@@ -35,8 +38,6 @@ define([
3538
isVirtual: function () {
3639
return false;
3740
},
38-
/** Stub */
39-
getQuoteId: function () {},
4041
paymentMethod: ko.observable(null)
4142
},
4243
'Magento_Customer/js/customer-data': {
@@ -45,7 +46,7 @@ define([
4546
return {};
4647
};
4748
}
48-
},
49+
}
4950
},
5051
lastSelectedBillingAddress = {
5152
city: 'Culver City',
@@ -91,7 +92,10 @@ define([
9192
}),
9293
set: jasmine.createSpy('set'),
9394
trigger: jasmine.createSpy('trigger').and.callFake(function (event) {
94-
if (event === billingAddress.dataScopePrefix + '.data.validate' || event === billingAddress.dataScopePrefix + '.custom_attributes.data.validate') {
95+
if (
96+
event === billingAddress.dataScopePrefix + '.data.validate'
97+
|| event === billingAddress.dataScopePrefix + '.custom_attributes.data.validate'
98+
) {
9599
billingAddress.source.set('params.invalid', false); // Simulate valid form data
96100
}
97101
})
@@ -106,7 +110,7 @@ define([
106110
it('should not call updateAddresses when form is invalid', function () {
107111
billingAddress.source.set.and.callFake(function (key, value) {
108112
if (key === 'params.invalid' && value === true) {
109-
billingAddress.source.get.and.callFake(function (key) {
113+
billingAddress.source.get.and.callFake(function () {
110114
if (key === 'params.invalid') {
111115
return true; // Simulate invalid form data
112116
}

0 commit comments

Comments
 (0)