From cff0f89e76f6670ed70cd3c9cf5184a676a2048f Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Wed, 8 Mar 2023 11:21:14 -0500 Subject: [PATCH 1/8] Removed commented code and renamed CTU variable in parameter list for priceOrderItemsAndSaveServerData --- .../service-package-radio/service-package-radio.vue | 7 ------- src/store/index.js | 4 ++-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/layouts/quote/service-package-question/service-package-radio/service-package-radio.vue b/src/layouts/quote/service-package-question/service-package-radio/service-package-radio.vue index 59903d745..83bee2218 100644 --- a/src/layouts/quote/service-package-question/service-package-radio/service-package-radio.vue +++ b/src/layouts/quote/service-package-question/service-package-radio/service-package-radio.vue @@ -40,13 +40,6 @@ " :data-bs-target="'#' + getRouterLinkRouteFromCopy(copy)" aria-label="Modal window" /> - diff --git a/src/store/index.js b/src/store/index.js index 45f9d92fe..77eea9a5c 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1431,11 +1431,11 @@ export const actions = { context.commit(storeMutations.UPDATE_VAPS, vaps); }, // Price order actions - async priceOrderItemsAndSaveServerData(context, { availableLineItems, serviceZipCode, ctu }) { + async priceOrderItemsAndSaveServerData(context, { availableLineItems, serviceZipCode, serviceZipCodeCtu }) { const zipCodeToUse = serviceZipCode ? serviceZipCode : context.getters.order.serviceLocation.zipCode; - const ctuToUse = ctu ? ctu : context.getters.order.serviceLocation.zipCodeCtu; + const ctuToUse = serviceZipCodeCtu ? serviceZipCodeCtu : context.getters.order.serviceLocation.zipCodeCtu; const availableLineItemsFormattedForRequest = getLineItemQueryStringForPricing(availableLineItems); From 4b6be3fa5cf63cf8ff8cce3e946a631ce2a63dfb Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Wed, 8 Mar 2023 13:23:53 -0500 Subject: [PATCH 2/8] More changes from tech review --- src/helpers/service-location-helper.js | 4 ++-- .../mobile-location-modal-questions.vue | 16 ++++++++++------ .../service-location/service-location.vue | 16 ++++++++-------- src/store/index.js | 9 +++++++-- 4 files changed, 27 insertions(+), 18 deletions(-) diff --git a/src/helpers/service-location-helper.js b/src/helpers/service-location-helper.js index 41f4be147..5d3a1c603 100644 --- a/src/helpers/service-location-helper.js +++ b/src/helpers/service-location-helper.js @@ -7,7 +7,7 @@ export async function getPricedMobileFeePart(serviceZipCode) { } const zipCodeData = await baseMixin.methods.getZipCodeData(serviceZipCode); - + // Get the Mobile Fee Part const mobileFeePart = await baseMixin.methods.dispatchStoreAction( storeActions.GET_MOBILE_FEE_PART, @@ -21,7 +21,7 @@ export async function getPricedMobileFeePart(serviceZipCode) { { availableLineItems: [mobileFeePart.data], serviceZipCode: serviceZipCode, - ctu: zipCodeData.zipCodeCtu, + serviceZipCodeCtu: zipCodeData.zipCodeCtu, }, false ); diff --git a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue index 4c6028ca5..f5fcf4574 100644 --- a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue +++ b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue @@ -59,6 +59,7 @@ import vehicleProtectedQuestion from "@/layouts/service-location/mobile-location // Helpers import { deepClone } from "@/helpers/object-cloning-helper"; +import { object } from "yup/lib/locale"; export default { name: "mobile-location-modal-questions", @@ -81,10 +82,12 @@ export default { zipCode: "", }, isVehicleProtected: null, - serviceZipCode: "", - mobileFeePart: null, }), }, + mobileFeePart: { + type: Object, + default: () => ({}), + }, isZipServiceableMobile: Boolean, isZipServiceableInShop: Boolean, linkWidgetName: String, @@ -122,13 +125,14 @@ export default { return cmsContentText.replaceAll("{custom:mobileFee}", this.mobileFee); }, mobileFee() { - if (!this.modelValue.mobileFeePart) { + if (!this.mobileFeePart) { return 0; } + return ( - this.modelValue.mobileFeePart.laborAmount + - this.modelValue.mobileFeePart.sellingPrice + - this.modelValue.mobileFeePart.kitPrice + this.mobileFeePart.laborAmount + + this.mobileFeePart.sellingPrice + + this.mobileFeePart.kitPrice ); }, modalFooterText() { diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 6950b23c1..3d1ea1a61 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -11,6 +11,7 @@ modalWidgetName="ServiceZipModalWidget" /> @@ -90,7 +91,7 @@ export default { }, set: function (newValue) { if (newValue.zipCode !== this.zipCode) { - this.resetMobileLocation(this.zipCode); + this.resetMobileLocation(newValue.zipCode); } this.state = newValue.state; @@ -108,7 +109,6 @@ export default { zipCode: this.zipCode, }, isVehicleProtected: this.isVehicleProtected, - mobileFeePart: this.mobileFeePart, }; }, set: function (newValue) { @@ -119,17 +119,17 @@ export default { this.state = newValue.addressQuestions.state; this.zipCode = newValue.addressQuestions.zipCode; this.isVehicleProtected = newValue.isVehicleProtected; - this.mobileFeePart = newValue.mobileFeePart; }, }, }, methods: { arePagePrerequisitesValid() { - return ( - store.getters.lineItems.supportingItems !== null && - store.getters.order.serviceLocation.zipCode !== null && - store.getters.payment.isInsurance !== null - ); + return true; + // return ( + // store.getters.lineItems.supportingItems !== null && + // store.getters.order.serviceLocation.zipCode !== null && + // store.getters.payment.isInsurance !== null + // ); }, setData(mobileFeePart) { if (mobileFeePart) { diff --git a/src/store/index.js b/src/store/index.js index 77eea9a5c..f9ec56519 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1431,11 +1431,16 @@ export const actions = { context.commit(storeMutations.UPDATE_VAPS, vaps); }, // Price order actions - async priceOrderItemsAndSaveServerData(context, { availableLineItems, serviceZipCode, serviceZipCodeCtu }) { + async priceOrderItemsAndSaveServerData( + context, + { availableLineItems, serviceZipCode, serviceZipCodeCtu } + ) { const zipCodeToUse = serviceZipCode ? serviceZipCode : context.getters.order.serviceLocation.zipCode; - const ctuToUse = serviceZipCodeCtu ? serviceZipCodeCtu : context.getters.order.serviceLocation.zipCodeCtu; + const ctuToUse = serviceZipCodeCtu + ? serviceZipCodeCtu + : context.getters.order.serviceLocation.zipCodeCtu; const availableLineItemsFormattedForRequest = getLineItemQueryStringForPricing(availableLineItems); From 0c6d2cb6e87058095275a6eb605e028d9c342be7 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Thu, 9 Mar 2023 13:38:20 -0500 Subject: [PATCH 3/8] Got unit tests working again --- .../address-questions/address-questions.vue | 5 +++ .../object-cloning-helper.js | 0 .../object-cloning-helper.spec.js | 0 .../service-location-helper.js | 12 ++++-- .../service-location-helper.spec.js | 0 .../mobile-location-modal-questions.vue | 38 +++++++++---------- .../service-location/service-location.spec.js | 18 +++++---- .../service-location/service-location.vue | 35 ++++++++++------- 8 files changed, 64 insertions(+), 44 deletions(-) rename src/{helpers => layouts/service-location/helpers/object-cloning-helper}/object-cloning-helper.js (100%) rename src/{helpers => layouts/service-location/helpers/object-cloning-helper}/object-cloning-helper.spec.js (100%) rename src/{helpers => layouts/service-location/helpers/service-location-helper}/service-location-helper.js (69%) rename src/{helpers => layouts/service-location/helpers/service-location-helper}/service-location-helper.spec.js (100%) diff --git a/src/layouts/address-lookup/customer-questions/address-questions/address-questions.vue b/src/layouts/address-lookup/customer-questions/address-questions/address-questions.vue index c37e596ef..1769961b7 100644 --- a/src/layouts/address-lookup/customer-questions/address-questions/address-questions.vue +++ b/src/layouts/address-lookup/customer-questions/address-questions/address-questions.vue @@ -22,6 +22,7 @@ aria-live="polite">
@@ -32,6 +33,7 @@
{ return Promise.resolve(mobileFeePart); }; -jest.mock("@/helpers/service-location-helper", () => ({ +jest.mock("@/layouts/service-location/helpers/service-location-helper/service-location-helper", () => ({ getPricedMobileFeePart: jest.fn((mockServiceZipCode) => { return mockGetPricedMobileFeePart(mockServiceZipCode); }), @@ -107,6 +107,9 @@ const mockMixin = { getTotalLineItemPrice: jest.fn((lineItem) => { return 49.99; }), + + onSubmit: jest.fn(), + onInvalidSubmit: jest.fn(), }, }; @@ -130,6 +133,9 @@ beforeEach(() => { state: "OH", }, }, + damage: { + isRepair: false + }, payment: { isInsurance: false, }, @@ -168,7 +174,7 @@ describe("service-location.vue", () => { ); // Assert - expect(wrapper.vm.mobileLocationQuestions.mobileFeePart).toStrictEqual(mobileFeePart); + expect(wrapper.vm.mobileFeePart).toStrictEqual(mobileFeePart); }); }); @@ -217,7 +223,9 @@ describe("service-location.vue", () => { describe("updating service zip", () => { test("updates the page model after providing the service zip code", () => { // Arrange - const { wrapper } = setupMocks({}); + const { wrapper } = setupMocks({ + mixins: [mockMixin] + }); wrapper.vm.$refs.mobileLocationModalQuestions.resetComponent = jest.fn(); const newServiceZipCodeQuestion = { @@ -256,7 +264,6 @@ describe("service-location.vue", () => { zipCode: "43054", }, isVehicleProtected: true, - mobileFeePart: null, }; wrapper.vm.mobileLocationQuestions = mobileLocationQuestions; @@ -269,7 +276,6 @@ describe("service-location.vue", () => { zipCode: "61606", }, isVehicleProtected: null, - mobileFeePart: null, }; const serviceZipCodeComponent = wrapper.findComponent({ @@ -299,7 +305,6 @@ describe("service-location.vue", () => { zipCode: "", }, isVehicleProtected: null, - mobileFeePart: null, }; wrapper.vm.mobileLocationQuestions = mobileLocationQuestions; @@ -312,7 +317,6 @@ describe("service-location.vue", () => { zipCode: "43054", }, isVehicleProtected: true, - mobileFeePart: null, }; const mobileLocationComponent = wrapper.findComponent({ diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 3d1ea1a61..00017db80 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -37,7 +37,7 @@ import { Form } from "vee-validate"; import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; import { settleAllPromises } from "@/helpers/layout-helper"; import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper"; -import { getPricedMobileFeePart } from "@/helpers/service-location-helper"; +import { getPricedMobileFeePart } from "@/layouts/service-location/helpers/service-location-helper/service-location-helper"; import store from "@/store"; export default { @@ -49,6 +49,7 @@ export default { city: this.getServiceCityFromStore(), state: this.getServiceStateFromStore(), zipCode: this.getServiceZipCodeFromStore(), + isVehicleProtected: null, isZipServiceableMobile: null, isZipServiceableInShop: null, mobileFeePart: null, @@ -59,7 +60,11 @@ export default { const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage); const serviceZipCode = store.getters.order.serviceLocation.zipCode; - const mobileFeePartPromise = getPricedMobileFeePart(serviceZipCode); + const serviceType = store.getters.damage.isRepair ? "Repair" : "Replace"; + const parentAccountNumber = store.getters.payment.parentAccountNumber; + const billToAccountNumber = 0; + + const mobileFeePartPromise = getPricedMobileFeePart(serviceZipCode, serviceType, parentAccountNumber, billToAccountNumber); // Settle promises and get results const promiseResultMap = [ @@ -91,7 +96,7 @@ export default { }, set: function (newValue) { if (newValue.zipCode !== this.zipCode) { - this.resetMobileLocation(newValue.zipCode); + this.resetMobileLocation(newValue); } this.state = newValue.state; @@ -124,12 +129,11 @@ export default { }, methods: { arePagePrerequisitesValid() { - return true; - // return ( - // store.getters.lineItems.supportingItems !== null && - // store.getters.order.serviceLocation.zipCode !== null && - // store.getters.payment.isInsurance !== null - // ); + return ( + store.getters.lineItems.supportingItems !== null && + store.getters.order.serviceLocation.zipCode !== null && + store.getters.payment.isInsurance !== null + ); }, setData(mobileFeePart) { if (mobileFeePart) { @@ -149,19 +153,22 @@ export default { return store.getters.order.serviceLocation.zipCode; }, resetMobileFeePart(serviceZipCode) { - getPricedMobileFeePart(serviceZipCode).then((pricedMobileFeePart) => { + const serviceType = store.getters.damage.isRepair ? "Repair" : "Replace"; + const parentAccountNumber = store.getters.payment.parentAccountNumber; + const billToAccountNumber = 0; + + getPricedMobileFeePart(serviceZipCode, serviceType, parentAccountNumber, billToAccountNumber).then((pricedMobileFeePart) => { this.mobileFeePart = pricedMobileFeePart; }); }, - resetMobileLocation(updatedServiceZipCode) { + resetMobileLocation(updatedServiceZipCodeInfo) { this.streetAddress = ""; this.apartmentNumberOrBusinessName = ""; this.city = ""; + this.isVehicleProtected = null; - this.$refs.mobileLocationModalQuestions.resetComponent(); - - this.resetMobileFeePart(updatedServiceZipCode); + this.resetMobileFeePart(updatedServiceZipCodeInfo.zipCode); }, backButtonAction() { this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route); From 8ee995253881352f7c0165714ed99e4442c65b33 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Thu, 9 Mar 2023 13:50:31 -0500 Subject: [PATCH 4/8] Fixed mobile-location-modal-questions tests --- .../service-location-helper.spec.js | 11 ++++-- .../mobile-location-modal-questions.spec.js | 34 ------------------- 2 files changed, 9 insertions(+), 36 deletions(-) diff --git a/src/layouts/service-location/helpers/service-location-helper/service-location-helper.spec.js b/src/layouts/service-location/helpers/service-location-helper/service-location-helper.spec.js index 345e4c807..bb841e327 100644 --- a/src/layouts/service-location/helpers/service-location-helper/service-location-helper.spec.js +++ b/src/layouts/service-location/helpers/service-location-helper/service-location-helper.spec.js @@ -48,10 +48,13 @@ describe("service-location-helper.js", () => { it("Should return null if no service zip code is passed in", async () => { // Arrange const serviceZipCode = null; + const serviceType = "Replace"; + const parentAccountNumber = 167132 + const billToAccountNumber = 1234 const expected = null; // Act - const result = await getPricedMobileFeePart(serviceZipCode); + const result = await getPricedMobileFeePart(serviceZipCode, serviceType, parentAccountNumber, billToAccountNumber); // Assert expect(result).toEqual(expected); @@ -60,6 +63,10 @@ describe("service-location-helper.js", () => { it("Should return the priced mobile fee part", async () => { // Arrange const serviceZipCode = "43235"; + const serviceType = "Replace"; + const parentAccountNumber = 167132 + const billToAccountNumber = 1234 + const expected = { partNumber: "MOBILE FEE", description: "MOBILE FEE", @@ -70,7 +77,7 @@ describe("service-location-helper.js", () => { }; // Act - const result = await getPricedMobileFeePart(serviceZipCode); + const result = await getPricedMobileFeePart(serviceZipCode, serviceType, parentAccountNumber, billToAccountNumber); // Assert expect(result).toEqual(expected); diff --git a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.spec.js b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.spec.js index d90f68b1f..eb9d507db 100644 --- a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.spec.js +++ b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.spec.js @@ -300,40 +300,6 @@ describe("mobile-location-modal-questions.vue", () => { // Assert expect(wrapper.vm.displayInvalidZipAlert).toBe(true); }); - - it("Should clear the internal model when resetModel is called", async () => { - // Arrange - const mobileLocationQuestions = { - addressQuestions: { - streetAddress: "555 Some St", - apartmentNumberOrBusinessName: "Apt 1", - city: "Funkytown", - state: "OH", - zipCode: "55555", - }, - isVehicleProtected: true, - serviceZipCode: "55555", - }; - - const { wrapper } = setupMocks({ - mixins: [mockMixin], - props: { - modelValue: mobileLocationQuestions, - }, - mountOptions: { - attachTo: document.body, - }, - }); - - // Act - wrapper.vm.resetModel(); - - // Assert - expect(wrapper.vm.internalModel.addressQuestions.streetAddress).toEqual(""); - expect(wrapper.vm.internalModel.addressQuestions.apartmentNumberOrBusinessName).toEqual(""); - expect(wrapper.vm.internalModel.addressQuestions.city).toEqual(""); - expect(wrapper.vm.internalModel.isVehicleProtected).toEqual(null); - }); }); function setupMocks({ mountOptions, mixins, props, isShallowMount = true }) { From 99faf4d0679ffef06f39b44e5c2eed121b04efe7 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Thu, 9 Mar 2023 13:55:42 -0500 Subject: [PATCH 5/8] Prettified --- .../service-location-helper.js | 9 +++++-- .../service-location-helper.spec.js | 26 +++++++++++++------ .../mobile-location-modal-questions.vue | 4 +-- .../service-location/service-location.spec.js | 17 +++++++----- .../service-location/service-location.vue | 14 ++++++++-- 5 files changed, 49 insertions(+), 21 deletions(-) diff --git a/src/layouts/service-location/helpers/service-location-helper/service-location-helper.js b/src/layouts/service-location/helpers/service-location-helper/service-location-helper.js index a1aeb4b7b..f9529ccec 100644 --- a/src/layouts/service-location/helpers/service-location-helper/service-location-helper.js +++ b/src/layouts/service-location/helpers/service-location-helper/service-location-helper.js @@ -1,7 +1,12 @@ import { storeActions } from "@/constants/store-actions"; import baseMixin from "@/mixins/base-mixin.js"; -export async function getPricedMobileFeePart(serviceZipCode, serviceType, parentAccountNumber, billToAccountNumber) { +export async function getPricedMobileFeePart( + serviceZipCode, + serviceType, + parentAccountNumber, + billToAccountNumber +) { if (!serviceZipCode || !serviceType || !parentAccountNumber) { return Promise.resolve(null); } @@ -14,7 +19,7 @@ export async function getPricedMobileFeePart(serviceZipCode, serviceType, parent { serviceType: serviceType, parentAccountNumber: parentAccountNumber, - billToAccountNumber: billToAccountNumber + billToAccountNumber: billToAccountNumber, }, false ); diff --git a/src/layouts/service-location/helpers/service-location-helper/service-location-helper.spec.js b/src/layouts/service-location/helpers/service-location-helper/service-location-helper.spec.js index bb841e327..061fd6bcd 100644 --- a/src/layouts/service-location/helpers/service-location-helper/service-location-helper.spec.js +++ b/src/layouts/service-location/helpers/service-location-helper/service-location-helper.spec.js @@ -48,13 +48,18 @@ describe("service-location-helper.js", () => { it("Should return null if no service zip code is passed in", async () => { // Arrange const serviceZipCode = null; - const serviceType = "Replace"; - const parentAccountNumber = 167132 - const billToAccountNumber = 1234 + const serviceType = "Replace"; + const parentAccountNumber = 167132; + const billToAccountNumber = 1234; const expected = null; // Act - const result = await getPricedMobileFeePart(serviceZipCode, serviceType, parentAccountNumber, billToAccountNumber); + const result = await getPricedMobileFeePart( + serviceZipCode, + serviceType, + parentAccountNumber, + billToAccountNumber + ); // Assert expect(result).toEqual(expected); @@ -63,9 +68,9 @@ describe("service-location-helper.js", () => { it("Should return the priced mobile fee part", async () => { // Arrange const serviceZipCode = "43235"; - const serviceType = "Replace"; - const parentAccountNumber = 167132 - const billToAccountNumber = 1234 + const serviceType = "Replace"; + const parentAccountNumber = 167132; + const billToAccountNumber = 1234; const expected = { partNumber: "MOBILE FEE", @@ -77,7 +82,12 @@ describe("service-location-helper.js", () => { }; // Act - const result = await getPricedMobileFeePart(serviceZipCode, serviceType, parentAccountNumber, billToAccountNumber); + const result = await getPricedMobileFeePart( + serviceZipCode, + serviceType, + parentAccountNumber, + billToAccountNumber + ); // Assert expect(result).toEqual(expected); diff --git a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue index 5063dc432..e2f3d3458 100644 --- a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue +++ b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue @@ -187,8 +187,8 @@ export default { this.resetComponent({ state: newValue.state, - zipCode: newValue.zipCode - }) + zipCode: newValue.zipCode, + }); }, deep: true, }, diff --git a/src/layouts/service-location/service-location.spec.js b/src/layouts/service-location/service-location.spec.js index b163f7592..fbe7aa448 100644 --- a/src/layouts/service-location/service-location.spec.js +++ b/src/layouts/service-location/service-location.spec.js @@ -32,11 +32,14 @@ const mockGetPricedMobileFeePart = (mockServiceZipCode) => { return Promise.resolve(mobileFeePart); }; -jest.mock("@/layouts/service-location/helpers/service-location-helper/service-location-helper", () => ({ - getPricedMobileFeePart: jest.fn((mockServiceZipCode) => { - return mockGetPricedMobileFeePart(mockServiceZipCode); - }), -})); +jest.mock( + "@/layouts/service-location/helpers/service-location-helper/service-location-helper", + () => ({ + getPricedMobileFeePart: jest.fn((mockServiceZipCode) => { + return mockGetPricedMobileFeePart(mockServiceZipCode); + }), + }) +); jest.mock("@/store", () => ({ commit: jest.fn(), @@ -134,7 +137,7 @@ beforeEach(() => { }, }, damage: { - isRepair: false + isRepair: false, }, payment: { isInsurance: false, @@ -224,7 +227,7 @@ describe("service-location.vue", () => { test("updates the page model after providing the service zip code", () => { // Arrange const { wrapper } = setupMocks({ - mixins: [mockMixin] + mixins: [mockMixin], }); wrapper.vm.$refs.mobileLocationModalQuestions.resetComponent = jest.fn(); diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 00017db80..c4944f3ee 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -64,7 +64,12 @@ export default { const parentAccountNumber = store.getters.payment.parentAccountNumber; const billToAccountNumber = 0; - const mobileFeePartPromise = getPricedMobileFeePart(serviceZipCode, serviceType, parentAccountNumber, billToAccountNumber); + const mobileFeePartPromise = getPricedMobileFeePart( + serviceZipCode, + serviceType, + parentAccountNumber, + billToAccountNumber + ); // Settle promises and get results const promiseResultMap = [ @@ -157,7 +162,12 @@ export default { const parentAccountNumber = store.getters.payment.parentAccountNumber; const billToAccountNumber = 0; - getPricedMobileFeePart(serviceZipCode, serviceType, parentAccountNumber, billToAccountNumber).then((pricedMobileFeePart) => { + getPricedMobileFeePart( + serviceZipCode, + serviceType, + parentAccountNumber, + billToAccountNumber + ).then((pricedMobileFeePart) => { this.mobileFeePart = pricedMobileFeePart; }); }, From 697b6d7b210e554410176c5bb098f30cb0cdc9ad Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Thu, 9 Mar 2023 14:46:19 -0500 Subject: [PATCH 6/8] Added code to remove spinner if an invalid zip is entered --- .../mobile-location-modal-questions.vue | 4 ++++ src/layouts/service-location/service-location.vue | 11 ++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue index e2f3d3458..cdba0058f 100644 --- a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue +++ b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue @@ -162,6 +162,9 @@ export default { }, }); }, + resetModalButtonStyle() { + this.$refs[this.modalName].resetButtonStyle(); + }, onAddressUpdated(updatedServiceZipCodeInfo) { this.resetComponent(updatedServiceZipCodeInfo); }, @@ -173,6 +176,7 @@ export default { if (!zipCodeData.isValid) { this.displayInvalidZipAlert = true; + this.resetModalButtonStyle(); } else { // Update the page level model this.$emit("update:modelValue", this.internalModel); diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index c4944f3ee..c58d57b65 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -134,11 +134,12 @@ export default { }, methods: { arePagePrerequisitesValid() { - return ( - store.getters.lineItems.supportingItems !== null && - store.getters.order.serviceLocation.zipCode !== null && - store.getters.payment.isInsurance !== null - ); + return true; + // return ( + // store.getters.lineItems.supportingItems !== null && + // store.getters.order.serviceLocation.zipCode !== null && + // store.getters.payment.isInsurance !== null + // ); }, setData(mobileFeePart) { if (mobileFeePart) { From a99ca76d7d2beee550187d8c743a1e3543fe5e3d Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Thu, 9 Mar 2023 15:38:34 -0500 Subject: [PATCH 7/8] Removed comments from arePagesPrequisitesValid --- src/layouts/service-location/service-location.vue | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index c58d57b65..c4944f3ee 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -134,12 +134,11 @@ export default { }, methods: { arePagePrerequisitesValid() { - return true; - // return ( - // store.getters.lineItems.supportingItems !== null && - // store.getters.order.serviceLocation.zipCode !== null && - // store.getters.payment.isInsurance !== null - // ); + return ( + store.getters.lineItems.supportingItems !== null && + store.getters.order.serviceLocation.zipCode !== null && + store.getters.payment.isInsurance !== null + ); }, setData(mobileFeePart) { if (mobileFeePart) { From 5ba43cf9d443722ec4cca28eb3c8c71e49362e3e Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Thu, 9 Mar 2023 15:51:23 -0500 Subject: [PATCH 8/8] Fixed unit tests and ran formatter --- .../mobile-location-modal-questions.spec.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.spec.js b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.spec.js index eb9d507db..ab0ba6573 100644 --- a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.spec.js +++ b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.spec.js @@ -247,6 +247,7 @@ describe("mobile-location-modal-questions.vue", () => { attachTo: document.body, }); wrapper.vm.$refs.MobileLocationModalWidget.closeModal = jest.fn(); + wrapper.vm.resetModalButtonStyle = jest.fn(); // Act wrapper.vm.internalModel = newMobileLocationQuestions; @@ -293,6 +294,7 @@ describe("mobile-location-modal-questions.vue", () => { }); wrapper.vm.internalModel = newMobileLocationQuestions; + wrapper.vm.resetModalButtonStyle = jest.fn(); // Act await wrapper.vm.setMobileLocation();