Merge pull request #1905 from Safelite/feature/CSR-977
CSR-977 revert suppressvincapture decommission
This commit is contained in:
commit
811d3fae06
4 changed files with 37 additions and 2 deletions
|
|
@ -4,6 +4,7 @@ const experimentUniverses = {
|
|||
|
||||
const experimentSettings = {
|
||||
GOOGLE_CUSTOM_DIMENSION_INDEX: "Google Custom Dimension Index",
|
||||
SUPPRESS_VIN_CAPTURE: "SuppressVinCapture",
|
||||
DISPLAY_AVAILABILITY_INDICATORS: "DisplayAvailabilityIndicators",
|
||||
PIA_EXPERIENCE: "PIA Experience",
|
||||
PIA_INSURANCE: "DisplayPIAInsurance",
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@ import { lazyLoadComponent } from "@/router/dynamic-routing/component-loader.js"
|
|||
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 { includesWindshieldReplacement } from "@/helpers/damage-helper";
|
||||
import store from "@/store";
|
||||
import router from "@/router";
|
||||
|
|
@ -139,7 +142,11 @@ export async function skipVinLookup() {
|
|||
? await store.dispatch(storeActions.IS_VIN_OPTIONAL_VEHICLE)
|
||||
: false;
|
||||
|
||||
return isVinOptionalVehicle || !includesWindshieldReplacement();
|
||||
return (
|
||||
isVinOptionalVehicle ||
|
||||
!includesWindshieldReplacement() ||
|
||||
experimentMixin.methods.hasSettingEqualTo(experimentSettings.SUPPRESS_VIN_CAPTURE, "true")
|
||||
);
|
||||
}
|
||||
|
||||
export async function skipVinLookupNotRepair() {
|
||||
|
|
@ -151,7 +158,11 @@ export async function skipVinLookupNotRepair() {
|
|||
? await store.dispatch(storeActions.IS_VIN_OPTIONAL_VEHICLE)
|
||||
: false;
|
||||
|
||||
return isVinOptionalVehicle || !includesWindshieldReplacement();
|
||||
return (
|
||||
isVinOptionalVehicle ||
|
||||
!includesWindshieldReplacement() ||
|
||||
experimentMixin.methods.hasSettingEqualTo(experimentSettings.SUPPRESS_VIN_CAPTURE, "true")
|
||||
);
|
||||
}
|
||||
|
||||
async function getLazyLoadedComponent(pageName) {
|
||||
|
|
|
|||
|
|
@ -115,6 +115,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]: true,
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import router from "@/router";
|
|||
import { navigationScenarios } from "@/router/router-constants/navigation-scenarios";
|
||||
import { saveSession } from "@/helpers/heritage-integration/order-helper.js";
|
||||
import vinPagesMixin from "@/mixins/vin-pages-mixin";
|
||||
import { experimentSettings } from "../../constants/experiments";
|
||||
|
||||
// Constants
|
||||
|
||||
|
|
@ -23,6 +24,16 @@ let mockCmsContent = {
|
|||
let mockStoreActionData = {};
|
||||
|
||||
let mockStoreData = {};
|
||||
let mockExperimentSettings = {
|
||||
experiments: [
|
||||
{
|
||||
universeName: "ConceptFunnel",
|
||||
settings: {
|
||||
SuppressVinCapture: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
function resetMockStoreData() {
|
||||
mockStoreData = {
|
||||
|
|
@ -159,12 +170,14 @@ function resetMockStoreData() {
|
|||
|
||||
function applyMockStoreDataToGetters() {
|
||||
store.getters = {
|
||||
experimentSettings: mockExperimentSettings,
|
||||
order: mockStoreData,
|
||||
damage: mockStoreData.damage,
|
||||
payment: mockStoreData.payment,
|
||||
policy: mockStoreData.policy,
|
||||
};
|
||||
store.state.order = mockStoreData;
|
||||
store.state.applicationUser.experiments = mockExperimentSettings;
|
||||
}
|
||||
|
||||
async function mockDispatchStoreAction(actionName) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue