From 0bcd483d6fc248747f42450f0d783d9a0003ff34 Mon Sep 17 00:00:00 2001 From: Scott Kiener Date: Tue, 25 Mar 2025 09:53:57 -0400 Subject: [PATCH 1/9] CASH-188 | Initial changes for webchat Still lacking higher environment setup Still need to pass through the hide flag into the component itself --- .../salesforce-helper-dev.js | 62 +++++++++++++++++++ .../salesforce-helper-prod.js | 2 + .../salesforce-helper-qa.js | 2 + .../salesforce-helper-sys.js | 2 + .../salesforce-webchat/salesforce-webchat.vue | 60 ++++++++++++++++++ .../funnel-header/funnel-header.vue | 8 +++ src/layouts/confirmation/confirmation.vue | 2 +- 7 files changed, 137 insertions(+), 1 deletion(-) create mode 100644 src/digital-components/salesforce-webchat/salesforce-helper-dev.js create mode 100644 src/digital-components/salesforce-webchat/salesforce-helper-prod.js create mode 100644 src/digital-components/salesforce-webchat/salesforce-helper-qa.js create mode 100644 src/digital-components/salesforce-webchat/salesforce-helper-sys.js create mode 100644 src/digital-components/salesforce-webchat/salesforce-webchat.vue diff --git a/src/digital-components/salesforce-webchat/salesforce-helper-dev.js b/src/digital-components/salesforce-webchat/salesforce-helper-dev.js new file mode 100644 index 000000000..4132c330b --- /dev/null +++ b/src/digital-components/salesforce-webchat/salesforce-helper-dev.js @@ -0,0 +1,62 @@ +/* +The code below is generated from salesforce but modified in the following ways: + * Only the javascript inside the second + + diff --git a/src/fmg-components/funnel-header/funnel-header.vue b/src/fmg-components/funnel-header/funnel-header.vue index 22d9e77fa..ac2e511a6 100644 --- a/src/fmg-components/funnel-header/funnel-header.vue +++ b/src/fmg-components/funnel-header/funnel-header.vue @@ -2,6 +2,8 @@
+ Safelite logo
@@ -24,6 +26,7 @@ import alert from "@/ux-components/alert/alert"; import eventBus from "@/helpers/event-bus/event-bus"; import { globalEvents } from "@/constants/events"; import menuModal from "@/fmg-components/funnel-header/menu-modal/menu-modal"; +import salesforceWebchat from "../../digital-components/salesforce-webchat/salesforce-webchat.vue"; // Constants const ALERT_DURATION = 3000; // millisecond time to display alert before dismissal @@ -37,6 +40,10 @@ export default { }, props: { cmsWidgetName: String, + hideSalesforceWebchat: { + type: Boolean, + default: false + } }, computed: { imageSrc() { @@ -60,6 +67,7 @@ export default { components: { alert, menuModal, + salesforceWebchat }, mounted() { // Check if alert event is on the bus diff --git a/src/layouts/confirmation/confirmation.vue b/src/layouts/confirmation/confirmation.vue index 8c4d6cf1a..24720e665 100644 --- a/src/layouts/confirmation/confirmation.vue +++ b/src/layouts/confirmation/confirmation.vue @@ -5,7 +5,7 @@
- +
From 85c247322d6a16fc368baa58cf3218576f1cbd03 Mon Sep 17 00:00:00 2001 From: Scott Kiener Date: Wed, 9 Apr 2025 10:36:59 -0400 Subject: [PATCH 2/9] CASH-188 | Add other files, small tweaks --- .../salesforce-helper-dev.js | 31 +++++----- .../salesforce-helper-prod.js | 59 ++++++++++++++++++ .../salesforce-helper-qa.js | 62 ++++++++++++++++++- .../salesforce-helper-sys.js | 2 - .../salesforce-webchat/salesforce-webchat.vue | 17 ++--- .../funnel-header/funnel-header.vue | 3 +- src/layouts/confirmation/confirmation.vue | 2 +- 7 files changed, 147 insertions(+), 29 deletions(-) delete mode 100644 src/digital-components/salesforce-webchat/salesforce-helper-sys.js diff --git a/src/digital-components/salesforce-webchat/salesforce-helper-dev.js b/src/digital-components/salesforce-webchat/salesforce-helper-dev.js index 4132c330b..ce4a4acb9 100644 --- a/src/digital-components/salesforce-webchat/salesforce-helper-dev.js +++ b/src/digital-components/salesforce-webchat/salesforce-helper-dev.js @@ -4,22 +4,21 @@ The code below is generated from salesforce but modified in the following ways: * CSS is not copied in * First diff --git a/src/fmg-components/funnel-header/funnel-header.vue b/src/fmg-components/funnel-header/funnel-header.vue index 23f7c0ed9..226941652 100644 --- a/src/fmg-components/funnel-header/funnel-header.vue +++ b/src/fmg-components/funnel-header/funnel-header.vue @@ -2,9 +2,7 @@
- + Safelite logo
@@ -43,8 +41,8 @@ export default { cmsWidgetName: String, hideSalesforceWebchatLaunchButton: { type: Boolean, - default: false - } + default: false, + }, }, computed: { imageSrc() { @@ -68,7 +66,7 @@ export default { components: { alert, menuModal, - salesforceWebchat + salesforceWebchat, }, mounted() { // Check if alert event is on the bus diff --git a/src/layouts/confirmation/confirmation.vue b/src/layouts/confirmation/confirmation.vue index f9cacd29d..a54c51b7a 100644 --- a/src/layouts/confirmation/confirmation.vue +++ b/src/layouts/confirmation/confirmation.vue @@ -5,7 +5,10 @@
- +
From 60f053f8519e198b864393b0d47afffed25dab5e Mon Sep 17 00:00:00 2001 From: Chris Redelinghuys Date: Wed, 16 Apr 2025 10:41:55 -0400 Subject: [PATCH 4/9] CASH-203: UI Updates for Afterpay breakout with service package discounts --- .../service-package-radio-for-afterpay.vue | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/experiment-components/service-package-radio-for-afterpay.vue b/src/experiment-components/service-package-radio-for-afterpay.vue index b936e21bf..6fc51b5b4 100644 --- a/src/experiment-components/service-package-radio-for-afterpay.vue +++ b/src/experiment-components/service-package-radio-for-afterpay.vue @@ -5,6 +5,7 @@ :class="[ this.buttonLabelSubCopy ? 'has-subheader' : '', this.additionalButtonData.isInsuranceSelected ? 'is-insurance' : '', + this.hasPackageDiscount() ? 'has-package-discount' : '', ]" for="testradio">
@@ -55,10 +56,7 @@
@@ -144,6 +142,10 @@ export default { truncatedSinglePayment() { return "$" + Math.trunc(this.buttonAuxillaryCopy.replace("$", "")); }, + hasPackageDiscount() { + return this.additionalButtonData.servicePackageDiscount && + this.additionalButtonData.Text; + }, }, }; @@ -212,11 +214,6 @@ export default { } &.has-subheader { - min-height: 150px; - - &.is-insurance { - min-height: 72px; - } & > .package-specs { & > div:first-of-type { @@ -225,6 +222,10 @@ export default { } } + &.has-package-discount { + min-height: 150px; + } + &:before { content: ""; position: relative; From 58c0b91b2b5c2d461cefba687ab5713853027ff1 Mon Sep 17 00:00:00 2001 From: Chris Redelinghuys Date: Wed, 16 Apr 2025 10:51:59 -0400 Subject: [PATCH 5/9] CASH-203: Prettier --- .../service-package-radio-for-afterpay.vue | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/experiment-components/service-package-radio-for-afterpay.vue b/src/experiment-components/service-package-radio-for-afterpay.vue index 6fc51b5b4..f38621462 100644 --- a/src/experiment-components/service-package-radio-for-afterpay.vue +++ b/src/experiment-components/service-package-radio-for-afterpay.vue @@ -55,9 +55,7 @@ v-html="this.buttonFooterCopy">
-
+
@@ -143,8 +141,9 @@ export default { return "$" + Math.trunc(this.buttonAuxillaryCopy.replace("$", "")); }, hasPackageDiscount() { - return this.additionalButtonData.servicePackageDiscount && - this.additionalButtonData.Text; + return ( + this.additionalButtonData.servicePackageDiscount && this.additionalButtonData.Text + ); }, }, }; @@ -214,7 +213,6 @@ export default { } &.has-subheader { - & > .package-specs { & > div:first-of-type { display: flex; From a08bc842a755ef29d8323a0b13e2e18755792368 Mon Sep 17 00:00:00 2001 From: hiteshkumar87 Date: Wed, 16 Apr 2025 21:05:32 +0530 Subject: [PATCH 6/9] Revert "CASH-433" This reverts commit 1649ea14077449503533cc4f99fa29c16402418a. --- .../appointment-type-question.vue | 19 +++---------------- .../service-location/service-location.vue | 13 ------------- 2 files changed, 3 insertions(+), 29 deletions(-) diff --git a/src/layouts/service-location/appointment-type-question/appointment-type-question.vue b/src/layouts/service-location/appointment-type-question/appointment-type-question.vue index 4c1c0d031..64bf159ff 100644 --- a/src/layouts/service-location/appointment-type-question/appointment-type-question.vue +++ b/src/layouts/service-location/appointment-type-question/appointment-type-question.vue @@ -32,7 +32,6 @@ export default { cmsWidgetName: String, isServiceableMobile: Boolean, isServiceableInshop: Boolean, - isServiceableDropoff: Boolean, mobileFeeApplies: Boolean, }, computed: { @@ -46,7 +45,7 @@ export default { const shouldShowMobile = this.isServiceableMobile; const shouldShowInshop = this.isServiceableInshop; const shouldShowDropoff = - this.isServiceableDropoff && !this.$store.getters.damage.isRepair; + this.isServiceableInshop && !this.$store.getters.damage.isRepair; var answers = this.answersFromCms ? this.answersFromCms.filter((answer) => { @@ -78,11 +77,6 @@ export default { isMobileOnly() { return this.isServiceableMobile && !this.isServiceableInshop; }, - isInshopOnly() { - return ( - this.isServiceableInshop && !this.isServiceableMobile && !this.isServiceableDropoff - ); - }, }, watch: { answersToDisplay: { @@ -92,7 +86,7 @@ export default { newValue.length == 1 && newValue.findIndex((answer) => answer.Name == "Mobile") != -1 ) { - this.selectedValue = "Mobile"; + this.selectedValues = "Mobile"; } }, immediate: true, @@ -100,14 +94,7 @@ export default { isMobileOnly: { handler(newValue) { if (newValue) { - this.selectedValue = "Mobile"; - } - }, - }, - isInshopOnly: { - handler(newValue) { - if (newValue) { - this.selectedValue = "Inshop"; + this.selectedValues = "Mobile"; } }, }, diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 7b3163c87..a85a5bd17 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -76,7 +76,6 @@ v-show="isAppointmentTypeDisplayed" :isServiceableMobile="isServiceableMobile" :isServiceableInshop="isServiceableInshop" - :isServiceableDropoff="isServiceableDropoff" :isDisplayed="isAppointmentTypeDisplayed" :mobileFeeApplies="mobileFeeApplies" ref="appointmentTypeQuestion" @@ -197,8 +196,6 @@ export default { isVehicleProtected: this.getIsVehicleProtectedFromStore(), isGlassServiceableInshop: null, isRecalibrationServiceableInshop: null, - isGlassServiceableDropoff: null, - isRecalibrationServiceableDropoff: null, isGlassServiceableMobile: null, isRecalibrationServiceableMobile: null, selectedAppointmentType: this.getSelectedAppointmentType(), @@ -357,13 +354,6 @@ export default { return this.isGlassServiceableInshop; } }, - isServiceableDropoff() { - if (this.isRecalibrationServiceableDropoff !== null) { - return this.isGlassServiceableDropoff && this.isRecalibrationServiceableDropoff; - } else { - return this.isGlassServiceableDropoff; - } - }, isShopQuestionDisplayed() { return ( this.selectedAppointmentType === "Inshop" || @@ -569,9 +559,6 @@ export default { this.isGlassServiceableInshop = serviceabilityDetails.isGlassServiceableInshop; this.isRecalibrationServiceableInshop = serviceabilityDetails.isRecalibrationServiceableInshop; - this.isGlassServiceableDropoff = serviceabilityDetails.isGlassServiceableDropoff; - this.isRecalibrationServiceableDropoff = - serviceabilityDetails.isRecalibrationServiceableDropoff; this.isGlassServiceableMobile = serviceabilityDetails.isGlassServiceableMobile; this.isRecalibrationServiceableMobile = serviceabilityDetails.isRecalibrationServiceableMobile; From 089632b7f1de38f334bf7807b957cf96756c4f2c Mon Sep 17 00:00:00 2001 From: Minojhini Valaiyapathi Date: Wed, 16 Apr 2025 12:04:47 -0400 Subject: [PATCH 7/9] CASH-353- Reverting back the 353 changes --- .../address-lookup/address-lookup.spec.js | 45 --------------- src/layouts/address-lookup/address-lookup.vue | 38 +------------ .../license-plate-lookup.spec.js | 49 ---------------- .../license-plate-lookup.vue | 37 ------------ src/layouts/service-zip/service-zip.spec.js | 38 ------------- src/layouts/service-zip/service-zip.vue | 37 +----------- src/layouts/vin-lookup/vin-lookup.spec.js | 33 ----------- src/layouts/vin-lookup/vin-lookup.vue | 56 +------------------ 8 files changed, 5 insertions(+), 328 deletions(-) diff --git a/src/layouts/address-lookup/address-lookup.spec.js b/src/layouts/address-lookup/address-lookup.spec.js index 19a46abb8..677c14069 100644 --- a/src/layouts/address-lookup/address-lookup.spec.js +++ b/src/layouts/address-lookup/address-lookup.spec.js @@ -182,39 +182,6 @@ describe("address-lookup.vue", () => { // Assert expect(wrapper.findComponent({ ref: "alertVinNotFound" }).isVisible()).toBe(true); }); - test("should show the AlertNoService when displayNoServiceAlert is true", async () => { - const { wrapper } = setupMocks({ - isZipServiceable: true, - displayNoServiceAlert: true, - lookupVinbyAddressResponse: { - isStatePermissible: true, - vinVehicles: [], // Return no vehicles - }, - }); - - // Set displayNoServiceAlert to true - await wrapper.setData({ displayNoServiceAlert: true }); - - // Check if the AlertNoService component is rendered - const alertNoService = wrapper.findComponent({ ref: "AlertNoService" }); - expect(alertNoService.exists()).toBe(true); - }); - test("should hide the AlertNoService when displayNoServiceAlert is false", async () => { - const { wrapper } = setupMocks({ - isZipServiceable: true, - displayNoServiceAlert: false, - lookupVinbyAddressResponse: { - isStatePermissible: true, - vinVehicles: [], // Return no vehicles - }, - }); - // Ensure displayNoServiceAlert is false - await wrapper.setData({ displayNoServiceAlert: false }); - - // Check if the AlertNoService component is not rendered - const alertNoService = wrapper.findComponent({ ref: "AlertNoService" }); - expect(alertNoService.exists()).toBe(false); - }); }); describe("navigation", () => { @@ -774,18 +741,6 @@ function setupMocks({ wrapper.vm.setCmsContent = jest.fn(); wrapper.vm.$refs.navbar.updateButtonText = jest.fn(); wrapper.vm.$refs.navbar.removeLoader = jest.fn(); - const closestShops = { - data: { - providers: [ - { id: 1, name: "Shop 1" }, - { id: 2, name: "Shop 2" }, - ], - }, - }; - - wrapper.vm.findClosestApplicableShops = jest.fn().mockImplementation(() => { - return new Promise((resolve) => resolve(closestShops)); - }); return { wrapper }; } diff --git a/src/layouts/address-lookup/address-lookup.vue b/src/layouts/address-lookup/address-lookup.vue index c33ef68e5..8c4e21e9a 100644 --- a/src/layouts/address-lookup/address-lookup.vue +++ b/src/layouts/address-lookup/address-lookup.vue @@ -81,20 +81,13 @@
- + :isForwardActionDisabled="!meta.valid" />
@@ -171,8 +164,6 @@ export default { emailOrSms: this.getEmailOrSmsFromStore(), }, serviceZipCode: this.getServiceZipFromStore(), - carId: this.getCarIdfromStore(), - isHeavyTruck: this.getIsVehicleHeavyTruckFromStore(), displayNonServiceableZipAlert: false, displayVinNotFoundAlert: false, displayMatchedDifferentVehicleAlert: false, @@ -184,7 +175,6 @@ export default { displayInvalidZipAlert: false, showServiceZipField: this.getServiceZipFromStore(), isZipServiceable: false, - displayNoServiceAlert: false, }; }, methods: { @@ -229,19 +219,6 @@ export default { getServiceZipFromStore() { return this.$store.getters.order.serviceLocation.zipCode; }, - getCarIdfromStore() { - return store.getters.vehicle.carId; - }, - getIsVehicleHeavyTruckFromStore() { - return store.getters.isHeavyTruckVehicle; - }, - async findClosestApplicableShops() { - return await this.dispatchStoreActionWithLogging( - storeActions.GET_CLOSEST_APPLICABLE_SHOPS, - { zip: this.serviceZipCode, carId: this.carId }, - "address-lookup" - ); - }, async forwardButtonAction() { this.resetWarningsAndErrors(); @@ -301,17 +278,6 @@ export default { return this.$refs.navbar.removeLoader(); } this.displayInvalidZipAlert = false; - if (this.serviceZipCode != null && this.isHeavyTruck) { - const closestShops = await this.findClosestApplicableShops( - this.serviceZipCode, - this.carId - ); - this.displayNoServiceAlert = !closestShops?.data?.providers?.length; - if (this.displayNoServiceAlert) { - return this.$refs.navbar.removeLoader(); - } - } - const carsFound = resultMap.vinLookupResponse.vinVehicles; // Handle cases for different amounts of VINS found for the address. @@ -463,7 +429,6 @@ export default { this.displayNonServiceableZipAlert = false; this.displayMatchedDifferentVehicleAlert = false; this.displayVinLookupByHomeAddressNotAllowedAlert = false; - this.displayNoServiceAlert = false; }, }, mounted() { @@ -515,7 +480,6 @@ export default { handler(newValue) { // If they modify the service zip code, then hide the error message. this.displayNonServiceableZipAlert = false; - this.displayNoServiceAlert = false; }, }, showServiceZipField: { diff --git a/src/layouts/license-plate-lookup/license-plate-lookup.spec.js b/src/layouts/license-plate-lookup/license-plate-lookup.spec.js index 2ffe61193..14f0408d1 100644 --- a/src/layouts/license-plate-lookup/license-plate-lookup.spec.js +++ b/src/layouts/license-plate-lookup/license-plate-lookup.spec.js @@ -611,42 +611,6 @@ describe("license-plate-lookup.vue", () => { expect(arePagePrerequisitesValid).toBe(false); }); }); - - describe("alerts", () => { - test("should show the AlertNoService when displayNoServiceAlert is true", async () => { - const { wrapper } = setupMocks({ - isZipServiceable: true, - displayNoServiceAlert: true, - lookupVinbyAddressResponse: { - isStatePermissible: true, - vinVehicles: [], // Return no vehicles - }, - }); - - // Set displayNoServiceAlert to true - await wrapper.setData({ displayNoServiceAlert: true }); - - // Check if the AlertNoService component is rendered - const alertNoService = wrapper.findComponent({ ref: "AlertNoService" }); - expect(alertNoService.exists()).toBe(true); - }); - test("should hide the AlertNoService when displayNoServiceAlert is false", async () => { - const { wrapper } = setupMocks({ - isZipServiceable: true, - displayNoServiceAlert: false, - lookupVinbyAddressResponse: { - isStatePermissible: true, - vinVehicles: [], // Return no vehicles - }, - }); - // Ensure displayNoServiceAlert is false - await wrapper.setData({ displayNoServiceAlert: false }); - - // Check if the AlertNoService component is not rendered - const alertNoService = wrapper.findComponent({ ref: "AlertNoService" }); - expect(alertNoService.exists()).toBe(false); - }); - }); }); function setupMocks({ @@ -752,18 +716,5 @@ function setupMocks({ wrapper.vm.getCmsContent = jest.fn().mockImplementation(() => ""); wrapper.vm.$refs.navbar.updateButtonText = jest.fn(); wrapper.vm.$refs.navbar.removeLoader = jest.fn(); - const closestShops = { - data: { - providers: [ - { id: 1, name: "Shop 1" }, - { id: 2, name: "Shop 2" }, - ], - }, - }; - - wrapper.vm.findClosestApplicableShops = jest.fn().mockImplementation(() => { - return new Promise((resolve) => resolve(closestShops)); - }); - return { wrapper, apiPromise }; } diff --git a/src/layouts/license-plate-lookup/license-plate-lookup.vue b/src/layouts/license-plate-lookup/license-plate-lookup.vue index a359d3a9d..c581af4b7 100644 --- a/src/layouts/license-plate-lookup/license-plate-lookup.vue +++ b/src/layouts/license-plate-lookup/license-plate-lookup.vue @@ -77,14 +77,6 @@ alertClass="alert-warning" v-bind:isDismissible="false" /> - - { expect(wrapper.vm.displayInvalidZipAlert).toBe(false); expect(wrapper.vm.displayNonServiceableZipAlert).toBe(false); }); - test("should show the AlertNoService when displayNoServiceAlert is true", async () => { - // Arrange - // no changes to store - applyMockStoreDataToGetters(); - - const wrapper = setupMocks({}); - wrapper.vm.serviceZipCode = "12345"; - - // Act - wrapper.vm.displayNoServiceAlert = true; - - // Check if the AlertNoService component is rendered - expect(wrapper.vm.displayNoServiceAlert).toBe(true); - }); - test("should hide the AlertNoService when displayNoServiceAlert is false", async () => { - // Arrange - // no changes to store - applyMockStoreDataToGetters(); - - const wrapper = setupMocks({}); - wrapper.vm.serviceZipCode = "12345"; - //ACT - wrapper.vm.displayNoServiceAlert = false; - - // Check if the AlertNoService component is rendered - expect(wrapper.vm.displayNoServiceAlert).toBe(false); - }); }); }); @@ -538,16 +511,5 @@ function setupMocks({ customMountOptions, customZipQuery, customZipDataResponse ]; const wrapper = shallowMount(serviceZip, mountOptions); - wrapper.vm.findClosestApplicableShops = jest.fn().mockImplementation(() => { - return Promise.resolve({ - data: { - providers: [ - { id: 1, name: "Shop 1" }, - { id: 2, name: "Shop 2" }, - ], - }, - }); - }); - return wrapper; } diff --git a/src/layouts/service-zip/service-zip.vue b/src/layouts/service-zip/service-zip.vue index 7d53d105d..9528d50bc 100644 --- a/src/layouts/service-zip/service-zip.vue +++ b/src/layouts/service-zip/service-zip.vue @@ -47,18 +47,10 @@ v-if="displayNonServiceableZipAlert" alertClass="alert-danger" /> - - @@ -118,11 +110,8 @@ export default { return { serviceZipCode: this.getZipFromStore() ?? this.$route.query.zipcode, emailOrSms: this.getEmailOrSmsFromStore(), - carId: this.getCarIdfromStore(), - isHeavyTruck: this.getIsVehicleHeavyTruckFromStore(), displayInvalidZipAlert: false, displayNonServiceableZipAlert: false, - displayNoServiceAlert: false, }; }, @@ -195,19 +184,6 @@ export default { arePagePrerequisitesValid() { return store.getters.damage.isRepair || store.getters.damage.glassToReplace?.length > 0; }, - getCarIdfromStore() { - return store.getters.vehicle.carId; - }, - getIsVehicleHeavyTruckFromStore() { - return store.getters.isHeavyTruckVehicle; - }, - async findClosestApplicableShops() { - return await this.dispatchStoreActionWithLogging( - storeActions.GET_CLOSEST_APPLICABLE_SHOPS, - { zip: this.serviceZipCode, carId: this.carId }, - "service-zip" - ); - }, async backButtonAction() { const skipVin = await skipVinLookup(); // route to move backwards @@ -276,16 +252,6 @@ export default { return this.$refs.navbar.removeLoader(); } this.displayNonServiceableZipAlert = false; - if (this.isHeavyTruck) { - const closestShops = await this.findClosestApplicableShops( - this.serviceZipCode, - this.carId - ); - this.displayNoServiceAlert = !closestShops?.data?.providers?.length; - if (this.displayNoServiceAlert) { - return this.$refs.navbar.removeLoader(); - } - } const payment = this.$store.getters.payment; const policy = this.$store.getters.policy; @@ -343,7 +309,6 @@ export default { watch: { serviceZipCode() { this.displayNonServiceableZipAlert = false; - this.displayNoServiceAlert = false; }, }, components: { diff --git a/src/layouts/vin-lookup/vin-lookup.spec.js b/src/layouts/vin-lookup/vin-lookup.spec.js index 458f9fc48..6eb1aa515 100644 --- a/src/layouts/vin-lookup/vin-lookup.spec.js +++ b/src/layouts/vin-lookup/vin-lookup.spec.js @@ -258,39 +258,6 @@ describe("vin-lookup.vue", () => { // Assert expect(wrapper.findAllComponents({ name: "alert" }).length).toBe(1); }); - - test("should show the AlertNoService when displayNoServiceAlert is true", async () => { - const { wrapper } = setupMocks({ - isZipServiceable: true, - displayNoServiceAlert: true, - lookupVinbyAddressResponse: { - isStatePermissible: true, - vinVehicles: [], // Return no vehicles - }, - }); - // Set displayNoServiceAlert to true - await wrapper.setData({ displayNoServiceAlert: true }); - - // Check if the AlertNoService component is rendered - const alertNoService = wrapper.findComponent({ ref: "AlertNoService" }); - expect(alertNoService.exists()).toBe(true); - }); - test("should hide the AlertNoService when displayNoServiceAlert is false", async () => { - const { wrapper } = setupMocks({ - isZipServiceable: true, - displayNoServiceAlert: false, - lookupVinbyAddressResponse: { - isStatePermissible: true, - vinVehicles: [], // Return no vehicles - }, - }); - // Ensure displayNoServiceAlert is false - await wrapper.setData({ displayNoServiceAlert: false }); - - // Check if the AlertNoService component is not rendered - const alertNoService = wrapper.findComponent({ ref: "AlertNoService" }); - expect(alertNoService.exists()).toBe(false); - }); }); describe("getVinFromImage", () => { diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue index 788425861..4c6897717 100644 --- a/src/layouts/vin-lookup/vin-lookup.vue +++ b/src/layouts/vin-lookup/vin-lookup.vue @@ -71,8 +71,7 @@ vinPopulatedOnPageLoad && isInsuranceVerified && !displayInvalidZipAlert && - !displayNonServiceableZipAlert && - !displayNoServiceAlert + !displayNonServiceableZipAlert " alertClass="alert-success" /> @@ -108,23 +107,14 @@ vinPopulatedOnPageLoad && !isInsuranceVerified && !displayInvalidZipAlert && - !displayNonServiceableZipAlert && - !displayNoServiceAlert + !displayNonServiceableZipAlert " alertClass="alert-success" /> - - @@ -207,8 +197,6 @@ export default { vin: this.getVinFromStore(), serviceZipCode: this.getZipFromStore() ?? this.$route.query.zipcode, emailOrSms: this.getEmailOrSmsFromStore(), - carId: this.getCarIdfromStore(), - isHeavyTruck: this.getIsVehicleHeavyTruckFromStore(), isCarIdDifferent: false, customAlertData: {}, previouslyEnteredCarId: "", @@ -219,7 +207,6 @@ export default { displayVinNotFoundAlert: false, displayMatchedDifferentVehicleAlert: false, displayVinScanFailedAlert: false, - displayNoServiceAlert: false, }; }, methods: { @@ -235,12 +222,6 @@ export default { getZipFromStore() { return this.$store.getters.order.serviceLocation.zipCode; }, - getCarIdfromStore() { - return store.getters.vehicle.carId; - }, - getIsVehicleHeavyTruckFromStore() { - return store.getters.isHeavyTruckVehicle; - }, attachCustomEvents() { this.prependActionToMethod(this, this.forwardButtonAction, () => { this.pushEventToGA( @@ -264,13 +245,6 @@ export default { ); } }, - async findClosestApplicableShops() { - return await this.dispatchStoreActionWithLogging( - storeActions.GET_CLOSEST_APPLICABLE_SHOPS, - { zip: this.serviceZipCode, carId: this.carId }, - "vin-lookup" - ); - }, async forwardButtonAction() { this.resetAlerts(); @@ -303,18 +277,6 @@ export default { return this.$refs.navbar.removeLoader(); } this.displayInvalidZipAlert = false; - if (this.isHeavyTruck) { - // If a VIN has already been found. Validate the Service Zip (in case of changes) - var closestShops = await this.findClosestApplicableShops( - this.serviceZipCode, - this.carId - ); - this.displayNoServiceAlert = !closestShops?.data?.providers?.length; - if (this.displayNoServiceAlert) { - return this.$refs.navbar.removeLoader(); - } - } - // If either lookup fails, remove the loader and stop processing the page. if (!resultMap.vehicleLookupResponse || !resultMap.zipCodeData.isServiceable) { // If the vehicle result is undefined, the vin entered was invalid. @@ -431,16 +393,6 @@ export default { ); } - closestShops = await this.findClosestApplicableShops( - this.serviceZipCode, - this.carId - ); - this.displayNoServiceAlert = !closestShops?.data?.providers?.length; - if (this.displayNoServiceAlert) { - return this.$refs.navbar.removeLoader(); - } - - // if no value due to field being optional, blank both phone and email address if (!this.emailOrSms) { await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, "", false); await this.dispatchStoreAction(storeActions.SAVE_EMAIL, "", false); @@ -522,7 +474,6 @@ export default { this.displayInvalidZipAlert = false; this.displayVinNotFoundAlert = false; this.displayVinScanFailedAlert = false; - this.displayNoServiceAlert = false; }, }, mounted() { @@ -599,7 +550,6 @@ export default { }, serviceZipCode() { this.displayNonServiceableZipAlert = false; - this.displayNoServiceAlert = false; }, }, components: { From e4b74f846ea30790d89b93487caf209bf2e56871 Mon Sep 17 00:00:00 2001 From: hiteshkumar87 Date: Wed, 16 Apr 2025 22:11:30 +0530 Subject: [PATCH 8/9] revert cash-433 unit test case --- .../appointment-type-question.spec.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/layouts/service-location/appointment-type-question/appointment-type-question.spec.js b/src/layouts/service-location/appointment-type-question/appointment-type-question.spec.js index 8ff7c9b1c..c6af1377f 100644 --- a/src/layouts/service-location/appointment-type-question/appointment-type-question.spec.js +++ b/src/layouts/service-location/appointment-type-question/appointment-type-question.spec.js @@ -100,7 +100,7 @@ describe("appointment-type-question.vue", () => { ]); }); - it("Should display only the In-Shop answer when only in-shop service is available", async () => { + it("Should display only the In-Shop and Drop-Off answers when only in-shop service is available", async () => { // Arrange/Act const { wrapper } = setupMocks({ mixins: [mockMixin], @@ -108,7 +108,6 @@ describe("appointment-type-question.vue", () => { cmsWidgetName: cmsWidgetName, isServiceableInshop: true, isServiceableMobile: false, - isServiceableDropoff: false, }, mountOptions: { attachTo: document.body, @@ -124,6 +123,13 @@ describe("appointment-type-question.vue", () => { SubWidgetName: "", Text: "In-shop", }, + { + AnswerImageUrl: "", + Name: "Dropoff", + SubText: "", + SubWidgetName: "", + Text: "Drop-off", + }, ]); }); From 05e625cc01501a50dd965562bdf64f388e3739e9 Mon Sep 17 00:00:00 2001 From: Scott Kiener Date: Mon, 21 Apr 2025 08:57:32 -0400 Subject: [PATCH 9/9] Drop jest % --- jest.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jest.config.js b/jest.config.js index 905e907dc..e534b3e3f 100644 --- a/jest.config.js +++ b/jest.config.js @@ -35,7 +35,7 @@ module.exports = { testMatch: ["**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)"], coverageThreshold: { global: { - statements: 74, + statements: 72, }, }, // Uncomment this to avoid the massive amount of warnings we are getting for onSubmit and onInvalidSubmit