Skip to content

Commit

Permalink
Fix eslint errors in cart.js, shipping-estimator.js and test in cart.…
Browse files Browse the repository at this point in the history
…spec.js (#2072)
  • Loading branch information
yurytut1993 authored Jun 4, 2021
1 parent 04e1b4e commit 16ac1e4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions assets/js/test-unit/theme/cart.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import Cart from '../../theme/cart.js';
var dataSpy;
var UpdateSpy;
var c = new Cart();
c.context = {
shippingCountryErrorMessage: 'The Country field cannot be blank.',
shippingProvinceErrorMessage: 'The State/Province field cannot be blank.',
};
beforeEach(function() {
UpdateSpy = spyOn(utils.api.cart, 'itemUpdate');

Expand Down
4 changes: 2 additions & 2 deletions assets/js/theme/cart.js
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,8 @@ export default class Cart extends PageManager {
// initiate shipping estimator module
const shippingErrorMessages = {
country: this.context.shippingCountryErrorMessage,
province: this.context.shippingProvinceErrorMessage
}
province: this.context.shippingProvinceErrorMessage,
};
this.shippingEstimator = new ShippingEstimator($('[data-shipping-estimator]'), shippingErrorMessages);
}
}
4 changes: 2 additions & 2 deletions assets/js/theme/cart/shipping-estimator.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default class ShippingEstimator {

cb(result);
},
errorMessage: this.shippingErrorMessages.country
errorMessage: this.shippingErrorMessages.country,
},
]);
}
Expand All @@ -86,7 +86,7 @@ export default class ShippingEstimator {

cb(result);
},
errorMessage: this.shippingErrorMessages.province
errorMessage: this.shippingErrorMessages.province,
},
]);
}
Expand Down

0 comments on commit 16ac1e4

Please sign in to comment.