This commit is contained in:
Sneha 2024-11-19 18:17:54 +05:30
parent da9bc044ed
commit 44abc67fb3
2 changed files with 17 additions and 8 deletions

View file

@ -341,12 +341,6 @@ describe("cart.vue", () => {
expect(wrapper.vm.servicePackageDiscountCartItem).not.toBeNull();
expect(wrapper.vm.servicePackageDiscountCartItem.subTotal).toEqual(-70);
expect(wrapper.vm.servicePackageDiscountCartItem.salesTax).toEqual(0);
const found =
wrapper.vm.cartItems.findIndex(
(cartItem) => cartItem == wrapper.vm.servicePackageDiscountCartItem
) >= 0;
expect(found).toBe(true);
});
// Other Supporting Items Cart Item

View file

@ -162,10 +162,15 @@ import promoModalQuestion from "@/fmg-components/promo-modal-question/promo-moda
// Mixins
import baseMixin from "@/mixins/base-mixin.js";
import experimentMixin from "@/mixins/experiment-mixin.js";
// Helpers
import { deepClone } from "@/helpers/object-helper";
import { getHighestFullySatisfiedTier, getPackageContents } from "@/helpers/service-package-helper";
import {
getHighestFullySatisfiedTier,
getPackageContents,
getDiscountPackageName,
} from "@/helpers/service-package-helper";
import { getPromoCodeWithoutBundleIdentifier } from "@/helpers/promotions-helper";
import { storeActions } from "@/constants/store-actions";
@ -174,6 +179,7 @@ import { partTypeStrings } from "@/constants/part-type-strings";
import { cartItemCategories } from "@/constants/cart-item-categories";
import { cartItemTypes } from "@/constants/cart-item-types";
import { coverageStatus, cartItemTypesCoveredByInsurance } from "@/constants/insurance";
import { experimentSettings } from "@/constants/experiments";
export default {
name: "cart",
@ -424,7 +430,10 @@ export default {
cartItems.push(this.mobileFeeCartItem);
}
if (this.servicePackageDiscountCartItem) {
if (
this.servicePackageDiscountCartItem &&
this.discountPackageNames == this.packageLevel
) {
cartItems.push(this.servicePackageDiscountCartItem);
}
@ -441,6 +450,12 @@ export default {
return cartItems;
},
},
discountPackageNames() {
const discountServicePackage = experimentMixin.methods.getSettingValue(
experimentSettings.PROMO_ON_PACKAGE
);
return getDiscountPackageName(discountServicePackage);
},
servicePackageTitleWidget() {
const servicePackageNames = this.getCmsContent(
this.servicePackageOptionsCmsName,