diff --git a/src/common-components/layouts/questions-page-layout/questions-page-layout.vue b/src/common-components/layouts/questions-page-layout/questions-page-layout.vue index d2d6aaab2..1ab40a7b0 100644 --- a/src/common-components/layouts/questions-page-layout/questions-page-layout.vue +++ b/src/common-components/layouts/questions-page-layout/questions-page-layout.vue @@ -27,7 +27,7 @@ ref="funnelFooter" cmsWidgetName="FunnelFooterWidget" :isForwardActionDisabled="!isMetaValid" - @back-clicked="handleBackButtonClicked" + @back-clicked="handleBackButtonAction" @ForwardClicked="handleForwardButtonAction" /> diff --git a/src/common-components/question-chain/question-chain.vue b/src/common-components/question-chain/question-chain.vue index 11874670b..bf68a4363 100644 --- a/src/common-components/question-chain/question-chain.vue +++ b/src/common-components/question-chain/question-chain.vue @@ -100,7 +100,7 @@ export default { return false; } - // Example returnedAnswers: + // returnedAnswer examples: // "1|nextQuestion|3|No" // "5|answer|DW02104|Yes" @@ -108,15 +108,12 @@ export default { const questionNum = parseInt(returnedAnswerArray[0]); const questionType = returnedAnswerArray[1]; const questionAnswer = returnedAnswerArray[2]; - const questionAnswerText = returnedAnswerArray[3]; const answeredQuestions = []; this.questions.forEach((q) => { // find this question and mark it as "answered" by populating answerSelected if (q.questionSequence === questionNum) { q.answerSelected = returnedAnswer; - q.answerNumber = questionNum; - q.selectedAnswerText = questionAnswerText; } // remove all answers AFTER this question... // (needed in case user is changing previously answered questions) @@ -126,6 +123,7 @@ export default { if (q.answerSelected) { answeredQuestions.push({ questionText: q.questionText, + selectedAnswer: q.answerSelected, selectedAnswerText: q.answerSelected.split("|")[3], questionNum: q.questionSequence, }); diff --git a/src/common-components/textbox-question/textbox-question.spec.js b/src/common-components/textbox-question/textbox-question.spec.js index bfc65da16..d5d1de4e6 100644 --- a/src/common-components/textbox-question/textbox-question.spec.js +++ b/src/common-components/textbox-question/textbox-question.spec.js @@ -53,7 +53,7 @@ describe("textboxQuestion.vue", () => { expect(paragraph.attributes("class")).toContain("rounded-pill"); }); - it.only("Should return form-control class", async () => { + it("Should return form-control class", async () => { // Act const wrapper = shallowMount(textboxQuestion, { global: { diff --git a/src/constants/experiments.js b/src/constants/experiments.js index f2e5d4928..f6d25f1a7 100644 --- a/src/constants/experiments.js +++ b/src/constants/experiments.js @@ -4,6 +4,7 @@ const experimentUniverses = { const experimentSettings = { GOOGLE_CUSTOM_DIMENSION_INDEX: "Google Custom Dimension Index", + SUPPRESS_VIN_CAPTURE: "SuppressVinCapture", }; const experimentTriggers = { diff --git a/src/helpers/heritage-integration/navigation-helper.js b/src/helpers/heritage-integration/navigation-helper.js index 6d2b98e90..dd84c8b35 100644 --- a/src/helpers/heritage-integration/navigation-helper.js +++ b/src/helpers/heritage-integration/navigation-helper.js @@ -5,6 +5,8 @@ import { saveSession } from "@/helpers/heritage-integration/order-helper.js"; import { fmgPageValues } from "@/router/router-constants/fmgPage-values"; import { storeActions } from "@/constants/store-actions.js"; import { settleAllPromises } from "@/helpers/layout-helper"; +import experimentMixin from "@/mixins/experiment-mixin"; +import { experimentSettings } from "@/constants/experiments"; import store from "@/store"; import router from "@/router"; @@ -74,7 +76,9 @@ async function getLatestPageForRedirection() { fmgPageValues.CAPABILITY_QUESTIONS ); - const isVinOptionalVehicle = await store.dispatch(storeActions.IS_VIN_OPTIONAL_VEHICLE); + const isVinOptionalVehicle = store.getters.order.vehicle.make + ? await store.dispatch(storeActions.IS_VIN_OPTIONAL_VEHICLE) + : false; if (!vehicleMakeComponent.methods.arePagePrerequisitesValid()) { return fmgPageValues.VEHICLE_YEAR; @@ -96,12 +100,18 @@ async function getLatestPageForRedirection() { } else if (partQuestionsComponent.methods.arePagePrerequisitesValid()) { return fmgPageValues.PART_QUESTIONS; } else if ( + // capture vin vinLookupComponent.methods.arePagePrerequisitesValid() && !store.getters.damage.isRepair && - !isVinOptionalVehicle + !isVinOptionalVehicle && + experimentMixin.methods.hasSettingEqualTo( + experimentSettings.SUPPRESS_VIN_CAPTURE, + false + ) ) { return fmgPageValues.VIN_LOOKUP; } else { + // do not capture vin return fmgPageValues.ESTIMATE; } } diff --git a/src/helpers/heritage-integration/navigation-helper.spec.js b/src/helpers/heritage-integration/navigation-helper.spec.js index 263fd054f..430f1df22 100644 --- a/src/helpers/heritage-integration/navigation-helper.spec.js +++ b/src/helpers/heritage-integration/navigation-helper.spec.js @@ -144,6 +144,16 @@ describe("getPageToRouteExistingOrderTo", () => { store.commit(storeMutations.UPDATE_IS_REPAIR, false); store.commit(storeMutations.UPDATE_MAKE, "acura"); + const mockExperimentsList = [ + { + universeName: "ConceptFunnel", + settings: { + SuppressVinCapture: false, + }, + }, + ]; + store.commit(storeMutations.UPDATE_EXPERIMENTS, mockExperimentsList); + // Mock out the lazy load calls for all components. mockLazyLoadComponentReturnValues({ [fmgPageValues.VEHICLE_MAKE]: true, diff --git a/src/layouts/capability-questions/capability-questions.spec.js b/src/layouts/capability-questions/capability-questions.spec.js index c59857182..31fc63af8 100644 --- a/src/layouts/capability-questions/capability-questions.spec.js +++ b/src/layouts/capability-questions/capability-questions.spec.js @@ -84,12 +84,14 @@ const baseStoreGettersDamage = () => { { questionText: "Is your vehicle equipped with the Panoramic Sunroof which can be identified by having a glass panel over the rear seats?", + selectedAnswer: "1|nextQuestion|3|Yes", selectedAnswerText: "Yes", questionNum: 1, }, { questionText: "Is your vehicle equipped with a heated windshield that melts snow and ice from underneath the windshield wiper blades?", + selectedAnswer: "2|nextQuestion|3|Yes", selectedAnswerText: "Yes", questionNum: 2, }, @@ -166,10 +168,10 @@ describe("capabilityQuestions.vue", () => { }); describe("watch on selectedAnswers should be set up...", () => { - test("Should trigger handleAnswerUpdates if watched data changes", async () => { + test("Should trigger handleCompletedQuestionChainAnswers if watched data changes", async () => { // Arrange const { wrapper } = setupMocks({}); - const spy = jest.spyOn(wrapper.vm, "handleAnswerUpdates"); + const spy = jest.spyOn(wrapper.vm, "handleCompletedQuestionChainAnswers"); // Act wrapper.setData({ @@ -180,12 +182,14 @@ describe("capabilityQuestions.vue", () => { { questionText: "Is your vehicle equipped with the Panoramic Sunroof which can be identified by having a glass panel over the rear seats?", + selectedAnswer: "1|nextQuestion|3|Yes", selectedAnswerText: "Yes", questionNum: 1, }, { questionText: "Is your vehicle equipped with a heated windshield that melts snow and ice from underneath the windshield wiper blades?", + selectedAnswer: "2|nextQuestion|3|Yes", selectedAnswerText: "Yes", questionNum: 2, }, diff --git a/src/layouts/capability-questions/capability-questions.vue b/src/layouts/capability-questions/capability-questions.vue index c3122b9a3..ffef2f6fa 100644 --- a/src/layouts/capability-questions/capability-questions.vue +++ b/src/layouts/capability-questions/capability-questions.vue @@ -112,7 +112,7 @@ export default { "selectedAnswers." + glass.answerKey, (newValue) => { if (newValue && Object.keys(newValue).length > 0) { - this.handleAnswerUpdates(newValue, glass.answerKey); + this.handleCompletedQuestionChainAnswers(newValue, glass.answerKey); } }, { deep: true } diff --git a/src/layouts/estimate/estimate.spec.js b/src/layouts/estimate/estimate.spec.js index 4e533bb70..3a0869828 100644 --- a/src/layouts/estimate/estimate.spec.js +++ b/src/layouts/estimate/estimate.spec.js @@ -221,16 +221,29 @@ describe("estimate.vue", () => { describe("skipVinLookup", () => { const skipOptions = [ - [true, true, true], - [true, false, true], - [false, true, true], - [false, false, false], + [true, true, true, true], + [true, false, false, true], + [false, true, true, true], + [false, false, false, false], ]; test.each(skipOptions)( - "isRepair %s and isVinOptional %s should return %s", - async (isRepair, isVinOptionalVehicle, expectedVinSkip) => { - const { wrapper } = setupMocks({ isVinOptionalVehicle: isVinOptionalVehicle }); + "isRepair %s, isVinOptional %s and suppressVinCapture %s should return %s", + async (isRepair, isVinOptionalVehicle, suppressVinCapture, expectedVinSkip) => { + const { wrapper } = setupMocks({}); + await wrapper.setData({ + isVinOptionalVehicle: isVinOptionalVehicle, + }); + store.commit(storeMutations.UPDATE_IS_REPAIR, isRepair); + const mockExperimentsList = [ + { + universeName: "ConceptFunnel", + settings: { + SuppressVinCapture: suppressVinCapture, + }, + }, + ]; + store.commit(storeMutations.UPDATE_EXPERIMENTS, mockExperimentsList); expect(wrapper.vm.skipVinLookup).toEqual(expectedVinSkip); } diff --git a/src/layouts/estimate/estimate.vue b/src/layouts/estimate/estimate.vue index 20a47e357..9d31083d6 100644 --- a/src/layouts/estimate/estimate.vue +++ b/src/layouts/estimate/estimate.vue @@ -22,7 +22,7 @@
+
@@ -113,6 +116,10 @@ export default { overflow: hidden; min-height: 58px; + &.has-subheader { + min-height: 78px; + } + &:before { content: ""; position: relative; @@ -193,12 +200,16 @@ export default { font-weight: 500; display: flex; justify-content: space-between; - span.pricing-info { - color: $green; + span { + &.pricing-info { + color: $green; + font-size: 0.875rem; + } } &.sub-label { color: $green; text-transform: uppercase; + font-size: 0.75rem; } } ul { @@ -206,6 +217,7 @@ export default { padding: 0; li { margin-bottom: 0.5rem; + font-size: 0.875rem; } } } diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue index 1548a74dc..135956b26 100644 --- a/src/layouts/vin-lookup/vin-lookup.vue +++ b/src/layouts/vin-lookup/vin-lookup.vue @@ -9,11 +9,7 @@