From c21d50c3baf9d678aec68bb08330a25f8f3a1dff Mon Sep 17 00:00:00 2001 From: Scott Kiener Date: Tue, 31 Oct 2023 15:42:40 -0400 Subject: [PATCH 1/3] CSR-1452 | Multiple bug fixes additionalButtonData was used incorrectly 404's from validatePromo were handled incorrectly --- src/digital-components/button-question/button-question.vue | 3 +-- .../add-vaps-modal-buttons/add-vaps-modal-buttons.vue | 3 +-- src/layouts/service-location/shop-question/shop-question.vue | 4 ++-- src/store/index.js | 3 +++ 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/digital-components/button-question/button-question.vue b/src/digital-components/button-question/button-question.vue index 0ac7e2863..24a8b8f41 100644 --- a/src/digital-components/button-question/button-question.vue +++ b/src/digital-components/button-question/button-question.vue @@ -133,7 +133,6 @@ export default { suppressError: Boolean, useTextForValue: Boolean, valueToLogType: String, - additionalButtonData: Object, isSmallQuestionText: Boolean, customButtonQuestionId: String, logDisplayedValuesEvent: { @@ -256,7 +255,7 @@ export default { buttonFooterCopy: answer.buttonFooterCopy ?? answer.buttonFooterCopy, buttonImage: answer.buttonImage ?? answer.AnswerImageUrl, buttonImageId: answer.buttonImageId ?? answer.ImageId, - additionalButtonData: answer.additionalButtonData ?? answer.additionalButtonData, + additionalButtonData: answer.additionalButtonData, groupName: this.formatString(this.groupName), value: answer.value ?? diff --git a/src/layouts/payment-method/add-vaps-modal-buttons/add-vaps-modal-buttons.vue b/src/layouts/payment-method/add-vaps-modal-buttons/add-vaps-modal-buttons.vue index c502fb165..abf9fc8ee 100644 --- a/src/layouts/payment-method/add-vaps-modal-buttons/add-vaps-modal-buttons.vue +++ b/src/layouts/payment-method/add-vaps-modal-buttons/add-vaps-modal-buttons.vue @@ -37,8 +37,7 @@ v-model="selectedWipers" isMultiSelect isRequired - validationRules="checkbox-required" - :additionalButtonData="additionalButtonData" /> + validationRules="checkbox-required" />

+${{ wipersModal.totalFrontPrice }}

diff --git a/src/layouts/service-location/shop-question/shop-question.vue b/src/layouts/service-location/shop-question/shop-question.vue index 57702f841..1b4d7dea8 100644 --- a/src/layouts/service-location/shop-question/shop-question.vue +++ b/src/layouts/service-location/shop-question/shop-question.vue @@ -19,8 +19,7 @@ textPosition="text-start" v-model="selectedProviderNumber" isRequired - validationRules="option-required" - :additionalButtonData="additionalButtonData" /> + validationRules="option-required" /> { + // Validate promo will return 4xx errors when an invalid promo + return error; }); if (validateResponse?.data?.serverData) { From 551c6b9a60a0ec47533d168b16d72f0318ca5b43 Mon Sep 17 00:00:00 2001 From: Scott Kiener Date: Tue, 31 Oct 2023 15:45:05 -0400 Subject: [PATCH 2/3] CSR-1452 | Formatting --- src/store/index.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index e678df6ab..3b606b2f7 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -2267,16 +2267,18 @@ export const actions = { }, }; - const validateResponse = await globalMethods.callHttpClient({ - method: endpoints.ValidatePromo.method, - endpoint: endpoints.ValidatePromo.url, - payload: requestObject, - logApiCall: true, - pageNameToLog: pageNameToLog, - }).catch((error) => { - // Validate promo will return 4xx errors when an invalid promo - return error; - }); + const validateResponse = await globalMethods + .callHttpClient({ + method: endpoints.ValidatePromo.method, + endpoint: endpoints.ValidatePromo.url, + payload: requestObject, + logApiCall: true, + pageNameToLog: pageNameToLog, + }) + .catch((error) => { + // Validate promo will return 4xx errors when an invalid promo + return error; + }); if (validateResponse?.data?.serverData) { context.commit( From c1d7585056ea9ed955c86146ffcefd5b7b456b05 Mon Sep 17 00:00:00 2001 From: Scott Kiener Date: Tue, 31 Oct 2023 16:02:15 -0400 Subject: [PATCH 3/3] CSR-1452 | Unit test fix --- .../shop-question/shop-question.spec.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/layouts/service-location/shop-question/shop-question.spec.js b/src/layouts/service-location/shop-question/shop-question.spec.js index 82e48d470..b93728110 100644 --- a/src/layouts/service-location/shop-question/shop-question.spec.js +++ b/src/layouts/service-location/shop-question/shop-question.spec.js @@ -186,18 +186,21 @@ describe("shop-question.vue", () => { buttonLabel: "Westerville", buttonLabelSubCopy: "5 mi", value: "003335", + additionalButtonData: wrapper.vm.additionalButtonData, }, { buttonBodyCopy: "760 Dearborn Park Ln, Worthington, OH 43085", buttonLabel: "Worthington", buttonLabelSubCopy: "10.5 mi", value: "001820", + additionalButtonData: wrapper.vm.additionalButtonData, }, { buttonBodyCopy: "5015 N High St, Columbus, OH 43214", buttonLabel: "Columbus", buttonLabelSubCopy: "11.5 mi", value: "003343", + additionalButtonData: wrapper.vm.additionalButtonData, }, ]); }); @@ -414,6 +417,10 @@ describe("shop-question.vue", () => { }, }); + displayedAnswers.forEach( + (answer) => (answer.additionalButtonData = wrapper.vm.additionalButtonData) + ); + // Act await wrapper.setProps({ shopProviderData: shopQuestionInitialData, @@ -445,42 +452,49 @@ describe("shop-question.vue", () => { // Assert expect(wrapper.vm.answers.length).toBe(6); + console.log(wrapper.vm.answers); expect(wrapper.vm.answers).toEqual([ { buttonBodyCopy: "4403 Executive Pkwy, Westerville, OH 43081", buttonLabel: "Westerville", buttonLabelSubCopy: "5 mi", value: "003335", + additionalButtonData: wrapper.vm.additionalButtonData, }, { buttonBodyCopy: "760 Dearborn Park Ln, Worthington, OH 43085", buttonLabel: "Worthington", buttonLabelSubCopy: "10.5 mi", value: "001820", + additionalButtonData: wrapper.vm.additionalButtonData, }, { buttonBodyCopy: "5015 N High St, Columbus, OH 43214", buttonLabel: "Columbus", buttonLabelSubCopy: "11.5 mi", value: "003343", + additionalButtonData: wrapper.vm.additionalButtonData, }, { buttonBodyCopy: "1670 Harmon Ave, Columbus, OH 43223", buttonLabel: "Columbus", buttonLabelSubCopy: "16 mi", value: "006747", + additionalButtonData: wrapper.vm.additionalButtonData, }, { buttonBodyCopy: "3938 Powell Rd, Powell, OH 43065", buttonLabel: "Powell", buttonLabelSubCopy: "16.5 mi", value: "003341", + additionalButtonData: wrapper.vm.additionalButtonData, }, { buttonBodyCopy: "4580 W Broad St, Columbus, OH 43228", buttonLabel: "Columbus", buttonLabelSubCopy: "19.5 mi", value: "003342", + additionalButtonData: wrapper.vm.additionalButtonData, }, ]); });