Skip to content

Commit 2369a8c

Browse files
rostilosengcom-Charlie
authored andcommitted
functionality fixes, edit jasmine unit test
1 parent 0e0784a commit 2369a8c

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

app/code/Magento/Checkout/view/frontend/web/js/model/cart/estimate-service.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ define([
4141
totalsProcessors[type] ?
4242
totalsProcessors[type].estimateTotals(quote.shippingAddress()) :
4343
totalsProcessors['default'].estimateTotals(quote.shippingAddress());
44-
shippingService.isLoading(false);
4544
} else {
4645
// check if user data not changed -> load rates from cache
4746
if (!cartCache.isChanged('address', quote.shippingAddress()) &&
@@ -73,6 +72,8 @@ define([
7372
cartCache.set('totals', quote.getTotals());
7473
}
7574
}
75+
// unset loader on shipping rates list
76+
shippingService.isLoading(false);
7677
},
7778

7879
/**

app/code/Magento/Checkout/view/frontend/web/js/model/shipping-rates-validator.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ define([
148148
}, delay);
149149

150150
if (!formPopUpState.isVisible()) {
151+
// Prevent shipping methods showing none available whilst we resolve
151152
shippingService.isLoading(true);
152153
clearTimeout(self.validateAddressTimeout);
153154
self.validateAddressTimeout = setTimeout(function () {

dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/cart/estimate-service.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ define([
4141
},
4242
'Magento_Checkout/js/model/shipping-service': {
4343
setShippingRates: function () {},
44+
isLoading: ko.observable(),
4445
getShippingRates: function () {
4546
return ko.observable(rates);
4647
}

0 commit comments

Comments
 (0)