From 62993978fcd4e287109e902a56853641674d17fe Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 23 Apr 2024 09:19:46 -0400 Subject: [PATCH 1/9] CSR-1742: correct wrong widget name --- src/fmg-components/funnel-sub-header/funnel-sub-header.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fmg-components/funnel-sub-header/funnel-sub-header.vue b/src/fmg-components/funnel-sub-header/funnel-sub-header.vue index 20e18ba1c..b664e491c 100644 --- a/src/fmg-components/funnel-sub-header/funnel-sub-header.vue +++ b/src/fmg-components/funnel-sub-header/funnel-sub-header.vue @@ -53,7 +53,7 @@ export default { return this.leftAlignHeader ? "justify-content-start" : "justify-content-center"; }, subText() { - return this.getCmsContent(this.cmsWidgetName, "HeaderSubText"); + return this.getCmsContent(this.cmsWidgetName, "SubheaderText"); }, backButtonAccessibleText() { return this.getCmsContent(this.cmsWidgetName, "BackButtonAccessibleText"); From 35a8dc6045751394056c85a71ffae2de9bdf776f Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 23 Apr 2024 09:21:16 -0400 Subject: [PATCH 2/9] CSR-1742: add specialized getter for CMS variable use --- src/store/index.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/store/index.js b/src/store/index.js index c79269458..cac2baf7c 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -756,6 +756,18 @@ export const getters = { .reduce((r, c) => Object.assign(r, c), {}) ?? {}, submittedOrder: (state) => JSON.parse(window.sessionStorage.getItem("submittedOrder")), hasSubmittedOrder: (state) => window.sessionStorage.getItem("submittedOrder") !== null, + isVerifiedAndDeductibleZeroConfirmed: (state) => { + // used as a CMS variable on /payment-method, needed for FunnelSubHeaderWidget on cart pages + if ( + state.order.policy.currentDeductible && + state.order.policy.currentDeductible === 0 && + state.order.payment.insuranceCoverage.coverageStatus === "Verified" && + !state.order.policy.isNoComp + ) { + return true; + } + return false; + }, }; function getNonFalseValuesOfPropertyInArrayOfObjects(array, propertyName) { From 120920178c510273011493b475a36b4a4ac5de7b Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 23 Apr 2024 09:30:25 -0400 Subject: [PATCH 3/9] CSR-1742: work on cart to update for insurance orders --- src/constants/coverage-status.js | 2 + src/fmg-components/cart/cart.vue | 182 +++++++++++++++--- src/layouts/payment-method/payment-method.vue | 32 ++- 3 files changed, 191 insertions(+), 25 deletions(-) diff --git a/src/constants/coverage-status.js b/src/constants/coverage-status.js index 7cf757aed..1c75c00a6 100644 --- a/src/constants/coverage-status.js +++ b/src/constants/coverage-status.js @@ -16,3 +16,5 @@ export function coverageStatusValue(intCoverageStatus) { return null; } } + +export { coverageStatus }; diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index ebbaf530b..0967b37bb 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -10,11 +10,28 @@ href="javascript:void(0)" class="col d-flex justify-content-between py-0"> {{ amountDueText }} - {{ getFormattedAmount("", amountDue) }} + {{ + isInsuranceStatusPending + ? verifyingCoverageText + : getFormattedAmount("", amountDue) + }}
+ +
+ + + {{ + isInsuranceStatusPending + ? verifyingCoverageText + : getFormattedAmount("", deductibleLineItem.subTotal) + }} + +
+ +
@@ -78,13 +95,23 @@ {{ recycleFeeCartItem.name }} - {{ getFormattedAmount(cartItem.category, cartItem.subTotal) }} + {{ getFormattedAmount(cartItem.category, cartItem.subTotal) }}
{{ subtotalText }}{{ getFormattedAmount("", subTotal) }} + >{{ + isInsuranceStatusPending + ? verifyingCoverageText + : getFormattedAmount("", subTotal) + }}
{{ salesTaxText }}
{{ amountDueText }}{{ getFormattedAmount("", amountDue) }} + >{{ + isInsuranceStatusPending + ? verifyingCoverageText + : getFormattedAmount("", amountDue) + }}
+
+ {{ insuranceCompanyName }} +
0) + ) + return true; + return false; + }, + isInsuranceStatusVerified() { + return this.insuranceCoverageStatus === coverageStatus.VERIFIED; + }, + currentDeductible() { + if (this.insuranceCoverageStatus === coverageStatusValue(2)) + return this.currentDeductibleFromStore; + return null; + }, screenReaderTotalAmountDueText() { return this.getCmsContent("ScreenReaderTotalAmountDueWidget", "Text"); }, @@ -364,11 +419,16 @@ export default { return tier; }, packagePrice() { - let packagePrice = this.isInsuranceSelected - ? 0 - : baseMixin.methods.getTierOnePackagePrice( - baseMixin.methods.filterOutFees(this.availableLineItems) - ); + let packagePrice = 0; + + if ( + !this.isInsuranceStatusVerified || + (this.isInsuranceStatusVerified && this.isInsuranceStatusPending) + ) { + packagePrice = baseMixin.methods.getTierOnePackagePrice( + baseMixin.methods.filterOutFees(this.availableLineItems) + ); + } packagePrice += this.getVapsPrice(this.packageLevel); @@ -410,7 +470,25 @@ export default { const promos = this.lineItems?.promos; return promos?.length > 0 ? promos : []; }, - // Cart Items + deductibleLineItemName() { + return this.getCmsContent("DeductibleTextWidget", "Text"); + }, + deductibleLineItem() { + let lineItem = null; + + if (this.isInsuranceStatusVerified || this.isInsuranceStatusPending) { + lineItem = { + name: this.deductibleLineItemName, + subTotal: this.currentDeductible >= 0 ? this.currentDeductible : null, + }; + } + + return lineItem; + }, + verifyingCoverageText() { + return this.getCmsContent("VerifyingCoverageTextWidget", "Text"); + }, + // Cart Item Groupings packageCartItems() { return this.getVapsCartItemsForSelectedPackage(this.packageLevel); }, @@ -426,6 +504,7 @@ export default { }); return nonpackageCartItems; }, + // Individual Cart Items frontWiperCartItemName() { return this.getCmsContentForVapsType(partTypeStrings.FRONT_WIPER); }, @@ -446,6 +525,7 @@ export default { subTotal: 0, salesTax: 0, lineItems: [], + isCoveredByInsurance: false, }; frontWiperLineItems.forEach((lineItem) => { @@ -483,6 +563,7 @@ export default { subTotal: 0, salesTax: 0, lineItems: [], + isCoveredByInsurance: false, }; rearWiperLineItems.forEach((lineItem) => { @@ -520,6 +601,7 @@ export default { subTotal: 0, salesTax: 0, lineItems: [], + isCoveredByInsurance: false, }; rainDefenseLineItem.cartItemType = cartItem.cartItemType; @@ -553,6 +635,7 @@ export default { salesTax: lineItem.salesTax ?? 0, lineItems: [], + isCoveredByInsurance: true, }; if (lineItem.childParts?.length > 0) { @@ -592,6 +675,7 @@ export default { subTotal: 0, salesTax: 0, lineItems: [], + isCoveredByInsurance: true, }; recycleFeeLineItem.cartItemType = cartItem.cartItemType; @@ -629,6 +713,7 @@ export default { subTotal: 0, salesTax: 0, lineItems: [], + isCoveredByInsurance: true, }; suppliesRepairLineItem.cartItemType = cartItem.cartItemType; @@ -664,6 +749,7 @@ export default { subTotal: 0, salesTax: 0, lineItems: [], + isCoveredByInsurance: false, }; mobileFeeLineItem.cartItemType = cartItem.cartItemType; @@ -697,6 +783,7 @@ export default { subTotal: 0, salesTax: 0, lineItems: [], + isCoveredByInsurance: true, }; otherSupportingItemsLineItems.forEach((lineItem) => { @@ -715,7 +802,7 @@ export default { return cartItem; }, premiumAppointmentDiscountCartItemName() { - return "Early bird appointment"; // TODO: get from CMS + return this.getCmsContent("PremiumAppointmentTextWidget", "Text"); }, premiumAppointmentDiscountCartItem() { let cartItem = null; @@ -734,6 +821,7 @@ export default { subTotal: 0, salesTax: 0, lineItems: [], + isCoveredByInsurance: false, }; premiumAppointmentDiscountLineItem.cartItemType = cartItem.cartItemType; @@ -779,6 +867,7 @@ export default { subTotal: 0, salesTax: 0, lineItems: [], + isCoveredByInsurance: false, }; promoLineItems.forEach((promoLineItem) => { @@ -820,17 +909,38 @@ export default { subTotal() { let subTotal = 0; - this.cartItems.forEach((cartItem) => { - subTotal += cartItem.subTotal; - }); + if (this.isInsuranceStatusVerified) { + // only include items NOT covered by insurance + this.cartItems.forEach((cartItem) => { + if (!cartItem.isCoveredByInsurance) { + subTotal += cartItem.subTotal ?? 0; + } + }); + // add deductible amount still to pay + subTotal += this.deductibleLineItem.subTotal ?? 0; + } else { + this.cartItems.forEach((cartItem) => { + subTotal += cartItem.subTotal ?? 0; + }); + } return subTotal; }, salesTax() { let salesTax = 0; - this.cartItems.forEach((cartItem) => { - salesTax += cartItem.salesTax ?? 0; - }); + + if (this.isInsuranceStatusVerified) { + // only include items NOT covered by insurance + this.cartItems.forEach((cartItem) => { + if (!cartItem.isCoveredByInsurance) { + salesTax += cartItem.salesTax ?? 0; + } + }); + } else { + this.cartItems.forEach((cartItem) => { + salesTax += cartItem.salesTax ?? 0; + }); + } return salesTax; }, @@ -893,7 +1003,7 @@ export default { display: flex; justify-content: space-between; padding: 0.5rem 1.5rem; - &:nth-last-child(-n + 4) { + &:nth-last-child(-n + 3) { background-color: $green-100; } &:last-child { @@ -901,16 +1011,26 @@ export default { color: #ffffff; } } + .deductible { + background-color: $gray-100; + } .service-type { background-color: $gray-100; - align-items: center; + } + .deductible ~ .service-type { + background: $white; + } + .service-type ~ .packaged-cart-item { + background-color: $gray-100; + } + .deductible ~ .packaged-cart-item { + background: $white; } .struck-out-price { text-decoration: line-through; padding-left: 0.5rem; } .packaged-cart-item { - background-color: $gray-100; padding-left: 2.5rem; align-items: center; span { @@ -937,6 +1057,11 @@ export default { background: $gray-100; } } + .deductible ~ .non-packaged-cart-item { + &.odd { + background: $white; + } + } .non-packaged-cart-item { &.even { background-color: $white; @@ -945,6 +1070,11 @@ export default { line-height: 1.625; } } + .deductible ~ .non-packaged-cart-item { + &.even { + background-color: $gray-100; + } + } // Custom order/wrap for removable nonpackaged Cart Items .removable-cart-item { flex-wrap: wrap; @@ -959,8 +1089,8 @@ export default { } } .package-type, - .service-type { - //background-color: #f5f5f5; + .service-type, + .deductible { align-items: center; } .sub-total, @@ -973,15 +1103,19 @@ export default { .sub-total { border-top: 1px solid $green; } - .service-type { - // background-color: #f5f5f5; + .service-type, + .deductible { .text-block { background: transparent; margin-top: 0; padding: 0; + width: 50%; } } } + .insurance-company-name { + margin-top: 0.5rem; + } .vin-toggle { &:after { content: ""; diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index 207b7f041..a97ea9a3a 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -28,7 +28,10 @@ v-model="lineItems" pageName="payment-method" servicePackageOptionsCmsName="ServicePackageTitle" - recyclingModalCmsWidgetName="RecycleModal" /> + recyclingModalCmsWidgetName="RecycleModal" + :currentDeductibleFromStore="currentDeductible" + :insuranceCompanyName="insuranceCompanyName" + :insuranceCoverageStatus="insuranceCoverageStatus" />
@@ -110,6 +113,7 @@ import { errorMessages } from "@/constants/error-messages"; import { AppointmentTypeStrings } from "@/constants/schedule-constants"; import { partTypeStrings } from "@/constants/part-type-strings"; import { mapTaxedLineItemsToStoreFormat } from "../../store"; +import { coverageStatus } from "@/constants/coverage-status"; defineRule("option-required", required(errorMessages.OPTION_REQUIRED)); @@ -496,6 +500,32 @@ export default { damageInfo() { return this.$store.getters.damage; }, + isInsurance() { + return this.$store.getters.payment.isInsurance; + }, + isNoComp() { + return this.$store.getters.policy.isNoComp; + }, + hasVapsInCart() { + if (this.lineItems?.vaps?.length > 0) { + return true; + } + return false; + }, + insuranceCoverageStatus() { + if (!this.isInsurance) return null; + if (this.isNoComp) { + return coverageStatus.NOCOMP; + } else { + return this.$store.getters.payment.insuranceCoverage.coverageStatus; + } + }, + currentDeductible() { + return this.$store.getters.policy.currentDeductible; + }, + insuranceCompanyName() { + return this.$store.getters.policy.insuranceCompanyName; + }, noPiaDisclaimer() { return this.getCmsContent("NoPiaDisclaimerWidget", "Text"); }, From a3d4ffb057475b5132f7d7fd121aaa7a97bed834 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 23 Apr 2024 09:30:49 -0400 Subject: [PATCH 4/9] CSR-1742: update unit test so it will run --- src/layouts/payment-method/payment-method.spec.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/layouts/payment-method/payment-method.spec.js b/src/layouts/payment-method/payment-method.spec.js index 8cba373de..ab0a0df99 100644 --- a/src/layouts/payment-method/payment-method.spec.js +++ b/src/layouts/payment-method/payment-method.spec.js @@ -53,6 +53,12 @@ function setupMocks() { isPia: false, }, }, + policy: { + currentDeductible: 123, + }, + payment: { + isInsurance: false, + }, }; const mountOptions = getMountOptions({ From 310e77383a943d14b90ea9c453aed6a3a3698659 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 23 Apr 2024 09:38:17 -0400 Subject: [PATCH 5/9] CSR-1742: change for consistency --- src/fmg-components/cart/cart.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index 0967b37bb..0dad87b0d 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -175,7 +175,7 @@ import { getPromoCodeWithoutBundleIdentifier } from "@/helpers/promotions-helper import { partTypeStrings } from "@/constants/part-type-strings"; import { cartItemCategories } from "@/constants/cart-item-categories"; import { cartItemTypes } from "@/constants/cart-item-types"; -import { coverageStatus, coverageStatusValue } from "@/constants/coverage-status"; +import { coverageStatus } from "@/constants/coverage-status"; export default { name: "cart", @@ -306,7 +306,7 @@ export default { return this.insuranceCoverageStatus === coverageStatus.VERIFIED; }, currentDeductible() { - if (this.insuranceCoverageStatus === coverageStatusValue(2)) + if (this.insuranceCoverageStatus === coverageStatus.VERIFIED) return this.currentDeductibleFromStore; return null; }, From d3bc079eba0712aaaa99f3c8cefed21c1700052f Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 23 Apr 2024 17:38:47 -0400 Subject: [PATCH 6/9] CSR-1742: update logic on store getter for CMS variable to determine which paragraph shows in subheader --- src/store/index.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index cac2baf7c..097c16689 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -29,7 +29,7 @@ import { } from "@/helpers/promotions-helper"; import { getDateDifferenceInDays } from "@/helpers/date-helper"; import sharedMutations from "./vuex-shared-mutations/vuexSharedMutations"; -import { coverageStatusValue } from "@/constants/coverage-status"; +import { coverageStatus, coverageStatusValue } from "@/constants/coverage-status"; // Export State const getDefaultState = () => { return { @@ -759,9 +759,8 @@ export const getters = { isVerifiedAndDeductibleZeroConfirmed: (state) => { // used as a CMS variable on /payment-method, needed for FunnelSubHeaderWidget on cart pages if ( - state.order.policy.currentDeductible && - state.order.policy.currentDeductible === 0 && - state.order.payment.insuranceCoverage.coverageStatus === "Verified" && + (state.order.policy.currentDeductible === 0 || state.order.policy.currentDeductible > 0) && + state.order.payment.insuranceCoverage.coverageStatus === coverageStatus.VERIFIED && !state.order.policy.isNoComp ) { return true; From 15ca0785c16572f82a402d2481f03484ee4e2692 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 23 Apr 2024 17:39:47 -0400 Subject: [PATCH 7/9] CSR-1742: update naming and some logic to simplify --- src/fmg-components/cart/cart.vue | 63 +++++++++---------- src/layouts/payment-method/payment-method.vue | 19 ++++-- 2 files changed, 43 insertions(+), 39 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index 0dad87b0d..5b081cd5b 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -11,7 +11,7 @@ class="col d-flex justify-content-between py-0"> {{ amountDueText }} {{ - isInsuranceStatusPending + isCoverageTypeToDisplayPending ? verifyingCoverageText : getFormattedAmount("", amountDue) }} @@ -24,7 +24,7 @@ {{ - isInsuranceStatusPending + isCoverageTypeToDisplayPending ? verifyingCoverageText : getFormattedAmount("", deductibleLineItem.subTotal) }} @@ -97,8 +97,8 @@ {{ getFormattedAmount(cartItem.category, cartItem.subTotal) }} @@ -106,25 +106,25 @@
- {{ subtotalText }}{{ - isInsuranceStatusPending + {{ subtotalText }} + {{ + isCoverageTypeToDisplayPending ? verifyingCoverageText : getFormattedAmount("", subTotal) }}
- {{ salesTaxText }}{{ getFormattedAmount("", salesTax) }} + {{ salesTaxText }} + {{ getFormattedAmount("", salesTax) }}
{{ amountPaidText }}{{ getFormattedAmount("", amountPaid) }}
- {{ amountDueText }}{{ - isInsuranceStatusPending + {{ amountDueText }} + {{ + isCoverageTypeToDisplayPending ? verifyingCoverageText : getFormattedAmount("", amountDue) }} @@ -188,9 +188,9 @@ export default { allowItemRemoval: Boolean, recyclingModalCmsWidgetName: String, showAsPaid: Boolean, - currentDeductibleFromStore: Number, + insuranceDeductible: Number, insuranceCompanyName: String, - insuranceCoverageStatus: String, + insuranceCoverageTypeToDisplay: String, }, data() { return { @@ -293,22 +293,18 @@ export default { this.$emit("update:modelValue", newValue); }, }, - isInsuranceStatusPending() { - if (this.insuranceCoverageStatus === coverageStatus.PENDING) return true; - if ( - this.insuranceCoverageStatus === coverageStatus.VERIFIED && - !(this.currentDeductible === 0 || this.currentDeductible > 0) - ) - return true; - return false; + isCoverageTypeToDisplayPending() { + return this.insuranceCoverageTypeToDisplay === coverageStatus.PENDING; }, - isInsuranceStatusVerified() { - return this.insuranceCoverageStatus === coverageStatus.VERIFIED; + isCoverageTypeToDisplayVerified() { + return this.insuranceCoverageTypeToDisplay === coverageStatus.VERIFIED; }, currentDeductible() { - if (this.insuranceCoverageStatus === coverageStatus.VERIFIED) - return this.currentDeductibleFromStore; - return null; + const deductible = this.insuranceDeductible; + if (!(deductible === 0 || deductible > 0)) { + global.$logger.logError("Error: currentDeductible should not be null"); + } + return deductible; }, screenReaderTotalAmountDueText() { return this.getCmsContent("ScreenReaderTotalAmountDueWidget", "Text"); @@ -421,10 +417,7 @@ export default { packagePrice() { let packagePrice = 0; - if ( - !this.isInsuranceStatusVerified || - (this.isInsuranceStatusVerified && this.isInsuranceStatusPending) - ) { + if (!this.isCoverageTypeToDisplayVerified) { packagePrice = baseMixin.methods.getTierOnePackagePrice( baseMixin.methods.filterOutFees(this.availableLineItems) ); @@ -476,10 +469,10 @@ export default { deductibleLineItem() { let lineItem = null; - if (this.isInsuranceStatusVerified || this.isInsuranceStatusPending) { + if (this.isCoverageTypeToDisplayVerified || this.isCoverageTypeToDisplayPending) { lineItem = { name: this.deductibleLineItemName, - subTotal: this.currentDeductible >= 0 ? this.currentDeductible : null, + subTotal: this.currentDeductible, }; } @@ -909,7 +902,7 @@ export default { subTotal() { let subTotal = 0; - if (this.isInsuranceStatusVerified) { + if (this.isCoverageTypeToDisplayVerified) { // only include items NOT covered by insurance this.cartItems.forEach((cartItem) => { if (!cartItem.isCoveredByInsurance) { @@ -929,7 +922,7 @@ export default { salesTax() { let salesTax = 0; - if (this.isInsuranceStatusVerified) { + if (this.isCoverageTypeToDisplayVerified) { // only include items NOT covered by insurance this.cartItems.forEach((cartItem) => { if (!cartItem.isCoveredByInsurance) { diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index a97ea9a3a..db82a7a34 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -29,9 +29,9 @@ pageName="payment-method" servicePackageOptionsCmsName="ServicePackageTitle" recyclingModalCmsWidgetName="RecycleModal" - :currentDeductibleFromStore="currentDeductible" + :insuranceDeductible="currentDeductible" :insuranceCompanyName="insuranceCompanyName" - :insuranceCoverageStatus="insuranceCoverageStatus" /> + :insuranceCoverageTypeToDisplay="insuranceCoverageTypeToDisplay" />
@@ -335,7 +335,18 @@ export default { (isMobile && mobileReqs) || (!isMobile && dropOffInshopReqs); // Insurance - const isInsuranceSet = store.getters.order.payment.isInsurance !== null; + const isInsurance = store.getters.order.payment.isInsurance; + const insuranceCoverageStatus = store.getters.payment.insuranceCoverage.coverageStatus; + const currentDeductible = store.getters.policy.currentDeductible; + const isInsuranceSet = () => { + if (isInsurance !== null) { + if (insuranceCoverageStatus === coverageStatus.VERIFIED && !(currentDeductible === 0 || currentDeductible > 0) ) { + return false; // if coverageStatus is verified there must be a valid deductible also + } + return true; + } + return false; + }; // Schedule const schedule = store.getters.order.schedule; @@ -512,7 +523,7 @@ export default { } return false; }, - insuranceCoverageStatus() { + insuranceCoverageTypeToDisplay() { if (!this.isInsurance) return null; if (this.isNoComp) { return coverageStatus.NOCOMP; From a0a6f1303b62a205350478de68055777d9da7e38 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 23 Apr 2024 17:51:44 -0400 Subject: [PATCH 8/9] CSR-1742: update cart test to accept global --- src/fmg-components/cart/cart.spec.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/fmg-components/cart/cart.spec.js b/src/fmg-components/cart/cart.spec.js index bd0a2b096..cbb5a1610 100644 --- a/src/fmg-components/cart/cart.spec.js +++ b/src/fmg-components/cart/cart.spec.js @@ -5,6 +5,13 @@ import cart from "@/fmg-components/cart/cart.vue"; import { shallowMount } from "@vue/test-utils"; import { getMountOptions } from "@/helpers/unit-test-helper.js"; +global.$logger = { + logInformation: jest.fn(), + logWarning: jest.fn(), + logError: jest.fn(), + logCritical: jest.fn(), +}; + describe("cart.vue", () => { describe("cartItem computeds", () => { test("if there are one or more front wipers on the order, a front wiper cart item should be added to the cart", () => { From 6789713d1dd2d1937f962c939d192c9c0a6a0d8f Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Wed, 24 Apr 2024 09:08:36 -0400 Subject: [PATCH 9/9] prettier --- src/layouts/payment-method/payment-method.vue | 5 ++++- src/store/index.js | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index db82a7a34..c4e98e114 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -340,7 +340,10 @@ export default { const currentDeductible = store.getters.policy.currentDeductible; const isInsuranceSet = () => { if (isInsurance !== null) { - if (insuranceCoverageStatus === coverageStatus.VERIFIED && !(currentDeductible === 0 || currentDeductible > 0) ) { + if ( + insuranceCoverageStatus === coverageStatus.VERIFIED && + !(currentDeductible === 0 || currentDeductible > 0) + ) { return false; // if coverageStatus is verified there must be a valid deductible also } return true; diff --git a/src/store/index.js b/src/store/index.js index ac817c6a1..99d87ba60 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -766,7 +766,8 @@ export const getters = { isVerifiedAndDeductibleZeroConfirmed: (state) => { // used as a CMS variable on /payment-method, needed for FunnelSubHeaderWidget on cart pages if ( - (state.order.policy.currentDeductible === 0 || state.order.policy.currentDeductible > 0) && + (state.order.policy.currentDeductible === 0 || + state.order.policy.currentDeductible > 0) && state.order.payment.insuranceCoverage.coverageStatus === coverageStatus.VERIFIED && !state.order.policy.isNoComp ) {