commit
1ae32d00fc
5 changed files with 10 additions and 107 deletions
|
|
@ -263,49 +263,6 @@ describe("cart.vue", () => {
|
||||||
expect(found).toBe(true);
|
expect(found).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Mobile Fee Cart Item
|
|
||||||
test("if there is mobile fee on the order, a mobile fee cart item should be added to the cart", () => {
|
|
||||||
// Arrange
|
|
||||||
const lineItems = {
|
|
||||||
glassParts: [],
|
|
||||||
supportingItems: [
|
|
||||||
{
|
|
||||||
description: null,
|
|
||||||
id: "9ff98501-03a4-432b-884e-e4e28f884a2f",
|
|
||||||
kitPrice: 0,
|
|
||||||
laborAmount: 34.98,
|
|
||||||
partNumber: "MOBILE FEE",
|
|
||||||
partType: "MOBILE FEE",
|
|
||||||
salesTax: 2.62,
|
|
||||||
sellingPrice: 0,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
vaps: [],
|
|
||||||
promos: [],
|
|
||||||
};
|
|
||||||
|
|
||||||
const availableVaps = [];
|
|
||||||
|
|
||||||
// Act
|
|
||||||
const { wrapper } = setupMocks({
|
|
||||||
props: {
|
|
||||||
modelValue: lineItems,
|
|
||||||
availableVaps: availableVaps,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
// Assert
|
|
||||||
expect(wrapper.vm.mobileFeeCartItem).not.toBeNull();
|
|
||||||
expect(wrapper.vm.mobileFeeCartItem.subTotal).toEqual(34.98);
|
|
||||||
expect(wrapper.vm.mobileFeeCartItem.salesTax).toEqual(2.62);
|
|
||||||
|
|
||||||
const found =
|
|
||||||
wrapper.vm.cartItems.findIndex(
|
|
||||||
(cartItem) => cartItem == wrapper.vm.mobileFeeCartItem
|
|
||||||
) >= 0;
|
|
||||||
expect(found).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
// 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("if there is service package discount fee on the order, a service package discount cart item should be added to the cart", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
|
|
|
||||||
|
|
@ -376,9 +376,6 @@ export default {
|
||||||
cartItems.push(this.suppliesRepairCartItem);
|
cartItems.push(this.suppliesRepairCartItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.mobileFeeCartItem) {
|
|
||||||
cartItems.push(this.mobileFeeCartItem);
|
|
||||||
}
|
|
||||||
if (this.servicePackageDiscountCartItem) {
|
if (this.servicePackageDiscountCartItem) {
|
||||||
cartItems.push(this.servicePackageDiscountCartItem);
|
cartItems.push(this.servicePackageDiscountCartItem);
|
||||||
}
|
}
|
||||||
|
|
@ -744,44 +741,6 @@ export default {
|
||||||
|
|
||||||
return cartItem;
|
return cartItem;
|
||||||
},
|
},
|
||||||
mobileFeeCartItemName() {
|
|
||||||
return this.getCmsContent("MobileServiceTextWidget", "Text");
|
|
||||||
},
|
|
||||||
mobileFeeCartItem() {
|
|
||||||
let cartItem = null;
|
|
||||||
|
|
||||||
const mobileFeeLineItem = this.supportingItems.find(
|
|
||||||
(lineItem) => lineItem.partType == partTypeStrings.MOBILE_FEE
|
|
||||||
);
|
|
||||||
|
|
||||||
if (mobileFeeLineItem) {
|
|
||||||
cartItem = {
|
|
||||||
name: this.mobileFeeCartItemName,
|
|
||||||
category: cartItemCategories.SUPPORTING_ITEMS,
|
|
||||||
cartItemType: cartItemTypes.MOBILE_FEE,
|
|
||||||
isDisplayed: true,
|
|
||||||
isRemovable: false,
|
|
||||||
subTotal: 0,
|
|
||||||
salesTax: 0,
|
|
||||||
lineItems: [],
|
|
||||||
isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes(
|
|
||||||
cartItemTypes.MOBILE_FEE
|
|
||||||
),
|
|
||||||
};
|
|
||||||
|
|
||||||
mobileFeeLineItem.cartItemType = cartItem.cartItemType;
|
|
||||||
cartItem.lineItems.push(mobileFeeLineItem);
|
|
||||||
|
|
||||||
cartItem.subTotal +=
|
|
||||||
(mobileFeeLineItem.kitPrice ?? 0) +
|
|
||||||
(mobileFeeLineItem.laborAmount ?? 0) +
|
|
||||||
(mobileFeeLineItem.sellingPrice ?? 0);
|
|
||||||
|
|
||||||
cartItem.salesTax += mobileFeeLineItem.salesTax ?? 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return cartItem;
|
|
||||||
},
|
|
||||||
servicePackageDiscountCartItemName() {
|
servicePackageDiscountCartItemName() {
|
||||||
return this.getCmsContent("ServicePackageDiscountTextWidget", "Text");
|
return this.getCmsContent("ServicePackageDiscountTextWidget", "Text");
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -235,7 +235,7 @@ export default {
|
||||||
getPackagePrice(packageName, { discountedPrice = false, servicePackageDiscount = false }) {
|
getPackagePrice(packageName, { discountedPrice = false, servicePackageDiscount = false }) {
|
||||||
var lineItemsToPrice = [...this.nullSafeAvailableLineItems];
|
var lineItemsToPrice = [...this.nullSafeAvailableLineItems];
|
||||||
if (this.isRecalibrationOnOrder) {
|
if (this.isRecalibrationOnOrder) {
|
||||||
lineItemsToPrice = this.nullSafeAvailableLineItems.filter((item) => {
|
lineItemsToPrice = lineItemsToPrice.filter((item) => {
|
||||||
return item.partType != partTypeStrings.RECALIBRATION;
|
return item.partType != partTypeStrings.RECALIBRATION;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,11 +24,6 @@
|
||||||
{{ errorMessage }}
|
{{ errorMessage }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<textBlock
|
|
||||||
v-if="mobileFeeApplies"
|
|
||||||
:customText="mobileFeeText"
|
|
||||||
cmsWidgetName="MobileFeeDisclaimerWidget"
|
|
||||||
typeStyle="caption" />
|
|
||||||
</div>
|
</div>
|
||||||
<modal
|
<modal
|
||||||
:ref="modalName"
|
:ref="modalName"
|
||||||
|
|
@ -154,7 +149,6 @@ export default {
|
||||||
alertInvalidZipWidgetName: String,
|
alertInvalidZipWidgetName: String,
|
||||||
customComponentId: String,
|
customComponentId: String,
|
||||||
validationRules: String,
|
validationRules: String,
|
||||||
mobileFeeApplies: Boolean,
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
mobileLocationLinkPromptText() {
|
mobileLocationLinkPromptText() {
|
||||||
|
|
@ -182,21 +176,6 @@ export default {
|
||||||
modalHeaderText() {
|
modalHeaderText() {
|
||||||
return this.getCmsContent(this.modalWidgetName, "HeaderText");
|
return this.getCmsContent(this.modalWidgetName, "HeaderText");
|
||||||
},
|
},
|
||||||
mobileFeeText() {
|
|
||||||
const cmsContentText = this.getCmsContent("MobileFeeDisclaimerWidget", "Text");
|
|
||||||
return cmsContentText.replaceAll("{custom:mobileFee}", this.mobileFee);
|
|
||||||
},
|
|
||||||
mobileFee() {
|
|
||||||
if (!this.mobileFeePart) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
this.mobileFeePart.laborAmount +
|
|
||||||
this.mobileFeePart.sellingPrice +
|
|
||||||
this.mobileFeePart.kitPrice
|
|
||||||
);
|
|
||||||
},
|
|
||||||
modalFooterText() {
|
modalFooterText() {
|
||||||
return this.getCmsContent(this.modalWidgetName, "FooterText");
|
return this.getCmsContent(this.modalWidgetName, "FooterText");
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,12 @@
|
||||||
cmsWidgetName="AlertNoShopsWidget"
|
cmsWidgetName="AlertNoShopsWidget"
|
||||||
v-if="displayNoShopsAlert"
|
v-if="displayNoShopsAlert"
|
||||||
alertClass="alert-warning" />
|
alertClass="alert-warning" />
|
||||||
|
<alert
|
||||||
|
ref="alertMobileFeeFree"
|
||||||
|
class="my-5"
|
||||||
|
cmsWidgetName="AlertMobileFeeFreeWidget"
|
||||||
|
v-if="isServiceableMobile && !isInsurance"
|
||||||
|
alertClass="alert-success" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row justify-content-center appointment-type">
|
<div class="row justify-content-center appointment-type">
|
||||||
|
|
@ -81,7 +87,6 @@
|
||||||
v-if="selectedAppointmentType === 'Mobile'"
|
v-if="selectedAppointmentType === 'Mobile'"
|
||||||
v-model="mobileLocationQuestions"
|
v-model="mobileLocationQuestions"
|
||||||
:mobileFeePart="mobileFeePart"
|
:mobileFeePart="mobileFeePart"
|
||||||
:mobileFeeApplies="mobileFeeApplies"
|
|
||||||
@updated-mobile-fee-part="setMobileFeePart"
|
@updated-mobile-fee-part="setMobileFeePart"
|
||||||
@updated-serviceability="setServiceabilityDetails"
|
@updated-serviceability="setServiceabilityDetails"
|
||||||
@updated-contains-military-base="setContainsMilitaryBase"
|
@updated-contains-military-base="setContainsMilitaryBase"
|
||||||
|
|
@ -355,6 +360,9 @@ export default {
|
||||||
recalibrationInformationModal() {
|
recalibrationInformationModal() {
|
||||||
return this.$refs.recalibrationInformationModal;
|
return this.$refs.recalibrationInformationModal;
|
||||||
},
|
},
|
||||||
|
isInsurance() {
|
||||||
|
return store.getters.payment.isInsurance;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
arePagePrerequisitesValid() {
|
arePagePrerequisitesValid() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue