@@ -23,9 +23,6 @@ define([
23
23
result = {
24
24
totals : 10
25
25
} ,
26
- totals = {
27
- grandTotal : 5
28
- } ,
29
26
address = {
30
27
countryId : 'US' ,
31
28
region : null ,
@@ -91,20 +88,6 @@ define([
91
88
92
89
describe ( 'Magento_Checkout/js/model/cart/totals-processor/default' , function ( ) {
93
90
94
- it ( 'estimateTotals if data was cached' , function ( ) {
95
- spyOn ( mocks [ 'Magento_Checkout/js/model/cart/cache' ] , 'isChanged' ) . and . returnValue ( false ) ;
96
- spyOn ( mocks [ 'Magento_Customer/js/customer-data' ] , 'get' ) . and . returnValue (
97
- ko . observable ( {
98
- 'data_id' : 1
99
- } )
100
- ) ;
101
- spyOn ( mocks [ 'Magento_Checkout/js/model/cart/cache' ] , 'get' ) . and . returnValue ( totals ) ;
102
- spyOn ( mocks [ 'mage/storage' ] , 'post' ) ;
103
- expect ( defaultProcessor . estimateTotals ( address ) ) . toBeUndefined ( ) ;
104
- expect ( mocks [ 'Magento_Checkout/js/model/quote' ] . setTotals ) . toHaveBeenCalledWith ( totals ) ;
105
- expect ( mocks [ 'mage/storage' ] . post ) . not . toHaveBeenCalled ( ) ;
106
- } ) ;
107
-
108
91
it ( 'estimateTotals if data wasn\'t cached and request was successfully sent' , function ( ) {
109
92
var deferral = new $ . Deferred ( ) ;
110
93
@@ -122,12 +105,10 @@ define([
122
105
return deferral . resolve ( result ) ;
123
106
} ) ;
124
107
expect ( defaultProcessor . estimateTotals ( address ) ) . toBe ( deferral ) ;
125
- expect ( mocks [ 'Magento_Checkout/js/model/quote' ] . setTotals ) . toHaveBeenCalledWith ( totals ) ;
108
+ expect ( mocks [ 'Magento_Checkout/js/model/quote' ] . setTotals ) . toHaveBeenCalledWith ( result ) ;
126
109
expect ( mocks [ 'Magento_Checkout/js/model/totals' ] . isLoading . calls . argsFor ( 0 ) [ 0 ] ) . toBe ( true ) ;
127
110
expect ( mocks [ 'Magento_Checkout/js/model/totals' ] . isLoading . calls . argsFor ( 1 ) [ 0 ] ) . toBe ( false ) ;
128
111
expect ( mocks [ 'mage/storage' ] . post ) . toHaveBeenCalled ( ) ;
129
- expect ( mocks [ 'Magento_Checkout/js/model/cart/cache' ] . get ) . not . toHaveBeenCalled ( ) ;
130
- expect ( mocks [ 'Magento_Checkout/js/model/cart/cache' ] . set ) . toHaveBeenCalledWith ( 'cart-data' , data ) ;
131
112
} ) ;
132
113
133
114
it ( 'estimateTotals if data wasn\'t cached and request returns error' , function ( ) {
@@ -147,7 +128,6 @@ define([
147
128
expect ( mocks [ 'Magento_Checkout/js/model/totals' ] . isLoading . calls . argsFor ( 0 ) [ 0 ] ) . toBe ( true ) ;
148
129
expect ( mocks [ 'Magento_Checkout/js/model/totals' ] . isLoading . calls . argsFor ( 1 ) [ 0 ] ) . toBe ( false ) ;
149
130
expect ( mocks [ 'mage/storage' ] . post ) . toHaveBeenCalled ( ) ;
150
- expect ( mocks [ 'Magento_Checkout/js/model/cart/cache' ] . get ) . not . toHaveBeenCalled ( ) ;
151
131
expect ( mocks [ 'Magento_Checkout/js/model/error-processor' ] . process ) . toHaveBeenCalledWith ( 'Error Message' ) ;
152
132
} ) ;
153
133
} ) ;
0 commit comments