@@ -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