Merge branch 'develop' into CSR-2404-fix-font

This commit is contained in:
CarlNation 2024-11-21 13:13:22 -05:00 committed by GitHub
commit 39d677fdc2
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 // 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 // Arrange
const lineItems = { const lineItems = {
glassParts: [], glassParts: [],
@ -336,11 +336,8 @@ describe("cart.vue", () => {
availableVaps: availableVaps, availableVaps: availableVaps,
}, },
}); });
// Assert // Assert
expect(wrapper.vm.servicePackageDiscountCartItem).not.toBeNull(); expect(wrapper.vm.servicePackageDiscountCartItem).toBeNull();
expect(wrapper.vm.servicePackageDiscountCartItem.subTotal).toEqual(-70);
expect(wrapper.vm.servicePackageDiscountCartItem.salesTax).toEqual(0);
}); });
// Other Supporting Items Cart Item // Other Supporting Items Cart Item

View file

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