diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js
index b77b1456f..8f67cc048 100644
--- a/src/constants/store-actions.js
+++ b/src/constants/store-actions.js
@@ -12,6 +12,7 @@ const storeActions = {
SET_VEHICLE: "setVehicle",
GET_DAMAGE_OPTIONS: "getDamageOptions",
GET_EVOX_IMAGE: "getEvoxImage",
+ IS_VIN_OPTIONAL_VEHICLE: "isVinOptionalVehicle",
// Lookup Actions
LOOKUP_VEHICLE_BY_YMMS: "lookupVehicleByYmms",
diff --git a/src/helpers/heritage-integration/navigation-helper.js b/src/helpers/heritage-integration/navigation-helper.js
index 9720598eb..5ac7a902e 100644
--- a/src/helpers/heritage-integration/navigation-helper.js
+++ b/src/helpers/heritage-integration/navigation-helper.js
@@ -3,6 +3,8 @@ import { externalUrls } from "@/router/router-constants/externalUrl-values";
import { lazyLoadComponent } from "@/router/dynamic-routing/component-loader.js";
import { saveOrder } 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 store from "@/store";
import router from "@/router";
@@ -73,6 +75,17 @@ async function getLatestPageForRedirection() {
const moldingQuestionsComponent = await getLazyLoadedComponent(fmgPageValues.MOLDING_QUESTIONS);
const capabilityQuestionsComponent = await getLazyLoadedComponent(fmgPageValues.CAPABILITY_QUESTIONS);
+ const vinOptionalVehiclePromise = store.dispatch(storeActions.IS_VIN_OPTIONAL_VEHICLE);
+ const promiseResultMap = [
+ {
+ resultKey: "vinOptionalOptions",
+ promise: vinOptionalVehiclePromise,
+ },
+ ];
+ const resultMap = await settleAllPromises(promiseResultMap);
+
+ var isVinOptionalVehicle = resultMap.vinOptionalOptions;
+
if (!vehicleMakeComponent.methods.arePagePrerequisitesValid()) {
return fmgPageValues.VEHICLE_YEAR;
} else if (!vehicleModelComponent.methods.arePagePrerequisitesValid()) {
@@ -96,7 +109,7 @@ async function getLatestPageForRedirection() {
else if (partQuestionsComponent.methods.arePagePrerequisitesValid()) {
return fmgPageValues.PART_QUESTIONS;
}
- else if (vinLookupComponent.methods.arePagePrerequisitesValid() && !store.getters.damage.isRepair) {
+ else if (vinLookupComponent.methods.arePagePrerequisitesValid() && !store.getters.damage.isRepair && !isVinOptionalVehicle) {
return fmgPageValues.VIN_LOOKUP;
}
else {
diff --git a/src/layouts/estimate/estimate.spec.js b/src/layouts/estimate/estimate.spec.js
index 476b8cdff..12e03c3df 100644
--- a/src/layouts/estimate/estimate.spec.js
+++ b/src/layouts/estimate/estimate.spec.js
@@ -87,6 +87,9 @@ describe("estimate.vue", () => {
selectedVinLookupMethod: vinLookupMethodSelections.HOMEADDRESS
})
+ store.commit( storeMutations.UPDATE_IS_REPAIR, false );
+ store.commit( storeMutations.UPDATE_MAKE, "acura" );
+
//Act
wrapper.vm.forwardButtonAction();
@@ -162,8 +165,22 @@ describe("estimate.vue", () => {
});
+describe("skipVinLookup", () => {
+ const skipOptions = [[true, true, true],
+ [true, false, true],
+ [false, true, true],
+ [false, false, false]];
+ test.each(skipOptions)("isRepair %s and isVinOptional %s should return %s", async (isRepair, isVinOptionalVehicle, expectedVinSkip) => {
+ const { wrapper } = setupMocks({ isVinOptionalVehicle: isVinOptionalVehicle});
+ store.commit( storeMutations.UPDATE_IS_REPAIR, isRepair);
+
+ expect(wrapper.vm.skipVinLookup).toEqual(expectedVinSkip);
+ });
+});
+
function setupMocks({
groupName = "estimate",
+ isVinOptionalVehicle = false,
cmsQuestionText = "Let's get your VIN. Or we can look it up for you!",
cmsAnswers = [{ Name: "Provide my VIN manually Most specific to your vehicle" }, { Name: "Provide my license plate # Most accurate VIN match" }, { Name: "Provide my home address Most convenient VIN match" }],
funnelFooterWidget = { ForwardButtonText: "test txt" },
@@ -187,12 +204,12 @@ function setupMocks({
const apiPromise = Promise.resolve({ cmsContent });
settleAllPromises.mockImplementation(() => apiPromise);
fetchCmsContentForPage.mockImplementation(() => Promise.resolve());
-
const mountOptions = getMountOptions({ ...mountOptionsMockData, mixins: [baseMixin] });
mountOptions['attachTo'] = document.body;
const wrapper = shallowMount(estimate, mountOptions);
+ wrapper.vm.isVinOptionalVehicle = isVinOptionalVehicle;
return { wrapper, apiPromise };
diff --git a/src/layouts/estimate/estimate.vue b/src/layouts/estimate/estimate.vue
index faf2c8ed6..8097585e6 100644
--- a/src/layouts/estimate/estimate.vue
+++ b/src/layouts/estimate/estimate.vue
@@ -11,7 +11,7 @@