From 69e739622a9397ee6db8a2d7ce4d6fab3e045747 Mon Sep 17 00:00:00 2001 From: Katie Date: Mon, 19 Dec 2022 16:26:35 -0500 Subject: [PATCH 1/5] CSR-747 Add navigation logic for estimate for 6-digit referral numbers --- src/layouts/estimate/estimate.vue | 5 ++++- src/layouts/quote/quote.vue | 3 ++- src/mixins/vehicle-questions-mixin.js | 5 ++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/layouts/estimate/estimate.vue b/src/layouts/estimate/estimate.vue index e2e3cbb07..aeb80bb35 100644 --- a/src/layouts/estimate/estimate.vue +++ b/src/layouts/estimate/estimate.vue @@ -219,7 +219,10 @@ export default { payment.isInsurance && payment.insuranceCoverage.coverageStatus; if (vehicleChangedDuringPolicyLookupInHeritage) { navigateToHeritageFunnel({ loadingModal: this.$refs.loadingModal }); - } else if (this.isRepair) { + } else if (this.$store.getters.order.referralNumber.length === 6) { + await this.navigateForwardWithSingleCarMatch(); + } + else if (this.isRepair) { return this.$router.navigateWithSaving( this.navigationScenarios.CLICKED_FORWARD_WITH_NO_QUESTIONS, this.$route diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index 5eababde5..4cb2dcf55 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -144,7 +144,8 @@ export default { store.getters.order.serviceLocation.zipCodeCtu && (store.getters.order.damage.isRepair || (store.getters.order.lineItems?.glassParts != null && - store.getters.order.lineItems.glassParts.length > 0)) + store.getters.order.lineItems.glassParts.length > 0)) && + store.getters.order.referralNumber?.length !== 6 ); }, getDefaultIsInsuranceSelectedValue(availableLineItems) { diff --git a/src/mixins/vehicle-questions-mixin.js b/src/mixins/vehicle-questions-mixin.js index 49f291392..a390309b3 100644 --- a/src/mixins/vehicle-questions-mixin.js +++ b/src/mixins/vehicle-questions-mixin.js @@ -446,7 +446,10 @@ export default { const payment = store.getters.payment; - if (payment.isInsurance && payment.insuranceCoverage.isVerified) { + if (store.getters.order.referralNumber?.length === 6) { + navigateToHeritageFunnel({ loadingModal: self.$refs.loadingModal }); + } + else if (payment.isInsurance && payment.insuranceCoverage.isVerified) { navigateToHeritageFunnel({ loadingModal: self.$refs.loadingModal }); } else { self.$router.navigateWithSaving( From ded8032cd05cf050d83f2291516febfa64041845 Mon Sep 17 00:00:00 2001 From: Katie Date: Tue, 20 Dec 2022 12:59:54 -0500 Subject: [PATCH 2/5] CSR-747 Fix estimate bug --- src/layouts/estimate/estimate.vue | 5 ++--- src/mixins/vehicle-questions-mixin.js | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/layouts/estimate/estimate.vue b/src/layouts/estimate/estimate.vue index aeb80bb35..9387bd89a 100644 --- a/src/layouts/estimate/estimate.vue +++ b/src/layouts/estimate/estimate.vue @@ -219,10 +219,9 @@ export default { payment.isInsurance && payment.insuranceCoverage.coverageStatus; if (vehicleChangedDuringPolicyLookupInHeritage) { navigateToHeritageFunnel({ loadingModal: this.$refs.loadingModal }); - } else if (this.$store.getters.order.referralNumber.length === 6) { + } else if (this.$store.getters.order.referralNumber?.length === 6) { await this.navigateForwardWithSingleCarMatch(); - } - else if (this.isRepair) { + } else if (this.isRepair) { return this.$router.navigateWithSaving( this.navigationScenarios.CLICKED_FORWARD_WITH_NO_QUESTIONS, this.$route diff --git a/src/mixins/vehicle-questions-mixin.js b/src/mixins/vehicle-questions-mixin.js index a390309b3..3a8fd4657 100644 --- a/src/mixins/vehicle-questions-mixin.js +++ b/src/mixins/vehicle-questions-mixin.js @@ -448,8 +448,7 @@ export default { if (store.getters.order.referralNumber?.length === 6) { navigateToHeritageFunnel({ loadingModal: self.$refs.loadingModal }); - } - else if (payment.isInsurance && payment.insuranceCoverage.isVerified) { + } else if (payment.isInsurance && payment.insuranceCoverage.isVerified) { navigateToHeritageFunnel({ loadingModal: self.$refs.loadingModal }); } else { self.$router.navigateWithSaving( From 701b42ac60f5caa82f354247390f118dd608dd02 Mon Sep 17 00:00:00 2001 From: Katie Date: Tue, 20 Dec 2022 13:15:34 -0500 Subject: [PATCH 3/5] CSR-747 Tests and formatting --- src/layouts/capability-questions/capability-questions.spec.js | 1 + src/layouts/molding-questions/molding-questions.spec.js | 2 ++ src/layouts/part-questions/part-questions.spec.js | 3 +++ src/layouts/vehicle-parts/vehicle-parts.spec.js | 1 + 4 files changed, 7 insertions(+) diff --git a/src/layouts/capability-questions/capability-questions.spec.js b/src/layouts/capability-questions/capability-questions.spec.js index f29be44e6..34fb4be05 100644 --- a/src/layouts/capability-questions/capability-questions.spec.js +++ b/src/layouts/capability-questions/capability-questions.spec.js @@ -113,6 +113,7 @@ afterEach(() => { pageData: baseStoreGettersPageData, damage: baseStoreGettersDamage, payment: { insuranceCoverage: {} }, + order: {}, }; }); diff --git a/src/layouts/molding-questions/molding-questions.spec.js b/src/layouts/molding-questions/molding-questions.spec.js index a97e14b41..13961df5a 100644 --- a/src/layouts/molding-questions/molding-questions.spec.js +++ b/src/layouts/molding-questions/molding-questions.spec.js @@ -107,6 +107,7 @@ const baseStoreGettersDamage = () => { store.getters = { pageData: baseStoreGettersPageData, damage: baseStoreGettersDamage, + order: {}, }; store.commit = jest.fn(); @@ -116,6 +117,7 @@ afterEach(() => { pageData: baseStoreGettersPageData, damage: baseStoreGettersDamage, payment: { insuranceCoverage: {} }, + order: {}, }; }); diff --git a/src/layouts/part-questions/part-questions.spec.js b/src/layouts/part-questions/part-questions.spec.js index 8de000009..3382ec1dc 100644 --- a/src/layouts/part-questions/part-questions.spec.js +++ b/src/layouts/part-questions/part-questions.spec.js @@ -97,6 +97,7 @@ const baseStoreGettersDamage = () => { store.getters = { pageData: baseStoreGettersPageData, damage: baseStoreGettersDamage, + order: {}, }; store.commit = jest.fn(); @@ -140,6 +141,7 @@ describe("partQuestions.vue...", () => { }; }), damage: baseStoreGettersDamage, + order: {}, }; const { wrapper } = setupMocks({}); @@ -159,6 +161,7 @@ describe("partQuestions.vue...", () => { store.getters = { pageData: baseStoreGettersPageData, damage: baseStoreGettersDamage, + order: {}, }; const { wrapper } = setupMocks({}); const spy = jest.spyOn(wrapper.vm, "handleCompletedQuestionChainAnswers"); diff --git a/src/layouts/vehicle-parts/vehicle-parts.spec.js b/src/layouts/vehicle-parts/vehicle-parts.spec.js index d14491ccd..23ce3b88a 100644 --- a/src/layouts/vehicle-parts/vehicle-parts.spec.js +++ b/src/layouts/vehicle-parts/vehicle-parts.spec.js @@ -460,6 +460,7 @@ describe("vehicle-parts.vue", () => { store.getters.lineItems = { glassParts: {} }; store.getters.vehicle = { carId: "TEST_CAR_ID" }; store.getters.payment = { insuranceCoverage: {} }; + store.getters.order = {}; const { wrapper } = setupMocks({ mountOptionsMockData: { From 54141b32725c53cfd0f947d67bd363b76bac2f89 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Wed, 21 Dec 2022 07:35:27 -0500 Subject: [PATCH 4/5] Removed 'disabledAutofill' prop from dropdown-question to match textbox-question and prevent the State label from being read incorrectly by JAWS --- src/common-components/dropdown-question/dropdown-question.vue | 1 - .../address-questions/address-questions.spec.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/common-components/dropdown-question/dropdown-question.vue b/src/common-components/dropdown-question/dropdown-question.vue index 4567994f1..e7c183e49 100644 --- a/src/common-components/dropdown-question/dropdown-question.vue +++ b/src/common-components/dropdown-question/dropdown-question.vue @@ -38,7 +38,6 @@ export default { }, isDisabled: Boolean, isRequired: Boolean, - disableAutoFill: Boolean, validationRules: String, cmsWidgetName: String, hasError: Boolean, diff --git a/src/layouts/address-lookup/customer-questions/address-questions/address-questions.spec.js b/src/layouts/address-lookup/customer-questions/address-questions/address-questions.spec.js index 439e2922c..c8d24c57e 100644 --- a/src/layouts/address-lookup/customer-questions/address-questions/address-questions.spec.js +++ b/src/layouts/address-lookup/customer-questions/address-questions/address-questions.spec.js @@ -128,7 +128,7 @@ describe("address-questions.vue", () => { expect(wrapper.vm.$loadScript).not.toHaveBeenCalled(); }); - test("address field is focused => disable autocomplete", async () => { + test("address field is focused => disable autofill", async () => { // Arrange let focusEventCallbackFunction; autocompleteElement.addEventListener = jest From 571fad279bdc01c17997e41d99f4b8877959dd9b Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Wed, 21 Dec 2022 07:52:38 -0500 Subject: [PATCH 5/5] Removed test for inserting ⁠ into the visual label --- .../dropdown-question.spec.js | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/src/common-components/dropdown-question/dropdown-question.spec.js b/src/common-components/dropdown-question/dropdown-question.spec.js index 249b00710..20bba1712 100644 --- a/src/common-components/dropdown-question/dropdown-question.spec.js +++ b/src/common-components/dropdown-question/dropdown-question.spec.js @@ -48,29 +48,6 @@ describe("dropdownQuestion.vue", () => { expect(label.text()).toContain(questionText); }); - it("Should render the 'questionText' data value with '⁠' after the first character of each word in the label text when disableAutoFill is true.", async () => { - // Arrange - const wrapper = shallowMount(dropdownQuestion, { - propsData: { - options: {}, - disableAutoFill: true, - }, - mixins: [mockMixin], - }); - - // Mock CMS content ... - // Trust me, the below instance of the string "Q⁠uestion Text" actually has the ⁠ in it. You just can't see it - // Don't believe me? Copy and paste it into Google. Then inspect the search field element in Dev Tools, - // you will see "Q⁠uestion T⁠ext" - const expectedQuestionText = "Q⁠uestion T⁠ext"; - - // Act - const label = wrapper.find("label"); - - // Assert - expect(label.text()).toContain(expectedQuestionText); - }); - it("Should return input id as the id of the select field", async () => { // Arrange const wrapper = shallowMount(dropdownQuestion, {