From 06a2d381fa6728ed5e9847fdbb81f52ca488cbbe Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Thu, 26 Sep 2024 17:34:13 -0400 Subject: [PATCH] Tweaks to dev changes --- src/layouts/confirmation/confirmation.vue | 6 ++---- src/layouts/quote/quote.vue | 12 +++--------- src/store/store.spec.js | 23 ++++++++++++----------- 3 files changed, 17 insertions(+), 24 deletions(-) diff --git a/src/layouts/confirmation/confirmation.vue b/src/layouts/confirmation/confirmation.vue index 72ee038db..c7f944078 100644 --- a/src/layouts/confirmation/confirmation.vue +++ b/src/layouts/confirmation/confirmation.vue @@ -108,6 +108,7 @@ import { getDisplayTextForDurationLength } from "@/helpers/duration-length-helpe import { experimentSettings } from "@/constants/experiments"; import { partTypeStrings } from "@/constants/part-type-strings"; import { containsLineItemWithPartType } from "@/helpers/service-package-helper"; +import { containsRecalParts } from "@/helpers/recal-helper.js"; export default { name: "confirmation", @@ -170,10 +171,7 @@ export default { }, computed: { isRecalibrationOnOrder() { - return containsLineItemWithPartType( - partTypeStrings.RECALIBRATION, - this?.lineItems?.supportingItems - ); + return containsRecalParts(this?.lineItems); }, shouldHideRecalibration() { return ( diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index c8e2dda02..b778116e9 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -583,9 +583,8 @@ export default { if (tier) { let lineItemsToPrice = this.availableLineItems; if (this.isRecalibrationOnOrder && this.shouldHideRecalibration) { - lineItemsToPrice = lineItemsToPrice?.filter((item) => { - return item.partType != partTypeStrings.RECALIBRATION; - }); + lineItemsToPrice = + baseMixin.methods.filterOutRecalibration(lineItemsToPrice); } if (this.isServicePackageDiscountOnOrder) { lineItemsToPrice = lineItemsToPrice?.filter((item) => { @@ -609,12 +608,7 @@ export default { }); eventLabel = eventLabel.slice(0, -1); - this.pushEventToGA( - "quote", - this.GaActions.SERVICE_PACKAGE_PRICE, - eventLabel, - true - ); + this.pushEventToGA("quote", this.GaActions.SERVICE_PACKAGE_PRICE, eventLabel, true); }); }, }, diff --git a/src/store/store.spec.js b/src/store/store.spec.js index 6c36c6c26..9c546d3be 100644 --- a/src/store/store.spec.js +++ b/src/store/store.spec.js @@ -4003,17 +4003,18 @@ describe("Getters", () => { requiresCapabilityQuestions: false, childParts: [ { - "partNumber": "THIRD RECAL", - "description": "Additional Static Recal", - "recalibrationType": "DUAL & RECAL THIRD & HC FUNCTION TEST & RL SENSOR", - "ribCode": "RL", - "safelitePartNumber": "THIRD RECAL", - "status": "ACTIVE", - "partType": "ADAS RECALIBRATION", - "childParts": [], - "recalibrationFees": [], - "salesTax": null - } + partNumber: "THIRD RECAL", + description: "Additional Static Recal", + recalibrationType: + "DUAL & RECAL THIRD & HC FUNCTION TEST & RL SENSOR", + ribCode: "RL", + safelitePartNumber: "THIRD RECAL", + status: "ACTIVE", + partType: "ADAS RECALIBRATION", + childParts: [], + recalibrationFees: [], + salesTax: null, + }, ], }, ],