@@ -16,7 +16,7 @@ import {
16
16
setTaxes ,
17
17
estimateTaxes ,
18
18
estimateShippingLines ,
19
- getOrderInitialData
19
+ getOrderInitialData , IShipping
20
20
} from '@boldcommerce/checkout-frontend-library' ;
21
21
import {
22
22
addressesMock ,
@@ -127,6 +127,14 @@ describe('testing ppcpOnShippingContactSelectedApple function',() => {
127
127
newShippingMethods : shippingMethodsMock ,
128
128
newTotal : { amount : '100.00' , label : 'Total' }
129
129
} ;
130
+
131
+ getShippingMock . mockReturnValueOnce (
132
+ { ...shippingMock ,
133
+ selected_shipping : null ,
134
+ available_shipping_lines : [
135
+ { id : '1' , description : 'option' }
136
+ ] } as unknown as IShipping
137
+ ) ;
130
138
orderInitialDataMock . general_settings . checkout_process . rsa_enabled = true ;
131
139
getOrderInitialDataMock . mockReturnValue ( orderInitialDataMock ) ;
132
140
@@ -142,7 +150,7 @@ describe('testing ppcpOnShippingContactSelectedApple function',() => {
142
150
expect ( estimateTaxesMock ) . toBeCalledWith ( addressesMock . shipping , API_RETRY ) ;
143
151
expect ( getApplicationStateMock ) . toBeCalledTimes ( 1 ) ;
144
152
expect ( getPaymentRequestDisplayItemsMock ) . toBeCalledTimes ( 1 ) ;
145
- expect ( getShippingMock ) . toBeCalledTimes ( 1 ) ;
153
+ expect ( getShippingMock ) . toBeCalledTimes ( 2 ) ;
146
154
expect ( applePaySessionCompleteShippingContactSelection ) . toBeCalledTimes ( 1 ) ;
147
155
expect ( applePaySessionCompleteShippingContactSelection ) . toBeCalledWith ( expectedCompleteParam ) ;
148
156
} ) ;
0 commit comments