@@ -24,10 +24,6 @@ define([
24
24
tax : 0.1 ,
25
25
totals : 10
26
26
} ,
27
- cartData = {
28
- totals : totals ,
29
- rates : null
30
- } ,
31
27
mocks = {
32
28
'Magento_Checkout/js/model/quote' : {
33
29
shippingAddress : ko . observable ( ) ,
@@ -50,7 +46,7 @@ define([
50
46
} ,
51
47
'Magento_Checkout/js/model/cart/cache' : {
52
48
isChanged : function ( ) { } ,
53
- get : jasmine . createSpy ( ) . and . returnValues ( rates , cartData ) ,
49
+ get : jasmine . createSpy ( ) . and . returnValues ( rates , totals , rates , totals ) ,
54
50
set : jasmine . createSpy ( )
55
51
} ,
56
52
'Magento_Customer/js/customer-data' : {
@@ -105,13 +101,12 @@ define([
105
101
return 'address_type_test' ;
106
102
}
107
103
} ) ;
108
- expect ( mocks [ 'Magento_Checkout/js/model/cart/cache' ] . get ( 'cart-data' ) ) . toBe ( cartData ) ;
109
104
expect ( mocks [ 'Magento_Checkout/js/model/shipping-service' ] . setShippingRates ) . toHaveBeenCalledWith ( rates ) ;
110
- expect ( mocks [ 'Magento_Checkout/js/model/quote' ] . setTotals ) . toHaveBeenCalledWith ( cartData . totals ) ;
105
+ expect ( mocks [ 'Magento_Checkout/js/model/quote' ] . setTotals ) . toHaveBeenCalledWith ( totals ) ;
111
106
expect ( mocks [ 'Magento_Checkout/js/model/cart/totals-processor/default' ] . estimateTotals )
112
- . not . toHaveBeenCalled ( ) ;
107
+ . toHaveBeenCalled ( ) ;
113
108
expect ( mocks [ 'Magento_Checkout/js/model/shipping-rate-processor/new-address' ] . getRates )
114
- . not . toHaveBeenCalled ( ) ;
109
+ . toHaveBeenCalled ( ) ;
115
110
} ) ;
116
111
117
112
it ( 'test subscribe when shipping address was changed for virtual quote' , function ( ) {
@@ -125,7 +120,7 @@ define([
125
120
expect ( mocks [ 'Magento_Checkout/js/model/cart/totals-processor/default' ] . estimateTotals )
126
121
. toHaveBeenCalled ( ) ;
127
122
expect ( mocks [ 'Magento_Checkout/js/model/shipping-rate-processor/new-address' ] . getRates )
128
- . not . toHaveBeenCalled ( ) ;
123
+ . toHaveBeenCalled ( ) ;
129
124
} ) ;
130
125
131
126
it ( 'test subscribe when shipping address was changed for not virtual quote' , function ( ) {
0 commit comments