Merge pull request #2139 from Safelite/rlsmerge/2024.11.21-to-dev-freeze

Rlsmerge/2024.11.21 to dev freeze
This commit is contained in:
CarlNation 2024-11-21 08:44:14 -05:00 committed by GitHub
commit ae4ec7808f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 12 deletions

View file

@ -307,7 +307,7 @@ describe("cart.vue", () => {
});
// Service package discount Fee Cart Item
test("if there is service package discount fee on the order, a service package discount cart item should be added to the cart", () => {
test("only if there is service package discount fee for the package, a service package discount cart item should be added to the cart", () => {
// Arrange
const lineItems = {
glassParts: [],
@ -336,11 +336,8 @@ describe("cart.vue", () => {
availableVaps: availableVaps,
},
});
// Assert
expect(wrapper.vm.servicePackageDiscountCartItem).not.toBeNull();
expect(wrapper.vm.servicePackageDiscountCartItem.subTotal).toEqual(-70);
expect(wrapper.vm.servicePackageDiscountCartItem.salesTax).toEqual(0);
expect(wrapper.vm.servicePackageDiscountCartItem).toBeNull();
});
// Other Supporting Items Cart Item

View file

@ -297,8 +297,16 @@ export default {
this.lineItems[category] = this.lineItems[category].filter(
(lineItemsToKeep) => lineItemsToKeep.cartItemType != cartItemType
);
await this.dispatchStoreAction(storeActions.SAVE_VAPS, this.lineItems.vaps, false);
if (category == cartItemCategories.VAPS) {
await this.dispatchStoreAction(storeActions.SAVE_VAPS, this.lineItems.vaps, false);
}
if (category == cartItemCategories.SUPPORTING_ITEMS) {
await this.dispatchStoreAction(
storeActions.SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING,
this.lineItems.supportingItems,
false
);
}
},
async saveVaps(lineItems) {
@ -430,11 +438,15 @@ export default {
cartItems.push(this.mobileFeeCartItem);
}
if (
this.servicePackageDiscountCartItem &&
this.discountPackageNames == this.packageLevel
) {
cartItems.push(this.servicePackageDiscountCartItem);
if (this.servicePackageDiscountCartItem) {
if (this.discountPackageNames != this.packageLevel) {
this.removeItem(
this.servicePackageDiscountCartItem.cartItemType,
cartItemCategories.SUPPORTING_ITEMS
);
} else {
cartItems.push(this.servicePackageDiscountCartItem);
}
}
if (this.premiumAppointmentDiscountCartItem) {