Merge remote-tracking branch 'origin/develop' into feature/CSR-889
This commit is contained in:
commit
4b42f2b148
21 changed files with 188 additions and 85 deletions
|
|
@ -27,7 +27,7 @@
|
||||||
ref="funnelFooter"
|
ref="funnelFooter"
|
||||||
cmsWidgetName="FunnelFooterWidget"
|
cmsWidgetName="FunnelFooterWidget"
|
||||||
:isForwardActionDisabled="!isMetaValid"
|
:isForwardActionDisabled="!isMetaValid"
|
||||||
@back-clicked="handleBackButtonClicked"
|
@back-clicked="handleBackButtonAction"
|
||||||
@ForwardClicked="handleForwardButtonAction" />
|
@ForwardClicked="handleForwardButtonAction" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ export default {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Example returnedAnswers:
|
// returnedAnswer examples:
|
||||||
// "1|nextQuestion|3|No"
|
// "1|nextQuestion|3|No"
|
||||||
// "5|answer|DW02104|Yes"
|
// "5|answer|DW02104|Yes"
|
||||||
|
|
||||||
|
|
@ -108,15 +108,12 @@ export default {
|
||||||
const questionNum = parseInt(returnedAnswerArray[0]);
|
const questionNum = parseInt(returnedAnswerArray[0]);
|
||||||
const questionType = returnedAnswerArray[1];
|
const questionType = returnedAnswerArray[1];
|
||||||
const questionAnswer = returnedAnswerArray[2];
|
const questionAnswer = returnedAnswerArray[2];
|
||||||
const questionAnswerText = returnedAnswerArray[3];
|
|
||||||
const answeredQuestions = [];
|
const answeredQuestions = [];
|
||||||
|
|
||||||
this.questions.forEach((q) => {
|
this.questions.forEach((q) => {
|
||||||
// find this question and mark it as "answered" by populating answerSelected
|
// find this question and mark it as "answered" by populating answerSelected
|
||||||
if (q.questionSequence === questionNum) {
|
if (q.questionSequence === questionNum) {
|
||||||
q.answerSelected = returnedAnswer;
|
q.answerSelected = returnedAnswer;
|
||||||
q.answerNumber = questionNum;
|
|
||||||
q.selectedAnswerText = questionAnswerText;
|
|
||||||
}
|
}
|
||||||
// remove all answers AFTER this question...
|
// remove all answers AFTER this question...
|
||||||
// (needed in case user is changing previously answered questions)
|
// (needed in case user is changing previously answered questions)
|
||||||
|
|
@ -126,6 +123,7 @@ export default {
|
||||||
if (q.answerSelected) {
|
if (q.answerSelected) {
|
||||||
answeredQuestions.push({
|
answeredQuestions.push({
|
||||||
questionText: q.questionText,
|
questionText: q.questionText,
|
||||||
|
selectedAnswer: q.answerSelected,
|
||||||
selectedAnswerText: q.answerSelected.split("|")[3],
|
selectedAnswerText: q.answerSelected.split("|")[3],
|
||||||
questionNum: q.questionSequence,
|
questionNum: q.questionSequence,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ describe("textboxQuestion.vue", () => {
|
||||||
expect(paragraph.attributes("class")).toContain("rounded-pill");
|
expect(paragraph.attributes("class")).toContain("rounded-pill");
|
||||||
});
|
});
|
||||||
|
|
||||||
it.only("Should return form-control class", async () => {
|
it("Should return form-control class", async () => {
|
||||||
// Act
|
// Act
|
||||||
const wrapper = shallowMount(textboxQuestion, {
|
const wrapper = shallowMount(textboxQuestion, {
|
||||||
global: {
|
global: {
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ const experimentUniverses = {
|
||||||
|
|
||||||
const experimentSettings = {
|
const experimentSettings = {
|
||||||
GOOGLE_CUSTOM_DIMENSION_INDEX: "Google Custom Dimension Index",
|
GOOGLE_CUSTOM_DIMENSION_INDEX: "Google Custom Dimension Index",
|
||||||
|
SUPPRESS_VIN_CAPTURE: "SuppressVinCapture",
|
||||||
};
|
};
|
||||||
|
|
||||||
const experimentTriggers = {
|
const experimentTriggers = {
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ import { saveSession } from "@/helpers/heritage-integration/order-helper.js";
|
||||||
import { fmgPageValues } from "@/router/router-constants/fmgPage-values";
|
import { fmgPageValues } from "@/router/router-constants/fmgPage-values";
|
||||||
import { storeActions } from "@/constants/store-actions.js";
|
import { storeActions } from "@/constants/store-actions.js";
|
||||||
import { settleAllPromises } from "@/helpers/layout-helper";
|
import { settleAllPromises } from "@/helpers/layout-helper";
|
||||||
|
import experimentMixin from "@/mixins/experiment-mixin";
|
||||||
|
import { experimentSettings } from "@/constants/experiments";
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
import router from "@/router";
|
import router from "@/router";
|
||||||
|
|
||||||
|
|
@ -74,7 +76,9 @@ async function getLatestPageForRedirection() {
|
||||||
fmgPageValues.CAPABILITY_QUESTIONS
|
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()) {
|
if (!vehicleMakeComponent.methods.arePagePrerequisitesValid()) {
|
||||||
return fmgPageValues.VEHICLE_YEAR;
|
return fmgPageValues.VEHICLE_YEAR;
|
||||||
|
|
@ -96,12 +100,18 @@ async function getLatestPageForRedirection() {
|
||||||
} else if (partQuestionsComponent.methods.arePagePrerequisitesValid()) {
|
} else if (partQuestionsComponent.methods.arePagePrerequisitesValid()) {
|
||||||
return fmgPageValues.PART_QUESTIONS;
|
return fmgPageValues.PART_QUESTIONS;
|
||||||
} else if (
|
} else if (
|
||||||
|
// capture vin
|
||||||
vinLookupComponent.methods.arePagePrerequisitesValid() &&
|
vinLookupComponent.methods.arePagePrerequisitesValid() &&
|
||||||
!store.getters.damage.isRepair &&
|
!store.getters.damage.isRepair &&
|
||||||
!isVinOptionalVehicle
|
!isVinOptionalVehicle &&
|
||||||
|
experimentMixin.methods.hasSettingEqualTo(
|
||||||
|
experimentSettings.SUPPRESS_VIN_CAPTURE,
|
||||||
|
false
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
return fmgPageValues.VIN_LOOKUP;
|
return fmgPageValues.VIN_LOOKUP;
|
||||||
} else {
|
} else {
|
||||||
|
// do not capture vin
|
||||||
return fmgPageValues.ESTIMATE;
|
return fmgPageValues.ESTIMATE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -144,6 +144,16 @@ describe("getPageToRouteExistingOrderTo", () => {
|
||||||
store.commit(storeMutations.UPDATE_IS_REPAIR, false);
|
store.commit(storeMutations.UPDATE_IS_REPAIR, false);
|
||||||
store.commit(storeMutations.UPDATE_MAKE, "acura");
|
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.
|
// Mock out the lazy load calls for all components.
|
||||||
mockLazyLoadComponentReturnValues({
|
mockLazyLoadComponentReturnValues({
|
||||||
[fmgPageValues.VEHICLE_MAKE]: true,
|
[fmgPageValues.VEHICLE_MAKE]: true,
|
||||||
|
|
|
||||||
|
|
@ -84,12 +84,14 @@ const baseStoreGettersDamage = () => {
|
||||||
{
|
{
|
||||||
questionText:
|
questionText:
|
||||||
"Is your vehicle equipped with the Panoramic Sunroof which can be identified by having a glass panel over the rear seats?",
|
"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",
|
selectedAnswerText: "Yes",
|
||||||
questionNum: 1,
|
questionNum: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
questionText:
|
questionText:
|
||||||
"Is your vehicle equipped with a heated windshield that melts snow and ice from underneath the windshield wiper blades?",
|
"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",
|
selectedAnswerText: "Yes",
|
||||||
questionNum: 2,
|
questionNum: 2,
|
||||||
},
|
},
|
||||||
|
|
@ -166,10 +168,10 @@ describe("capabilityQuestions.vue", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("watch on selectedAnswers should be set up...", () => {
|
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
|
// Arrange
|
||||||
const { wrapper } = setupMocks({});
|
const { wrapper } = setupMocks({});
|
||||||
const spy = jest.spyOn(wrapper.vm, "handleAnswerUpdates");
|
const spy = jest.spyOn(wrapper.vm, "handleCompletedQuestionChainAnswers");
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
wrapper.setData({
|
wrapper.setData({
|
||||||
|
|
@ -180,12 +182,14 @@ describe("capabilityQuestions.vue", () => {
|
||||||
{
|
{
|
||||||
questionText:
|
questionText:
|
||||||
"Is your vehicle equipped with the Panoramic Sunroof which can be identified by having a glass panel over the rear seats?",
|
"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",
|
selectedAnswerText: "Yes",
|
||||||
questionNum: 1,
|
questionNum: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
questionText:
|
questionText:
|
||||||
"Is your vehicle equipped with a heated windshield that melts snow and ice from underneath the windshield wiper blades?",
|
"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",
|
selectedAnswerText: "Yes",
|
||||||
questionNum: 2,
|
questionNum: 2,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ export default {
|
||||||
"selectedAnswers." + glass.answerKey,
|
"selectedAnswers." + glass.answerKey,
|
||||||
(newValue) => {
|
(newValue) => {
|
||||||
if (newValue && Object.keys(newValue).length > 0) {
|
if (newValue && Object.keys(newValue).length > 0) {
|
||||||
this.handleAnswerUpdates(newValue, glass.answerKey);
|
this.handleCompletedQuestionChainAnswers(newValue, glass.answerKey);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ deep: true }
|
{ deep: true }
|
||||||
|
|
|
||||||
|
|
@ -221,16 +221,29 @@ describe("estimate.vue", () => {
|
||||||
|
|
||||||
describe("skipVinLookup", () => {
|
describe("skipVinLookup", () => {
|
||||||
const skipOptions = [
|
const skipOptions = [
|
||||||
[true, true, true],
|
[true, true, true, true],
|
||||||
[true, false, true],
|
[true, false, false, true],
|
||||||
[false, true, true],
|
[false, true, true, true],
|
||||||
[false, false, false],
|
[false, false, false, false],
|
||||||
];
|
];
|
||||||
test.each(skipOptions)(
|
test.each(skipOptions)(
|
||||||
"isRepair %s and isVinOptional %s should return %s",
|
"isRepair %s, isVinOptional %s and suppressVinCapture %s should return %s",
|
||||||
async (isRepair, isVinOptionalVehicle, expectedVinSkip) => {
|
async (isRepair, isVinOptionalVehicle, suppressVinCapture, expectedVinSkip) => {
|
||||||
const { wrapper } = setupMocks({ isVinOptionalVehicle: isVinOptionalVehicle });
|
const { wrapper } = setupMocks({});
|
||||||
|
await wrapper.setData({
|
||||||
|
isVinOptionalVehicle: isVinOptionalVehicle,
|
||||||
|
});
|
||||||
|
|
||||||
store.commit(storeMutations.UPDATE_IS_REPAIR, isRepair);
|
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);
|
expect(wrapper.vm.skipVinLookup).toEqual(expectedVinSkip);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<alert
|
<alert
|
||||||
class="my-4"
|
class="my-4"
|
||||||
cmsWidgetName="AlertQuoteReady"
|
:cmsWidgetName="alertInfo"
|
||||||
alertClass="alert-info"
|
alertClass="alert-info"
|
||||||
v-bind:isDismissible="false" />
|
v-bind:isDismissible="false" />
|
||||||
<div class="row my-2">
|
<div class="row my-2">
|
||||||
|
|
@ -102,6 +102,9 @@ import store from "@/store";
|
||||||
import { storeActions } from "@/constants/store-actions";
|
import { storeActions } from "@/constants/store-actions";
|
||||||
import { vinLookupMethodSelections } from "@/constants/vin-lookup-method-selections.js";
|
import { vinLookupMethodSelections } from "@/constants/vin-lookup-method-selections.js";
|
||||||
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
||||||
|
import experimentMixin from "@/mixins/experiment-mixin";
|
||||||
|
import { experimentSettings } from "@/constants/experiments";
|
||||||
|
import vinPagesMixin from "@/mixins/vin-pages-mixin";
|
||||||
|
|
||||||
// Define Validation Rules
|
// Define Validation Rules
|
||||||
defineRule("zip-required", required(errorMessages.SERVICE_ZIP_REQUIRED));
|
defineRule("zip-required", required(errorMessages.SERVICE_ZIP_REQUIRED));
|
||||||
|
|
@ -118,6 +121,7 @@ defineRule("option-required", required(errorMessages.OPTION_REQUIRED));
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "estimate",
|
name: "estimate",
|
||||||
|
mixins: [vinPagesMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
selectedVinLookupMethod: null,
|
selectedVinLookupMethod: null,
|
||||||
|
|
@ -201,10 +205,15 @@ export default {
|
||||||
}
|
}
|
||||||
this.displayNonServiceableZipAlert = false;
|
this.displayNonServiceableZipAlert = false;
|
||||||
|
|
||||||
return this.$router.navigateWithSaving(
|
if (this.isRepair) {
|
||||||
this.navigationScenarios.CLICKED_FORWARD_WITH_NO_QUESTIONS,
|
return this.$router.navigateWithSaving(
|
||||||
this.$route
|
this.navigationScenarios.CLICKED_FORWARD_WITH_NO_QUESTIONS,
|
||||||
);
|
this.$route
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
// if we're skipping the vin-lookup but it's not a repair, we still need to get the parts
|
||||||
|
await this.navigateForwardWithSingleCarMatch();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.selectedVinLookupMethod === vinLookupMethodSelections.MANUALVIN) {
|
if (this.selectedVinLookupMethod === vinLookupMethodSelections.MANUALVIN) {
|
||||||
|
|
@ -248,7 +257,24 @@ export default {
|
||||||
return store.getters.damage.isRepair;
|
return store.getters.damage.isRepair;
|
||||||
},
|
},
|
||||||
skipVinLookup() {
|
skipVinLookup() {
|
||||||
return this.isRepair || this.isVinOptionalVehicle;
|
return (
|
||||||
|
this.isRepair ||
|
||||||
|
this.isVinOptionalVehicle ||
|
||||||
|
experimentMixin.methods.hasSettingEqualTo(
|
||||||
|
experimentSettings.SUPPRESS_VIN_CAPTURE,
|
||||||
|
true
|
||||||
|
)
|
||||||
|
);
|
||||||
|
},
|
||||||
|
alertInfo() {
|
||||||
|
return (this.isVinOptionalVehicle ||
|
||||||
|
experimentMixin.methods.hasSettingEqualTo(
|
||||||
|
experimentSettings.SUPPRESS_VIN_CAPTURE,
|
||||||
|
true
|
||||||
|
)) &&
|
||||||
|
!this.isRepair
|
||||||
|
? "AlertQuoteVinOptional"
|
||||||
|
: "AlertQuoteReady";
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
|
||||||
|
|
@ -88,12 +88,14 @@ const baseStoreGettersDamage = () => {
|
||||||
{
|
{
|
||||||
questionText:
|
questionText:
|
||||||
"Is your vehicle equipped with the Panoramic Sunroof which can be identified by having a glass panel over the rear seats?",
|
"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",
|
selectedAnswerText: "Yes",
|
||||||
questionNum: 1,
|
questionNum: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
questionText:
|
questionText:
|
||||||
"Is your vehicle equipped with a heated windshield that melts snow and ice from underneath the windshield wiper blades?",
|
"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",
|
selectedAnswerText: "Yes",
|
||||||
questionNum: 2,
|
questionNum: 2,
|
||||||
},
|
},
|
||||||
|
|
@ -170,10 +172,10 @@ describe("moldingQuestions.vue", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("watch on selectedAnswers should be set up...", () => {
|
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
|
// Arrange
|
||||||
const { wrapper } = setupMocks({});
|
const { wrapper } = setupMocks({});
|
||||||
const spy = jest.spyOn(wrapper.vm, "handleAnswerUpdates");
|
const spy = jest.spyOn(wrapper.vm, "handleCompletedQuestionChainAnswers");
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
wrapper.setData({
|
wrapper.setData({
|
||||||
|
|
@ -184,12 +186,14 @@ describe("moldingQuestions.vue", () => {
|
||||||
{
|
{
|
||||||
questionText:
|
questionText:
|
||||||
"Is your vehicle equipped with the Panoramic Sunroof which can be identified by having a glass panel over the rear seats?",
|
"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",
|
selectedAnswerText: "Yes",
|
||||||
questionNum: 1,
|
questionNum: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
questionText:
|
questionText:
|
||||||
"Is your vehicle equipped with a heated windshield that melts snow and ice from underneath the windshield wiper blades?",
|
"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",
|
selectedAnswerText: "Yes",
|
||||||
questionNum: 2,
|
questionNum: 2,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ export default {
|
||||||
"selectedAnswers." + glass.answerKey,
|
"selectedAnswers." + glass.answerKey,
|
||||||
(newValue) => {
|
(newValue) => {
|
||||||
if (newValue && Object.keys(newValue).length > 0) {
|
if (newValue && Object.keys(newValue).length > 0) {
|
||||||
this.handleAnswerUpdates(newValue, glass.answerKey);
|
this.handleCompletedQuestionChainAnswers(newValue, glass.answerKey);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ deep: true }
|
{ deep: true }
|
||||||
|
|
|
||||||
|
|
@ -78,12 +78,14 @@ const baseStoreGettersDamage = () => {
|
||||||
{
|
{
|
||||||
questionText:
|
questionText:
|
||||||
"Is your vehicle equipped with the Panoramic Sunroof which can be identified by having a glass panel over the rear seats?",
|
"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",
|
selectedAnswerText: "Yes",
|
||||||
questionNum: 1,
|
questionNum: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
questionText:
|
questionText:
|
||||||
"Is your vehicle equipped with a heated windshield that melts snow and ice from underneath the windshield wiper blades?",
|
"Is your vehicle equipped with a heated windshield that melts snow and ice from underneath the windshield wiper blades?",
|
||||||
|
selectedAnswer: "1|nextQuestion|3|Yes",
|
||||||
selectedAnswerText: "Yes",
|
selectedAnswerText: "Yes",
|
||||||
questionNum: 2,
|
questionNum: 2,
|
||||||
},
|
},
|
||||||
|
|
@ -152,14 +154,14 @@ describe("partQuestions.vue...", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("watch on selectedAnswers should be set up...", () => {
|
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
|
// Arrange
|
||||||
store.getters = {
|
store.getters = {
|
||||||
pageData: baseStoreGettersPageData,
|
pageData: baseStoreGettersPageData,
|
||||||
damage: baseStoreGettersDamage,
|
damage: baseStoreGettersDamage,
|
||||||
};
|
};
|
||||||
const { wrapper } = setupMocks({});
|
const { wrapper } = setupMocks({});
|
||||||
const spy = jest.spyOn(wrapper.vm, "handleAnswerUpdates");
|
const spy = jest.spyOn(wrapper.vm, "handleCompletedQuestionChainAnswers");
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
wrapper.setData({
|
wrapper.setData({
|
||||||
|
|
@ -169,11 +171,13 @@ describe("partQuestions.vue...", () => {
|
||||||
answeredQuestions: [
|
answeredQuestions: [
|
||||||
{
|
{
|
||||||
questionText: "One?",
|
questionText: "One?",
|
||||||
|
selectedAnswer: "1|nextQuestion|3|Yes",
|
||||||
selectedAnswerText: "Yes",
|
selectedAnswerText: "Yes",
|
||||||
questionNum: 1,
|
questionNum: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
questionText: "Two?",
|
questionText: "Two?",
|
||||||
|
selectedAnswer: "1|nextQuestion|3|Yes",
|
||||||
selectedAnswerText: "Yes",
|
selectedAnswerText: "Yes",
|
||||||
questionNum: 2,
|
questionNum: 2,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ export default {
|
||||||
"selectedAnswers." + glass.answerKey,
|
"selectedAnswers." + glass.answerKey,
|
||||||
(newValue) => {
|
(newValue) => {
|
||||||
if (newValue && Object.keys(newValue).length > 0) {
|
if (newValue && Object.keys(newValue).length > 0) {
|
||||||
this.handleAnswerUpdates(newValue, glass.answerKey);
|
this.handleCompletedQuestionChainAnswers(newValue, glass.answerKey);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ deep: true }
|
{ deep: true }
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,11 @@
|
||||||
<template>
|
<template>
|
||||||
<baseInputButton v-bind="$props" @buttonClicked="handleAnswerChange" v-model="selectedValue">
|
<baseInputButton v-bind="$props" @buttonClicked="handleAnswerChange" v-model="selectedValue">
|
||||||
<div class="package-label" for="testradio">
|
<div
|
||||||
|
class="package-label"
|
||||||
|
:class="[this.buttonLabelSubCopy ? 'has-subheader' : '']"
|
||||||
|
for="testradio">
|
||||||
<div class="package-specs">
|
<div class="package-specs">
|
||||||
<p :class="[this.buttonLabelSubCopy ? 'mb-2' : 'm-0']">
|
<p class="m-0">
|
||||||
<span v-html="this.buttonLabel"></span>
|
<span v-html="this.buttonLabel"></span>
|
||||||
<span class="pricing-info" v-html="this.buttonAuxillaryCopy"></span>
|
<span class="pricing-info" v-html="this.buttonAuxillaryCopy"></span>
|
||||||
</p>
|
</p>
|
||||||
|
|
@ -113,6 +116,10 @@ export default {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
min-height: 58px;
|
min-height: 58px;
|
||||||
|
|
||||||
|
&.has-subheader {
|
||||||
|
min-height: 78px;
|
||||||
|
}
|
||||||
|
|
||||||
&:before {
|
&:before {
|
||||||
content: "";
|
content: "";
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
@ -193,12 +200,16 @@ export default {
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
span.pricing-info {
|
span {
|
||||||
color: $green;
|
&.pricing-info {
|
||||||
|
color: $green;
|
||||||
|
font-size: 0.875rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
&.sub-label {
|
&.sub-label {
|
||||||
color: $green;
|
color: $green;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
|
font-size: 0.75rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ul {
|
ul {
|
||||||
|
|
@ -206,6 +217,7 @@ export default {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
li {
|
li {
|
||||||
margin-bottom: 0.5rem;
|
margin-bottom: 0.5rem;
|
||||||
|
font-size: 0.875rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,11 +9,7 @@
|
||||||
<div class="fade-on-route-transition sub-container make-tall">
|
<div class="fade-on-route-transition sub-container make-tall">
|
||||||
<div class="row mt-2">
|
<div class="row mt-2">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<!-- includeSearchIcon and questionAlignment, placeholderText for testing only. Remove after testing. -->
|
|
||||||
<textboxQuestion
|
<textboxQuestion
|
||||||
includeSearchIcon
|
|
||||||
questionAlignment="center"
|
|
||||||
placeholderText="Styled for testing only"
|
|
||||||
cmsWidgetName="VinNumberQuestionWidget"
|
cmsWidgetName="VinNumberQuestionWidget"
|
||||||
v-model="vin"
|
v-model="vin"
|
||||||
inputId="vin"
|
inputId="vin"
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ export default {
|
||||||
|
|
||||||
return glass;
|
return glass;
|
||||||
},
|
},
|
||||||
handleAnswerUpdates(answer, glassKey, vm) {
|
handleCompletedQuestionChainAnswers(answer, glassKey, vm) {
|
||||||
// only runs when all questions in a question-chain have been answered
|
// only runs when all questions in a question-chain have been answered
|
||||||
// when selectedAnswers updates, user has completed this part's question chain and has a final answer
|
// when selectedAnswers updates, user has completed this part's question chain and has a final answer
|
||||||
// (does not get run for each invididual question's answer, only when
|
// (does not get run for each invididual question's answer, only when
|
||||||
|
|
@ -176,51 +176,39 @@ export default {
|
||||||
self.selectedAnswers = {};
|
self.selectedAnswers = {};
|
||||||
|
|
||||||
// loop through every answered question on the currently answered glass part
|
// loop through every answered question on the currently answered glass part
|
||||||
answer.answeredQuestions?.forEach((answeredQuestion) => {
|
answer.answeredQuestions?.forEach((answeredQuestion, answeredQuestionIndex) => {
|
||||||
/* answeredQuestion example format:
|
/* answeredQuestion example format:
|
||||||
{
|
{
|
||||||
"questionText": "Is your Grand Cherokee the Laredo model?",
|
"questionText": "Is your Grand Cherokee the Laredo model?",
|
||||||
|
"selectedAnswer": "1|nextQuestion|3|Yes",
|
||||||
"selectedAnswerText": "Yes",
|
"selectedAnswerText": "Yes",
|
||||||
"questionNum": 1,
|
"questionNum": 1,
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const answeredQuestionText = answeredQuestion.questionText.toUpperCase();
|
const answeredQuestionText = answeredQuestion.questionText.toUpperCase();
|
||||||
const answeredQuestionAnswer = answeredQuestion.selectedAnswerText.toUpperCase();
|
const answeredQuestionAnswer = answeredQuestion.selectedAnswer.toUpperCase();
|
||||||
|
const answeredQuestionAnswerText =
|
||||||
|
answeredQuestion.selectedAnswerText.toUpperCase();
|
||||||
|
const answeredQuestionNum = answeredQuestion.questionNum;
|
||||||
|
|
||||||
// HANDLE DUPLICATE QUESTIONS
|
// HANDLE DUPLICATE QUESTIONS
|
||||||
|
|
||||||
// loop through all glass data
|
// loop through all glass data
|
||||||
self.questionsData.forEach((glass, glassIndex) => {
|
self.questionsData.forEach((glass, glassIndex) => {
|
||||||
/* glass example format:
|
if (glassIndex === answer.index) {
|
||||||
{
|
glass.questions.forEach((question, questionIndex) => {
|
||||||
"glassName": "Single",
|
// clear out any previously set answers on first pass with first answered question
|
||||||
"glassLocation": "Windshield",
|
if (answeredQuestionIndex === 0) question.answerSelected = null;
|
||||||
"parts": null,
|
|
||||||
"questions": [
|
|
||||||
{
|
|
||||||
"questionSequence": 1,
|
|
||||||
"questionText": "Is your vehicle equipped with a black dotted pattern behind the rear view mirror, known as a third visor frit?",
|
|
||||||
"answers": [
|
|
||||||
{
|
|
||||||
"answerResult": "DW01537",
|
|
||||||
"answerText": "Yes",
|
|
||||||
"nextQuestionSequence": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"answerResult": "DW01537b",
|
|
||||||
"answerText": "No",
|
|
||||||
"nextQuestionSequence": null
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"answerKey": "Windshield-Single",
|
|
||||||
"answerData": null
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// limit duplicate search to glass pieces that follow after the currently being answered glass piece
|
if (answeredQuestionNum - 1 === questionIndex) {
|
||||||
|
// on the right question
|
||||||
|
question.answerSelected = answeredQuestionAnswer;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// limit duplicate search to glass pieces that are in or follow after the currently being answered glass piece
|
||||||
if (glassIndex > answer.index) {
|
if (glassIndex > answer.index) {
|
||||||
let indexToSuppressTo;
|
let indexToSuppressTo;
|
||||||
// reset this glass piece, in case user is changing their previous answers
|
// reset this glass piece, in case user is changing their previous answers
|
||||||
|
|
@ -229,8 +217,8 @@ export default {
|
||||||
|
|
||||||
// loop through this glass piece's questions, looking for a questionText match
|
// loop through this glass piece's questions, looking for a questionText match
|
||||||
glass.questions.forEach((question, questionIndex) => {
|
glass.questions.forEach((question, questionIndex) => {
|
||||||
// clear out any previously set answers
|
// clear out any previously set answers on first pass with first answer
|
||||||
question.answerSelected = null;
|
if (answeredQuestionIndex === 0) question.answerSelected = null;
|
||||||
|
|
||||||
// clear or set suppressThisQuestion property for each question
|
// clear or set suppressThisQuestion property for each question
|
||||||
if (indexToSuppressTo && questionIndex + 1 < indexToSuppressTo) {
|
if (indexToSuppressTo && questionIndex + 1 < indexToSuppressTo) {
|
||||||
|
|
@ -245,7 +233,9 @@ export default {
|
||||||
|
|
||||||
// handle matching answer in duplicated question
|
// handle matching answer in duplicated question
|
||||||
question.answers.forEach((ans) => {
|
question.answers.forEach((ans) => {
|
||||||
if (ans.answerText.toUpperCase() === answeredQuestionAnswer) {
|
if (
|
||||||
|
ans.answerText.toUpperCase() === answeredQuestionAnswerText
|
||||||
|
) {
|
||||||
matchedAnswer = ans;
|
matchedAnswer = ans;
|
||||||
ans.selected = true;
|
ans.selected = true;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -339,7 +329,7 @@ export default {
|
||||||
glass.isSuppressedPart = true;
|
glass.isSuppressedPart = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}); // DONE looping through glass.questions
|
||||||
|
|
||||||
// Update key to force re-render of glass piece with duplicate question in case user changes previous related answer in the chain
|
// Update key to force re-render of glass piece with duplicate question in case user changes previous related answer in the chain
|
||||||
self.questionsData[glassIndex].key =
|
self.questionsData[glassIndex].key =
|
||||||
|
|
|
||||||
|
|
@ -410,7 +410,7 @@ describe("vehicle-questions-mixin", () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("handleAnswerUpdates", () => {
|
describe("handleCompletedQuestionChainAnswers", () => {
|
||||||
describe("selectedAnswers", () => {
|
describe("selectedAnswers", () => {
|
||||||
test("should be cleared to be empty", () => {
|
test("should be cleared to be empty", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
|
|
@ -419,6 +419,7 @@ describe("vehicle-questions-mixin", () => {
|
||||||
answeredQuestions: [
|
answeredQuestions: [
|
||||||
{
|
{
|
||||||
questionText: "Test duplicate question 1?",
|
questionText: "Test duplicate question 1?",
|
||||||
|
selectedAnswer: "1|nextQuestion|3|Yes",
|
||||||
selectedAnswerText: "Yes",
|
selectedAnswerText: "Yes",
|
||||||
questionNum: 1,
|
questionNum: 1,
|
||||||
},
|
},
|
||||||
|
|
@ -438,7 +439,7 @@ describe("vehicle-questions-mixin", () => {
|
||||||
];
|
];
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
wrapper.vm.handleAnswerUpdates(answer, "", wrapper.vm);
|
wrapper.vm.handleCompletedQuestionChainAnswers(answer, "", wrapper.vm);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(wrapper.vm.selectedAnswers).toMatchObject({});
|
expect(wrapper.vm.selectedAnswers).toMatchObject({});
|
||||||
|
|
@ -453,6 +454,7 @@ describe("vehicle-questions-mixin", () => {
|
||||||
answeredQuestions: [
|
answeredQuestions: [
|
||||||
{
|
{
|
||||||
questionText: "Test duplicate question 1?",
|
questionText: "Test duplicate question 1?",
|
||||||
|
selectedAnswer: "1|nextQuestion|3|Yes",
|
||||||
selectedAnswerText: "Yes",
|
selectedAnswerText: "Yes",
|
||||||
questionNum: 1,
|
questionNum: 1,
|
||||||
},
|
},
|
||||||
|
|
@ -477,7 +479,7 @@ describe("vehicle-questions-mixin", () => {
|
||||||
];
|
];
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
wrapper.vm.handleAnswerUpdates(answer, "", wrapper.vm);
|
wrapper.vm.handleCompletedQuestionChainAnswers(answer, "", wrapper.vm);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(wrapper.vm.questionsData[1].answerData).toEqual(null);
|
expect(wrapper.vm.questionsData[1].answerData).toEqual(null);
|
||||||
|
|
@ -489,6 +491,7 @@ describe("vehicle-questions-mixin", () => {
|
||||||
answeredQuestions: [
|
answeredQuestions: [
|
||||||
{
|
{
|
||||||
questionText: "Test duplicate question 1?",
|
questionText: "Test duplicate question 1?",
|
||||||
|
selectedAnswer: "1|nextQuestion|3|Yes",
|
||||||
selectedAnswerText: "Yes",
|
selectedAnswerText: "Yes",
|
||||||
questionNum: 1,
|
questionNum: 1,
|
||||||
},
|
},
|
||||||
|
|
@ -514,7 +517,7 @@ describe("vehicle-questions-mixin", () => {
|
||||||
];
|
];
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
wrapper.vm.handleAnswerUpdates(answer, "", wrapper.vm);
|
wrapper.vm.handleCompletedQuestionChainAnswers(answer, "", wrapper.vm);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(wrapper.vm.questionsData[1].isSuppressedPart).toEqual(null);
|
expect(wrapper.vm.questionsData[1].isSuppressedPart).toEqual(null);
|
||||||
|
|
@ -526,6 +529,7 @@ describe("vehicle-questions-mixin", () => {
|
||||||
answeredQuestions: [
|
answeredQuestions: [
|
||||||
{
|
{
|
||||||
questionText: "Test duplicate question 1?",
|
questionText: "Test duplicate question 1?",
|
||||||
|
selectedAnswer: "1|nextQuestion|3|Yes",
|
||||||
selectedAnswerText: "Yes",
|
selectedAnswerText: "Yes",
|
||||||
questionNum: 1,
|
questionNum: 1,
|
||||||
},
|
},
|
||||||
|
|
@ -587,7 +591,7 @@ describe("vehicle-questions-mixin", () => {
|
||||||
];
|
];
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
wrapper.vm.handleAnswerUpdates(answer, "", wrapper.vm);
|
wrapper.vm.handleCompletedQuestionChainAnswers(answer, "", wrapper.vm);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(wrapper.vm.questionsData[1].questions[0].answerSelected).toEqual(null);
|
expect(wrapper.vm.questionsData[1].questions[0].answerSelected).toEqual(null);
|
||||||
|
|
@ -603,6 +607,7 @@ describe("vehicle-questions-mixin", () => {
|
||||||
answeredQuestions: [
|
answeredQuestions: [
|
||||||
{
|
{
|
||||||
questionText: "Test duplicate question 1?",
|
questionText: "Test duplicate question 1?",
|
||||||
|
selectedAnswer: "1|nextQuestion|3|No",
|
||||||
selectedAnswerText: "No",
|
selectedAnswerText: "No",
|
||||||
questionNum: 1,
|
questionNum: 1,
|
||||||
},
|
},
|
||||||
|
|
@ -661,7 +666,7 @@ describe("vehicle-questions-mixin", () => {
|
||||||
];
|
];
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
wrapper.vm.handleAnswerUpdates(answerNo, "", wrapper.vm);
|
wrapper.vm.handleCompletedQuestionChainAnswers(answerNo, "", wrapper.vm);
|
||||||
const glassWithDuplicate = wrapper.vm.questionsData[1];
|
const glassWithDuplicate = wrapper.vm.questionsData[1];
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
|
|
@ -675,6 +680,7 @@ describe("vehicle-questions-mixin", () => {
|
||||||
answeredQuestions: [
|
answeredQuestions: [
|
||||||
{
|
{
|
||||||
questionText: "Test duplicate question 1?",
|
questionText: "Test duplicate question 1?",
|
||||||
|
selectedAnswer: "1|nextQuestion|3|No",
|
||||||
selectedAnswerText: "No",
|
selectedAnswerText: "No",
|
||||||
questionNum: 1,
|
questionNum: 1,
|
||||||
},
|
},
|
||||||
|
|
@ -731,7 +737,7 @@ describe("vehicle-questions-mixin", () => {
|
||||||
];
|
];
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
wrapper.vm.handleAnswerUpdates(answerNo, "", wrapper.vm);
|
wrapper.vm.handleCompletedQuestionChainAnswers(answerNo, "", wrapper.vm);
|
||||||
const duplicateQuestion = wrapper.vm.questionsData[1].questions[0];
|
const duplicateQuestion = wrapper.vm.questionsData[1].questions[0];
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
|
|
@ -746,6 +752,7 @@ describe("vehicle-questions-mixin", () => {
|
||||||
answeredQuestions: [
|
answeredQuestions: [
|
||||||
{
|
{
|
||||||
questionText: "Test duplicate question 1?",
|
questionText: "Test duplicate question 1?",
|
||||||
|
selectedAnswer: "1|nextQuestion|3|No",
|
||||||
selectedAnswerText: "No",
|
selectedAnswerText: "No",
|
||||||
questionNum: 1,
|
questionNum: 1,
|
||||||
},
|
},
|
||||||
|
|
@ -835,7 +842,7 @@ describe("vehicle-questions-mixin", () => {
|
||||||
];
|
];
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
wrapper.vm.handleAnswerUpdates(answerNo, "", wrapper.vm);
|
wrapper.vm.handleCompletedQuestionChainAnswers(answerNo, "", wrapper.vm);
|
||||||
const nextQuestionAfterDuplicate = wrapper.vm.questionsData[1].questions[2];
|
const nextQuestionAfterDuplicate = wrapper.vm.questionsData[1].questions[2];
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
|
|
@ -849,6 +856,7 @@ describe("vehicle-questions-mixin", () => {
|
||||||
answeredQuestions: [
|
answeredQuestions: [
|
||||||
{
|
{
|
||||||
questionText: "Test question 3?",
|
questionText: "Test question 3?",
|
||||||
|
selectedAnswer: "1|nextQuestion|3|No",
|
||||||
selectedAnswerText: "No",
|
selectedAnswerText: "No",
|
||||||
questionNum: 1,
|
questionNum: 1,
|
||||||
},
|
},
|
||||||
|
|
@ -969,7 +977,7 @@ describe("vehicle-questions-mixin", () => {
|
||||||
];
|
];
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
wrapper.vm.handleAnswerUpdates(answerNo, "", wrapper.vm);
|
wrapper.vm.handleCompletedQuestionChainAnswers(answerNo, "", wrapper.vm);
|
||||||
const duplicatedQuestion = wrapper.vm.questionsData[1].questions[2];
|
const duplicatedQuestion = wrapper.vm.questionsData[1].questions[2];
|
||||||
const duplicatedQuestionAnswer = duplicatedQuestion.answers.filter((a) => {
|
const duplicatedQuestionAnswer = duplicatedQuestion.answers.filter((a) => {
|
||||||
return a.selected;
|
return a.selected;
|
||||||
|
|
@ -997,6 +1005,7 @@ describe("vehicle-questions-mixin", () => {
|
||||||
answeredQuestions: [
|
answeredQuestions: [
|
||||||
{
|
{
|
||||||
questionText: "Test duplicate question 1?",
|
questionText: "Test duplicate question 1?",
|
||||||
|
selectedAnswer: "1|nextQuestion|3|No",
|
||||||
selectedAnswerText: "No",
|
selectedAnswerText: "No",
|
||||||
questionNum: 1,
|
questionNum: 1,
|
||||||
},
|
},
|
||||||
|
|
@ -1085,7 +1094,7 @@ describe("vehicle-questions-mixin", () => {
|
||||||
];
|
];
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
wrapper.vm.handleAnswerUpdates(answerNo, "", wrapper.vm);
|
wrapper.vm.handleCompletedQuestionChainAnswers(answerNo, "", wrapper.vm);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(
|
expect(
|
||||||
|
|
@ -1109,6 +1118,7 @@ describe("vehicle-questions-mixin", () => {
|
||||||
answeredQuestions: [
|
answeredQuestions: [
|
||||||
{
|
{
|
||||||
questionText: "Test question 3?",
|
questionText: "Test question 3?",
|
||||||
|
selectedAnswer: "1|nextQuestion|3|No",
|
||||||
selectedAnswerText: "No",
|
selectedAnswerText: "No",
|
||||||
questionNum: 1,
|
questionNum: 1,
|
||||||
},
|
},
|
||||||
|
|
@ -1197,7 +1207,7 @@ describe("vehicle-questions-mixin", () => {
|
||||||
];
|
];
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
await wrapper.vm.handleAnswerUpdates(answerNo, "", wrapper.vm);
|
await wrapper.vm.handleCompletedQuestionChainAnswers(answerNo, "", wrapper.vm);
|
||||||
|
|
||||||
const questionsToTest = wrapper.vm.questionsData[1].questions;
|
const questionsToTest = wrapper.vm.questionsData[1].questions;
|
||||||
const answerLeadingToDuplicate = questionsToTest[0].answers[1];
|
const answerLeadingToDuplicate = questionsToTest[0].answers[1];
|
||||||
|
|
|
||||||
|
|
@ -241,6 +241,22 @@ const routingTable = function (store) {
|
||||||
scenario: navigationScenarios.CLICKED_FORWARD_WITH_NO_QUESTIONS,
|
scenario: navigationScenarios.CLICKED_FORWARD_WITH_NO_QUESTIONS,
|
||||||
destinationFmgPageValue: fmgPageValues.QUOTE,
|
destinationFmgPageValue: fmgPageValues.QUOTE,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
scenario: navigationScenarios.CLICKED_FORWARD_WITH_PART_QUESTIONS,
|
||||||
|
destinationFmgPageValue: fmgPageValues.PART_QUESTIONS,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
scenario: navigationScenarios.CLICKED_FORWARD_WITH_MULTIPLE_PARTS_TO_CHOOSE,
|
||||||
|
destinationFmgPageValue: fmgPageValues.VEHICLE_PARTS,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
scenario: navigationScenarios.CLICKED_FORWARD_WITH_MOLDING_QUESTIONS,
|
||||||
|
destinationFmgPageValue: fmgPageValues.MOLDING_QUESTIONS,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
scenario: navigationScenarios.CLICKED_FORWARD_WITH_CAPABILITY_QUESTIONS,
|
||||||
|
destinationFmgPageValue: fmgPageValues.CAPABILITY_QUESTIONS,
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1426,8 +1426,9 @@ export const actions = {
|
||||||
if (
|
if (
|
||||||
context.state.order.vehicle.make.toLowerCase() === "ford" &&
|
context.state.order.vehicle.make.toLowerCase() === "ford" &&
|
||||||
context.state.order.vehicle.year >= 2018
|
context.state.order.vehicle.year >= 2018
|
||||||
)
|
) {
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
context.state.order.vehicle.make.toLowerCase() === "bmw" &&
|
context.state.order.vehicle.make.toLowerCase() === "bmw" &&
|
||||||
|
|
|
||||||
|
|
@ -126,6 +126,14 @@ html {
|
||||||
background-position: right 0.75rem center;
|
background-position: right 0.75rem center;
|
||||||
background-size: 16px 12px;
|
background-size: 16px 12px;
|
||||||
}
|
}
|
||||||
|
.has-search-icon {
|
||||||
|
button[type="submit"] {
|
||||||
|
background-color: $red-100;
|
||||||
|
background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15.7817 14.7328L11.8252 10.7762C12.8833 9.45005 13.3936 7.76911 13.2513 6.07849C13.1091 4.38788 12.325 2.81587 11.0601 1.6852C9.79515 0.554524 8.14538 -0.0490261 6.44946 -0.00154744C4.75353 0.0459312 3.14012 0.740836 1.94045 1.94051C0.740775 3.14018 0.0458701 4.75359 -0.00160848 6.44952C-0.0490871 8.14545 0.554463 9.79521 1.68514 11.0601C2.81581 12.325 4.38782 13.1091 6.07843 13.2514C7.76905 13.3937 9.44999 12.8834 10.7762 11.8252L14.7349 15.7839C14.8044 15.8527 14.8869 15.907 14.9774 15.9439C15.068 15.9808 15.165 15.9995 15.2628 15.9989C15.3606 15.9983 15.4573 15.9784 15.5475 15.9405C15.6376 15.9025 15.7194 15.8471 15.7881 15.7776C15.8568 15.708 15.9112 15.6256 15.9481 15.535C15.985 15.4444 16.0036 15.3474 16.0031 15.2496C16.0025 15.1518 15.9826 15.0551 15.9446 14.965C15.9067 14.8748 15.8513 14.7931 15.7817 14.7243V14.7328ZM6.63737 11.7913C5.61803 11.7913 4.62157 11.4891 3.77402 10.9228C2.92646 10.3564 2.26587 9.5515 1.87578 8.60975C1.4857 7.668 1.38363 6.63172 1.5825 5.63196C1.78136 4.6322 2.27222 3.71386 2.99301 2.99307C3.7138 2.27229 4.63214 1.78142 5.6319 1.58256C6.63166 1.38369 7.66793 1.48576 8.60969 1.87585C9.55144 2.26593 10.3564 2.92652 10.9227 3.77408C11.489 4.62163 11.7913 5.61809 11.7913 6.63743C11.7896 8.00382 11.2461 9.31376 10.2799 10.2799C9.3137 11.2461 8.00376 11.7897 6.63737 11.7913Z' fill='%23d4281c'/%3E%3C/svg%3E%0A");
|
||||||
|
border: 1px solid $red;
|
||||||
|
border-left: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Restore to default style if alert box is present
|
//Restore to default style if alert box is present
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue