Skip to content

Commit a2d7094

Browse files
committed
MC-18191: Customer cart section on reloads each web transaction
1 parent 4f81760 commit a2d7094

File tree

2 files changed

+0
-27
lines changed
  • app/code/Magento/Checkout/view/frontend/web/js/model/cart/totals-processor
  • dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/cart/totals-processor

2 files changed

+0
-27
lines changed

app/code/Magento/Checkout/view/frontend/web/js/model/cart/totals-processor/default.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,7 @@ define([
8787
data.shippingCarrierCode = quote.shippingMethod()['carrier_code'];
8888
}
8989

90-
// if (!cartCache.isChanged('cartVersion', customerData.get('cart')()['data_id']) &&
91-
// !cartCache.isChanged('shippingMethodCode', data.shippingMethodCode) &&
92-
// !cartCache.isChanged('shippingCarrierCode', data.shippingCarrierCode) &&
93-
// !cartCache.isChanged('address', address) &&
94-
// cartCache.get('totals') &&
95-
// !cartCache.isChanged('subtotal', parseFloat(quote.totals().subtotal))
96-
// ) {
97-
// quote.setTotals(cartCache.get('totals'));
98-
// } else {
9990
return loadFromServer(address);
100-
// }
10191
}
10292
};
10393
});

dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/cart/totals-processor/default.test.js

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -98,20 +98,6 @@ define([
9898

9999
describe('Magento_Checkout/js/model/cart/totals-processor/default', function () {
100100

101-
it('estimateTotals if data was cached', function () {
102-
spyOn(mocks['Magento_Checkout/js/model/cart/cache'], 'isChanged').and.returnValue(false);
103-
spyOn(mocks['Magento_Customer/js/customer-data'], 'get').and.returnValue(
104-
ko.observable({
105-
'data_id': 1
106-
})
107-
);
108-
spyOn(mocks['Magento_Checkout/js/model/cart/cache'], 'get').and.returnValue(totals);
109-
spyOn(mocks['mage/storage'], 'post');
110-
expect(defaultProcessor.estimateTotals(address)).toBeUndefined();
111-
expect(mocks['Magento_Checkout/js/model/quote'].setTotals).toHaveBeenCalledWith(totals);
112-
expect(mocks['mage/storage'].post).not.toHaveBeenCalled();
113-
});
114-
115101
it('estimateTotals if data wasn\'t cached and request was successfully sent', function () {
116102
var deferral = new $.Deferred();
117103

@@ -133,8 +119,6 @@ define([
133119
expect(mocks['Magento_Checkout/js/model/totals'].isLoading.calls.argsFor(0)[0]).toBe(true);
134120
expect(mocks['Magento_Checkout/js/model/totals'].isLoading.calls.argsFor(1)[0]).toBe(false);
135121
expect(mocks['mage/storage'].post).toHaveBeenCalled();
136-
expect(mocks['Magento_Checkout/js/model/cart/cache'].get).not.toHaveBeenCalled();
137-
expect(mocks['Magento_Checkout/js/model/cart/cache'].set).toHaveBeenCalledWith('cart-data', data);
138122
});
139123

140124
it('estimateTotals if data wasn\'t cached and request returns error', function () {
@@ -154,7 +138,6 @@ define([
154138
expect(mocks['Magento_Checkout/js/model/totals'].isLoading.calls.argsFor(0)[0]).toBe(true);
155139
expect(mocks['Magento_Checkout/js/model/totals'].isLoading.calls.argsFor(1)[0]).toBe(false);
156140
expect(mocks['mage/storage'].post).toHaveBeenCalled();
157-
expect(mocks['Magento_Checkout/js/model/cart/cache'].get).not.toHaveBeenCalled();
158141
expect(mocks['Magento_Checkout/js/model/error-processor'].process).toHaveBeenCalledWith('Error Message');
159142
});
160143
});

0 commit comments

Comments
 (0)