@@ -11,8 +11,11 @@ define([
11
11
'use strict' ;
12
12
13
13
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 ( ) {
16
19
return {
17
20
getKey : function ( ) {
18
21
return 'new-billing-address-key' ;
@@ -35,8 +38,6 @@ define([
35
38
isVirtual : function ( ) {
36
39
return false ;
37
40
} ,
38
- /** Stub */
39
- getQuoteId : function ( ) { } ,
40
41
paymentMethod : ko . observable ( null )
41
42
} ,
42
43
'Magento_Customer/js/customer-data' : {
@@ -45,7 +46,7 @@ define([
45
46
return { } ;
46
47
} ;
47
48
}
48
- } ,
49
+ }
49
50
} ,
50
51
lastSelectedBillingAddress = {
51
52
city : 'Culver City' ,
@@ -91,7 +92,10 @@ define([
91
92
} ) ,
92
93
set : jasmine . createSpy ( 'set' ) ,
93
94
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
+ ) {
95
99
billingAddress . source . set ( 'params.invalid' , false ) ; // Simulate valid form data
96
100
}
97
101
} )
@@ -106,7 +110,7 @@ define([
106
110
it ( 'should not call updateAddresses when form is invalid' , function ( ) {
107
111
billingAddress . source . set . and . callFake ( function ( key , value ) {
108
112
if ( key === 'params.invalid' && value === true ) {
109
- billingAddress . source . get . and . callFake ( function ( key ) {
113
+ billingAddress . source . get . and . callFake ( function ( ) {
110
114
if ( key === 'params.invalid' ) {
111
115
return true ; // Simulate invalid form data
112
116
}
0 commit comments