diff --git a/src/layouts/confirmation/confirmation.vue b/src/layouts/confirmation/confirmation.vue index acb97cba2..bfe369588 100644 --- a/src/layouts/confirmation/confirmation.vue +++ b/src/layouts/confirmation/confirmation.vue @@ -93,7 +93,6 @@ import textBlock from "@/digital-components/text-block/text-block"; //Supporting files import baseMixin from "@/mixins/base-mixin.js"; -import analyticsMixin from "@/mixins/analytics-mixin"; import store from "@/store"; import { storeActions } from "@/constants/store-actions"; import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; @@ -107,7 +106,8 @@ import { get12HourTimeFormat, get12HourTimeMobileFormat } from "@/helpers/date-h import { coverageStatus } from "@/constants/insurance"; import { getDisplayTextForDurationLength } from "@/helpers/duration-length-helper"; import { experimentSettings } from "@/constants/experiments"; -import experimentMixin from "@/mixins/experiment-mixin.js"; +import { partTypeStrings } from "@/constants/part-type-strings"; +import { containsLineItemWithPartType } from "@/helpers/service-package-helper"; export default { name: "confirmation", @@ -169,8 +169,17 @@ export default { }; }, computed: { + isRecalibrationOnOrder() { + return containsLineItemWithPartType( + partTypeStrings.RECALIBRATION, + this?.lineItems?.supportingItems + ); + }, shouldHideRecalibration() { - return this.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE); + return ( + this.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE)?.toLowerCase() === "true" && + this.isRecalibrationOnOrder + ); }, ShowCart() { if (this.isPia && this.submittedOrder?.settledTenderAmount == 0) { diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index 9b7222bfc..19b7cf261 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -593,7 +593,7 @@ export default { }, shouldHideRecalibration() { return ( - this.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE).toLowerCase() === "true" && + this.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE)?.toLowerCase() === "true" && this.isRecalibrationOnOrder ); }, diff --git a/src/layouts/quote/quote.spec.js b/src/layouts/quote/quote.spec.js index ef5c945a3..d9c1ffabf 100644 --- a/src/layouts/quote/quote.spec.js +++ b/src/layouts/quote/quote.spec.js @@ -7,6 +7,7 @@ import store from "@/store"; import * as navigateToHeritage from "@/helpers/heritage-integration/navigation-helper"; import { nextTick } from "vue"; import { experimentSettings } from "@/constants/experiments"; +import experimentMixin from "@/mixins/experiment-mixin.js"; import baseMixin from "@/mixins/base-mixin.js"; import { containsLineItemWithPartType } from "../../helpers/service-package-helper"; @@ -746,6 +747,14 @@ function setupMocks({ customMountOptions }) { ...customMountOptions, }); + mountOptions.mixins = [ + { + methods: { + getSettingValue: jest.fn(), + }, + }, + ]; + baseMixin.methods.ResetExternalParamsAndHideModal = jest.fn(); baseMixin.methods.isFormValid = jest.fn().mockReturnValue(true); mountOptions.global.mocks["$store"] = store; diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index 083862763..d53215a60 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -15,13 +15,6 @@ -
-

thresholdToUse: {{ thresholdToUse }}

-

externalSource: {{ externalSource }}

-

typeof recalSettingValue: {{ typeof recalSettingValue }}

-

recalSettingValue: {{ recalSettingValue }}

-
- insuranceThreshold; // compare base price vs arbitrary threshold (representing insurance price) + return ( + baseMixin.methods.getTierOnePackagePrice(lineItemsForCalculatingPrice) > + insuranceThreshold + ); // compare base price vs arbitrary threshold (representing insurance price) } else { return null; } @@ -341,15 +333,20 @@ export default { experimentSettings.INSURANCE_TAB_TO_DISPLAY_THRESHOLD_INTERNAL ); - if (!store.getters.externalParameterState?.isExternalParameter) { // there are no external parameters + if (!store.getters.externalParameterState?.isExternalParameter) { + // there are no external parameters if (internalThreshold) thresholdToUse = internalThreshold; - vm.isInsuranceSelected = getIsInsuranceSelectedValue(vm.availableLineItems, thresholdToUse); + vm.isInsuranceSelected = getIsInsuranceSelectedValue( + vm.availableLineItems, + thresholdToUse + ); baseMixin.methods.ResetExternalParamsAndHideModal(); + } else { + // there ARE external parameters - } else { // there ARE external parameters - - if (store.getters.externalParameterQuote.isInsurance == true) { // did user intentionally select insurance? + if (store.getters.externalParameterQuote.isInsurance == true) { + // did user intentionally select insurance? vm.isInsuranceSelected = true; vm.servicePackage = store.getters.externalParameterQuote.servicePackage; await nextTick(); @@ -361,9 +358,9 @@ export default { } } else { // did user come from external source (LeadGen)? - let externalSource = store.getters.externalParameterSource ? store.getters.externalParameterSource : null; - - vm.externalSource = externalSource; // TEMP 9/23 + let externalSource = store.getters.externalParameterSource + ? store.getters.externalParameterSource + : null; // Business logic to determine what "external" source is if (externalSource?.includes("LeadGen")) { @@ -374,13 +371,13 @@ export default { } else { if (internalThreshold) thresholdToUse = internalThreshold; } - vm.isInsuranceSelected = getIsInsuranceSelectedValue(vm.availableLineItems, thresholdToUse); + vm.isInsuranceSelected = getIsInsuranceSelectedValue( + vm.availableLineItems, + thresholdToUse + ); baseMixin.methods.ResetExternalParamsAndHideModal(); } - } - - vm.thresholdToUse = thresholdToUse; }); }, data() { @@ -392,9 +389,6 @@ export default { servicePackage: null, holdParentAccountNumber: null, holdBillToAccountNumber: null, - - thresholdToUse: null, // TEMP 9/23 - externalSource: null, // TEMP 9/23 }; }, computed: { @@ -408,10 +402,10 @@ export default { ); }, shouldHideRecalibration() { - const recalSettingValue = experimentMixin.methods.getSettingValue( - experimentSettings.RECAL_PRICE_REMOVE - )?.toLowerCase() === "true"; - return recalSettingValue; + return ( + this.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE)?.toLowerCase() === "true" && + this.isRecalibrationOnOrder + ); }, showAfterpayBanner() { return ( diff --git a/src/layouts/quote/service-package-question/service-package-question.vue b/src/layouts/quote/service-package-question/service-package-question.vue index b092ea65b..1a9ed4ed8 100644 --- a/src/layouts/quote/service-package-question/service-package-question.vue +++ b/src/layouts/quote/service-package-question/service-package-question.vue @@ -1,15 +1,4 @@