Merge branch 'develop' into feature/CSR-108
This commit is contained in:
commit
22e50a576d
32 changed files with 1148 additions and 325 deletions
|
|
@ -8,6 +8,13 @@
|
||||||
</div>
|
</div>
|
||||||
<!-- Modal -->
|
<!-- Modal -->
|
||||||
<div class="modal fade" id="footerModal" tabindex="-1" aria-labelledby="footerModalLabel" aria-hidden="true" v-on="{ 'show.bs.modal' : show, 'hide.bs.modal' : hide }" :style="`height: calc(100% - ${currentFooterAndHeaderHeight}px);`">
|
<div class="modal fade" id="footerModal" tabindex="-1" aria-labelledby="footerModalLabel" aria-hidden="true" v-on="{ 'show.bs.modal' : show, 'hide.bs.modal' : hide }" :style="`height: calc(100% - ${currentFooterAndHeaderHeight}px);`">
|
||||||
|
<div class="menu-modal-container">
|
||||||
|
<button class="menu-button" type="button" :class="[isActive ? 'active' : '']" data-bs-toggle="modal" data-bs-target="#footerModal" aria-label="Hamburger Menu (modal window)">
|
||||||
|
<div class="bar1"></div>
|
||||||
|
<div class="bar2"></div>
|
||||||
|
<div class="bar3"></div>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
<div class="modal-dialog modal-fullscreen">
|
<div class="modal-dialog modal-fullscreen">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header visually-hidden">
|
<div class="modal-header visually-hidden">
|
||||||
|
|
@ -100,6 +107,8 @@ export default {
|
||||||
height: calc(100% - 72px);
|
height: calc(100% - 72px);
|
||||||
top: 72px;
|
top: 72px;
|
||||||
border-top: 1px solid $gray-300;
|
border-top: 1px solid $gray-300;
|
||||||
|
overflow-x: visible;
|
||||||
|
overflow-y: visible;
|
||||||
.modal-body {
|
.modal-body {
|
||||||
padding: 2rem;
|
padding: 2rem;
|
||||||
}
|
}
|
||||||
|
|
@ -114,6 +123,45 @@ export default {
|
||||||
border-top: none;
|
border-top: none;
|
||||||
padding: 2rem;
|
padding: 2rem;
|
||||||
}
|
}
|
||||||
|
.menu-modal-container {
|
||||||
|
position: absolute;
|
||||||
|
padding: 1.47rem 1rem 1.47rem 1.47rem;
|
||||||
|
right: 0;
|
||||||
|
top: -4.5rem;
|
||||||
|
button {
|
||||||
|
border: none;
|
||||||
|
&.menu-button {
|
||||||
|
width: 1.5rem;
|
||||||
|
height: 1.5rem;
|
||||||
|
border-radius: 50%;
|
||||||
|
box-shadow: none;
|
||||||
|
background-color: $white;
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0;//Required to prevent 'squish' on iPhone
|
||||||
|
z-index: 1056;
|
||||||
|
.bar1,
|
||||||
|
.bar2,
|
||||||
|
.bar3 {
|
||||||
|
width: 14px;
|
||||||
|
height: 2px;
|
||||||
|
background-color: $blue;
|
||||||
|
margin: 1px 0;
|
||||||
|
transition: 0.25s;
|
||||||
|
}
|
||||||
|
&.active .bar1 {
|
||||||
|
transform: rotate(-45deg) translate(-3px, 3px);
|
||||||
|
}
|
||||||
|
&.active .bar2 {opacity: 0;}
|
||||||
|
&.active .bar3 {
|
||||||
|
transform: rotate(45deg) translate(-3px, -3px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
//.modal-backdrop styles are in common-styles.scss
|
//.modal-backdrop styles are in common-styles.scss
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,9 @@ const applicationConfig = {
|
||||||
ANALYTICS_SESSION_TIMEOUT_MINUTES: 30,
|
ANALYTICS_SESSION_TIMEOUT_MINUTES: 30,
|
||||||
SAVED_SESSION_TIMEOUT_DAYS: 45,
|
SAVED_SESSION_TIMEOUT_DAYS: 45,
|
||||||
COOKIE_PATH: "/",
|
COOKIE_PATH: "/",
|
||||||
CURRENT_ENVIRONMENT: process.env.VUE_APP_CURRENT_ENVIRONMENT // "Localhost", "Dev", "QA", and "Prod"
|
CURRENT_ENVIRONMENT: process.env.VUE_APP_CURRENT_ENVIRONMENT, // "Localhost", "Dev", "QA", and "Prod"
|
||||||
|
APPLICATION_NAME: "FixMyGlass",
|
||||||
|
SITE_ENTRY_TRIGGER_VALUE: "FixMyGlass"
|
||||||
};
|
};
|
||||||
|
|
||||||
export { applicationConfig };
|
export { applicationConfig };
|
||||||
|
|
@ -72,7 +72,7 @@ const endpoints = {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
},
|
},
|
||||||
LogExperimentExposureIfAssigned:{
|
LogExperimentExposureIfAssigned:{
|
||||||
url: "/analytics/api/v1/analytics/log-experiment-exposure",
|
url: "/experiments/api/v1/experiments/log-exposure",
|
||||||
method: "POST",
|
method: "POST",
|
||||||
},
|
},
|
||||||
LogPageView:{
|
LogPageView:{
|
||||||
|
|
@ -90,6 +90,10 @@ const endpoints = {
|
||||||
GetExperimentsByUser: {
|
GetExperimentsByUser: {
|
||||||
url: "/analytics/api/v1/analytics/get-experiments",
|
url: "/analytics/api/v1/analytics/get-experiments",
|
||||||
method: "GET",
|
method: "GET",
|
||||||
|
},
|
||||||
|
RunExperimentsForTrigger: {
|
||||||
|
url: "/experiments/api/v1/experiments/run",
|
||||||
|
method: "POST"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,11 @@ const experimentUniverses = {
|
||||||
const experimentSettings = {
|
const experimentSettings = {
|
||||||
GOOGLE_CUSTOM_DIMENSION_INDEX: 'Google Custom Dimension Index'
|
GOOGLE_CUSTOM_DIMENSION_INDEX: 'Google Custom Dimension Index'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const experimentTriggers = {
|
||||||
|
SITE_ENTRY: "SiteEntry",
|
||||||
|
PAGE_ENTRY: "PageEntry"
|
||||||
|
};
|
||||||
|
|
||||||
export { experimentUniverses, experimentSettings};
|
export { experimentUniverses, experimentSettings, experimentTriggers };
|
||||||
|
|
||||||
|
|
@ -30,6 +30,7 @@ const storeActions = {
|
||||||
LOG_CUSTOM_EVENT: "logCustomEvent",
|
LOG_CUSTOM_EVENT: "logCustomEvent",
|
||||||
INITIALIZE_SESSION: "initializeSession",
|
INITIALIZE_SESSION: "initializeSession",
|
||||||
GET_EXPERIMENTS_BY_USER: "GetExperimentsByUser",
|
GET_EXPERIMENTS_BY_USER: "GetExperimentsByUser",
|
||||||
|
RUN_EXPERIMENTS_FOR_TRIGGER: "runExperimentsForTrigger",
|
||||||
CLEAR_VIN: "clearVin",
|
CLEAR_VIN: "clearVin",
|
||||||
RESET_SAVE_ORDER_PROMISE: "resetSaveOrderPromise",
|
RESET_SAVE_ORDER_PROMISE: "resetSaveOrderPromise",
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ const storeMutations = {
|
||||||
UPDATE_GLASS_TO_REPLACE: "updateGlassToReplace",
|
UPDATE_GLASS_TO_REPLACE: "updateGlassToReplace",
|
||||||
UPDATE_PART_QUESTION_ANSWERS: "updatePartQuestionAnswers",
|
UPDATE_PART_QUESTION_ANSWERS: "updatePartQuestionAnswers",
|
||||||
UPDATE_GLASS_PARTS: "updateGlassParts",
|
UPDATE_GLASS_PARTS: "updateGlassParts",
|
||||||
|
UPDATE_OTHER_PARTS: "updateOtherParts",
|
||||||
|
|
||||||
UPDATE_REGISTRATION_LICENSE_PLATE : "updateRegistrationLicensePlate",
|
UPDATE_REGISTRATION_LICENSE_PLATE : "updateRegistrationLicensePlate",
|
||||||
UPDATE_REGISTRATION_ADDRESS: "updateRegistrationAddress",
|
UPDATE_REGISTRATION_ADDRESS: "updateRegistrationAddress",
|
||||||
|
|
@ -39,6 +40,7 @@ const storeMutations = {
|
||||||
UPDATE_REFERRAL_DATE: "updateReferralDate",
|
UPDATE_REFERRAL_DATE: "updateReferralDate",
|
||||||
UPDATE_REFERRAL_CORRELATION_ID: "updateReferralCorrelationId",
|
UPDATE_REFERRAL_CORRELATION_ID: "updateReferralCorrelationId",
|
||||||
UPDATE_PARENT_ACCT_NUMBER: "updateParentAcctNumber",
|
UPDATE_PARENT_ACCT_NUMBER: "updateParentAcctNumber",
|
||||||
|
UPDATE_EON: "updateEON",
|
||||||
UPDATE_SAVED_SESSION_ID: "updateSavedSessionId",
|
UPDATE_SAVED_SESSION_ID: "updateSavedSessionId",
|
||||||
UPDATE_CRM_CUSTOMER_ID: "updateCrmCustomerId",
|
UPDATE_CRM_CUSTOMER_ID: "updateCrmCustomerId",
|
||||||
|
|
||||||
|
|
@ -52,13 +54,17 @@ const storeMutations = {
|
||||||
RESET_REGISTRATION_STATE: "resetRegistrationState",
|
RESET_REGISTRATION_STATE: "resetRegistrationState",
|
||||||
RESET_GLASS_PARTS_STATE: "resetGlassPartsState",
|
RESET_GLASS_PARTS_STATE: "resetGlassPartsState",
|
||||||
RESET_STATE: "resetState",
|
RESET_STATE: "resetState",
|
||||||
|
RESET_SAVE_ORDER_PROMISE: "resetSaveOrderPromise",
|
||||||
|
|
||||||
// OTHER MUTATIONS
|
// OTHER MUTATIONS
|
||||||
UPDATE_PAGE_DATA: "updatePageData",
|
UPDATE_PAGE_DATA: "updatePageData",
|
||||||
UPDATE_STATE_WITH_ORDER_INFORMATION: "updateStateWithOrderInformation",
|
UPDATE_STATE_WITH_ORDER_INFORMATION: "updateStateWithOrderInformation",
|
||||||
UPDATE_SAVE_ORDER_PROMISE: "updateSaveOrderPromise",
|
UPDATE_SAVE_ORDER_PROMISE: "updateSaveOrderPromise",
|
||||||
UPDATE_LAST_PAGE_VISITED: "updateLastPageVisited",
|
UPDATE_LAST_PAGE_VISITED: "updateLastPageVisited",
|
||||||
RESET_SAVE_ORDER_PROMISE: "resetSaveOrderPromise",
|
|
||||||
|
// EXPERIMENT MUTATIONS
|
||||||
|
UPDATE_EXPERIMENTS: "updateExperiments",
|
||||||
|
UPDATE_TRIGGERED_SITE_ENTRY: "updateTriggeredSiteEntry",
|
||||||
};
|
};
|
||||||
|
|
||||||
export { storeMutations };
|
export { storeMutations };
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,6 @@ export function updateOrCreateFunnelCookie() {
|
||||||
const wasClaimRegistrationDelayed = getFunnelCookie()?.HasDelayedClaimRegistration;
|
const wasClaimRegistrationDelayed = getFunnelCookie()?.HasDelayedClaimRegistration;
|
||||||
const shouldSuppressConceptFunnel = getFunnelCookie()?.SuppressConceptFunnel;
|
const shouldSuppressConceptFunnel = getFunnelCookie()?.SuppressConceptFunnel;
|
||||||
|
|
||||||
// Create the cookie
|
|
||||||
document.cookie = `${cookieNames.FUNNEL_SESSION_INFO}={}; path=${applicationConfig.COOKIE_PATH}; ${getCookieDomainValue()};`;
|
|
||||||
|
|
||||||
// Set up cookie with all the props.
|
// Set up cookie with all the props.
|
||||||
setFunnelCookieProperties({
|
setFunnelCookieProperties({
|
||||||
LastTouched: new Date().toUTCString(),
|
LastTouched: new Date().toUTCString(),
|
||||||
|
|
@ -48,14 +45,14 @@ export function getFunnelCookie() {
|
||||||
Removes cookie from browser.
|
Removes cookie from browser.
|
||||||
*/
|
*/
|
||||||
export function deleteFunnelCookie() {
|
export function deleteFunnelCookie() {
|
||||||
document.cookie = `${cookieNames.FUNNEL_SESSION_INFO}=; Max-Age=0; path=${applicationConfig.COOKIE_PATH}; ${getCookieDomainValue()}`;
|
createOrUpdateCookie(cookieNames.FUNNEL_SESSION_INFO, undefined, { maxAge: 0 });
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Gets cookie domain value. Localhost will be empty "".
|
Gets cookie domain value. Localhost will be empty "".
|
||||||
*/
|
*/
|
||||||
export function getCookieDomainValue() {
|
export function getCookieDomainValue() {
|
||||||
return location.hostname.includes("localhost") ? "" : `domain=${getDomainWithoutSubdomain()};`;
|
return isLocalhost() ? "" : `domain=${getDomainWithoutSubdomain()};`;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -106,10 +103,17 @@ export function getSessionIdValue(){
|
||||||
return '00000000-0000-0000-0000-000000000000';
|
return '00000000-0000-0000-0000-000000000000';
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setCookieProperties(properties) {
|
/*
|
||||||
|
Updates session ID cookie with new expiration date
|
||||||
|
*/
|
||||||
|
export function updateSessionIdCookie() {
|
||||||
|
createOrUpdateCookie(cookieNames.SESSION_ID, getSessionIdValue(), { maxAge: 60 * 30 });
|
||||||
|
}
|
||||||
|
|
||||||
|
export function setCookieProperties(properties, { useDefaultFunnelCookieAttributes = true, maxAge, isSecure }) {
|
||||||
if (typeof properties == "object") {
|
if (typeof properties == "object") {
|
||||||
Object.keys(properties).forEach(key => {
|
Object.keys(properties).forEach(key => {
|
||||||
document.cookie = `${key}=${properties[key]}`;
|
createOrUpdateCookie(key, properties[key], { useDefaultFunnelCookieAttributes, maxAge, isSecure });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -134,19 +138,38 @@ function setFunnelCookieProperties(properties) {
|
||||||
cookie[key] = properties[key];
|
cookie[key] = properties[key];
|
||||||
});
|
});
|
||||||
|
|
||||||
const cookieValueJson = JSON.stringify(cookie);
|
const cookieValueJson = JSON.stringify(cookie);
|
||||||
|
createOrUpdateCookie(cookieNames.FUNNEL_SESSION_INFO, cookieValueJson, {});
|
||||||
document.cookie = `${cookieNames.FUNNEL_SESSION_INFO}=${cookieValueJson}; path=${applicationConfig.COOKIE_PATH}; ${getCookieDomainValue()}`;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Used to create a cookie.
|
||||||
|
`useDefaultFunnelCookieAttributes` will set the path and domain to our defaults
|
||||||
|
*/
|
||||||
|
function createOrUpdateCookie(key, value = "", { useDefaultFunnelCookieAttributes = true, maxAge, isSecure = true }) {
|
||||||
|
let cookieToAdd = `${key}=${value}; `;
|
||||||
|
|
||||||
|
if (useDefaultFunnelCookieAttributes) {
|
||||||
|
cookieToAdd += `path=${applicationConfig.COOKIE_PATH}; ${getCookieDomainValue()} `;
|
||||||
|
}
|
||||||
|
if (isSecure && !isLocalhost()) {
|
||||||
|
cookieToAdd += `secure; `;
|
||||||
|
}
|
||||||
|
if (!isNaN(maxAge)) {
|
||||||
|
cookieToAdd += `max-age=${maxAge};`;
|
||||||
|
}
|
||||||
|
|
||||||
|
document.cookie = cookieToAdd;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Gets current domain without the subdomain for cookie.
|
Gets current domain without the subdomain for cookie.
|
||||||
*/
|
*/
|
||||||
function getDomainWithoutSubdomain() {
|
function getDomainWithoutSubdomain() {
|
||||||
let url = location.hostname;
|
let url = location.hostname;
|
||||||
if (url.includes("localhost")) {
|
if (isLocalhost()) {
|
||||||
return "localhost";
|
return "localhost";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -169,4 +192,8 @@ function getCookieValueByName(name) {
|
||||||
return parts.pop().split(";").shift();
|
return parts.pop().split(";").shift();
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
function isLocalhost() {
|
||||||
|
return location.hostname.includes("localhost");
|
||||||
}
|
}
|
||||||
|
|
@ -16,7 +16,7 @@ export async function getPageToRouteExistingOrderTo(toRoute = {}, existingHerita
|
||||||
if (toRoute.query[queryStrings.START_TYPE] === 'fmg') {
|
if (toRoute.query[queryStrings.START_TYPE] === 'fmg') {
|
||||||
// If they have an existing order, return 'heritage' for the page name.
|
// If they have an existing order, return 'heritage' for the page name.
|
||||||
if (existingHeritageOrder) {
|
if (existingHeritageOrder) {
|
||||||
return 'heritage';
|
return fmgPageValues.HERITAGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return await getLatestPageForRedirection();
|
return await getLatestPageForRedirection();
|
||||||
|
|
@ -61,11 +61,16 @@ async function getLatestPageForRedirection() {
|
||||||
// If this is a non-CTA navigation, determine where to send the user based on page prerequisites.
|
// If this is a non-CTA navigation, determine where to send the user based on page prerequisites.
|
||||||
// This also works if a user has a 'fmg' start_type query string but no current order.
|
// This also works if a user has a 'fmg' start_type query string but no current order.
|
||||||
// That shouldn't happen, but it's possible.
|
// That shouldn't happen, but it's possible.
|
||||||
const vehicleMakeComponent = (await lazyLoadComponent('vehicle-make')()).default;
|
const vehicleMakeComponent = await getLazyLoadedComponent(fmgPageValues.VEHICLE_MAKE);
|
||||||
const vehicleModelComponent = (await lazyLoadComponent('vehicle-model')()).default;
|
const vehicleModelComponent = await getLazyLoadedComponent(fmgPageValues.VEHICLE_MODEL);
|
||||||
const vehicleStyleComponent = (await lazyLoadComponent('vehicle-style')()).default;
|
const vehicleStyleComponent = await getLazyLoadedComponent(fmgPageValues.VEHICLE_STYLE);
|
||||||
const vehicleDamageComponent = (await lazyLoadComponent('vehicle-damage')()).default;
|
const vehicleDamageComponent = await getLazyLoadedComponent(fmgPageValues.VEHICLE_DAMAGE);
|
||||||
|
const estimateComponent = await getLazyLoadedComponent(fmgPageValues.ESTIMATE);
|
||||||
|
const vinLookupComponent = await getLazyLoadedComponent(fmgPageValues.VIN_LOOKUP);
|
||||||
|
const partQuestionsComponent = await getLazyLoadedComponent(fmgPageValues.PART_QUESTIONS);
|
||||||
|
const vehiclePartsComponent = await getLazyLoadedComponent(fmgPageValues.VEHICLE_PARTS);
|
||||||
|
const moldingQuestionsComponent = await getLazyLoadedComponent(fmgPageValues.MOLDING_QUESTIONS);
|
||||||
|
const capabilityQuestionsComponent = await getLazyLoadedComponent(fmgPageValues.CAPABILITY_QUESTIONS);
|
||||||
|
|
||||||
if (!vehicleMakeComponent.methods.arePagePrerequisitesValid()) {
|
if (!vehicleMakeComponent.methods.arePagePrerequisitesValid()) {
|
||||||
return fmgPageValues.VEHICLE_YEAR;
|
return fmgPageValues.VEHICLE_YEAR;
|
||||||
|
|
@ -75,15 +80,28 @@ async function getLatestPageForRedirection() {
|
||||||
return fmgPageValues.VEHICLE_MODEL;
|
return fmgPageValues.VEHICLE_MODEL;
|
||||||
} else if (!vehicleDamageComponent.methods.arePagePrerequisitesValid()) {
|
} else if (!vehicleDamageComponent.methods.arePagePrerequisitesValid()) {
|
||||||
return fmgPageValues.VEHICLE_STYLE;
|
return fmgPageValues.VEHICLE_STYLE;
|
||||||
} else if (store.getters.damage.isRepair == null || !store.getters.vehicle.carId) {
|
} else if (!estimateComponent.methods.arePagePrerequisitesValid()) {
|
||||||
return fmgPageValues.VEHICLE_DAMAGE;
|
return fmgPageValues.VEHICLE_DAMAGE;
|
||||||
} else {
|
} else {
|
||||||
if (store.getters.vehicle.vin) {
|
if (capabilityQuestionsComponent.methods.arePagePrerequisitesValid()) {
|
||||||
|
return fmgPageValues.CAPABILITY_QUESTIONS;
|
||||||
|
}
|
||||||
|
else if (moldingQuestionsComponent.methods.arePagePrerequisitesValid()) {
|
||||||
|
return fmgPageValues.MOLDING_QUESTIONS;
|
||||||
|
}
|
||||||
|
else if (vehiclePartsComponent.methods.arePagePrerequisitesValid()) {
|
||||||
|
return fmgPageValues.VEHICLE_PARTS;
|
||||||
|
}
|
||||||
|
else if (partQuestionsComponent.methods.arePagePrerequisitesValid()) {
|
||||||
|
return fmgPageValues.PART_QUESTIONS;
|
||||||
|
}
|
||||||
|
else if (vinLookupComponent.methods.arePagePrerequisitesValid()) {
|
||||||
return fmgPageValues.VIN_LOOKUP;
|
return fmgPageValues.VIN_LOOKUP;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
return fmgPageValues.ESTIMATE;
|
return fmgPageValues.ESTIMATE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -126,4 +144,8 @@ function isVinRelatedPage(toRoute) {
|
||||||
fmgPageValue === fmgPageValues.ADDRESS_LOOKUP ||
|
fmgPageValue === fmgPageValues.ADDRESS_LOOKUP ||
|
||||||
fmgPageValue === fmgPageValues.ADDRESS_VEHICLES ||
|
fmgPageValue === fmgPageValues.ADDRESS_VEHICLES ||
|
||||||
fmgPageValue === fmgPageValues.ESTIMATE;
|
fmgPageValue === fmgPageValues.ESTIMATE;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getLazyLoadedComponent(pageName) {
|
||||||
|
return (await lazyLoadComponent(pageName)()).default;
|
||||||
}
|
}
|
||||||
|
|
@ -5,6 +5,7 @@ import { storeActions } from "@/constants/store-actions";
|
||||||
import { setupMocksForJsFiles, getMockOrderInfo } from "@/helpers/unit-test-helper.js";
|
import { setupMocksForJsFiles, getMockOrderInfo } from "@/helpers/unit-test-helper.js";
|
||||||
import { externalUrls } from "@/router/router-constants/externalUrl-values";
|
import { externalUrls } from "@/router/router-constants/externalUrl-values";
|
||||||
import { queryStrings } from "@/constants/query-strings";
|
import { queryStrings } from "@/constants/query-strings";
|
||||||
|
import { fmgPageValues } from "@/router/router-constants/fmgPage-values";
|
||||||
|
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
import router from "@/router";
|
import router from "@/router";
|
||||||
|
|
@ -15,278 +16,269 @@ jest.mock("@/router/dynamic-routing/component-loader.js", () => ({
|
||||||
}));
|
}));
|
||||||
|
|
||||||
describe("getPageToRouteExistingOrderTo", () => {
|
describe("getPageToRouteExistingOrderTo", () => {
|
||||||
|
test("should return vehicle-year", async () => {
|
||||||
test("getPageToRouteExistingOrderTo, should return vehicle-year", async () => {
|
|
||||||
// Arrange
|
// Arrange
|
||||||
const toRoute = {
|
const toRoute = {
|
||||||
query: {}
|
query: {}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Mock out the lazy load calls for all components.
|
// Mock out the lazy load calls for all components.
|
||||||
lazyLoadComponent
|
mockLazyLoadComponentReturnValues({
|
||||||
.mockReturnValueOnce(() => {
|
[fmgPageValues.VEHICLE_MAKE]: false
|
||||||
return {
|
})
|
||||||
default: {
|
|
||||||
methods: {
|
|
||||||
arePagePrerequisitesValid: jest.fn().mockReturnValueOnce(false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.mockReturnValueOnce(() => {
|
|
||||||
return {
|
|
||||||
default: {
|
|
||||||
methods: {
|
|
||||||
arePagePrerequisitesValid: jest.fn().mockReturnValueOnce(false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.mockReturnValueOnce(() => {
|
|
||||||
return {
|
|
||||||
default: {
|
|
||||||
methods: {
|
|
||||||
arePagePrerequisitesValid: jest.fn().mockReturnValueOnce(false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.mockReturnValueOnce(() => {
|
|
||||||
return {
|
|
||||||
default: {
|
|
||||||
methods: {
|
|
||||||
arePagePrerequisitesValid: jest.fn().mockReturnValueOnce(false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const result = await getPageToRouteExistingOrderTo(toRoute, false);
|
const result = await getPageToRouteExistingOrderTo(toRoute, false);
|
||||||
|
|
||||||
//Assert
|
//Assert
|
||||||
expect(result).toBe('vehicle-year');
|
expect(result).toBe(fmgPageValues.VEHICLE_YEAR);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("getPageToRouteExistingOrderTo, should return vehicle-model", async () => {
|
test("should return vehicle-make", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const toRoute = {
|
const toRoute = {
|
||||||
query: {}
|
query: {}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Mock out the lazy load calls for all components.
|
// Mock out the lazy load calls for all components.
|
||||||
lazyLoadComponent
|
mockLazyLoadComponentReturnValues({
|
||||||
.mockReturnValueOnce(() => {
|
[fmgPageValues.VEHICLE_MAKE]: true,
|
||||||
return {
|
[fmgPageValues.VEHICLE_MODEL]: false
|
||||||
default: {
|
})
|
||||||
methods: {
|
|
||||||
arePagePrerequisitesValid: jest.fn().mockReturnValueOnce(true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.mockReturnValueOnce(() => {
|
|
||||||
return {
|
|
||||||
default: {
|
|
||||||
methods: {
|
|
||||||
arePagePrerequisitesValid: jest.fn().mockReturnValueOnce(true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.mockReturnValueOnce(() => {
|
|
||||||
return {
|
|
||||||
default: {
|
|
||||||
methods: {
|
|
||||||
arePagePrerequisitesValid: jest.fn().mockReturnValueOnce(false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.mockReturnValueOnce(() => {
|
|
||||||
return {
|
|
||||||
default: {
|
|
||||||
methods: {
|
|
||||||
arePagePrerequisitesValid: jest.fn().mockReturnValueOnce(false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const result = await getPageToRouteExistingOrderTo(toRoute, false);
|
const result = await getPageToRouteExistingOrderTo(toRoute, false);
|
||||||
|
|
||||||
//Assert
|
//Assert
|
||||||
expect(result).toBe('vehicle-model');
|
expect(result).toBe(fmgPageValues.VEHICLE_MAKE);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("getPageToRouteExistingOrderTo, should return vehicle-damage", async () => {
|
test("should return vehicle-model", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const toRoute = {
|
const toRoute = {
|
||||||
query: {}
|
query: {}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Mock out the lazy load calls for all components.
|
// Mock out the lazy load calls for all components.
|
||||||
lazyLoadComponent
|
mockLazyLoadComponentReturnValues({
|
||||||
.mockReturnValueOnce(() => {
|
[fmgPageValues.VEHICLE_MAKE]: true,
|
||||||
return {
|
[fmgPageValues.VEHICLE_MODEL]: true,
|
||||||
default: {
|
[fmgPageValues.VEHICLE_STYLE]: false,
|
||||||
methods: {
|
})
|
||||||
arePagePrerequisitesValid: jest.fn().mockReturnValueOnce(true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.mockReturnValueOnce(() => {
|
|
||||||
return {
|
|
||||||
default: {
|
|
||||||
methods: {
|
|
||||||
arePagePrerequisitesValid: jest.fn().mockReturnValueOnce(true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.mockReturnValueOnce(() => {
|
|
||||||
return {
|
|
||||||
default: {
|
|
||||||
methods: {
|
|
||||||
arePagePrerequisitesValid: jest.fn().mockReturnValueOnce(true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.mockReturnValueOnce(() => {
|
|
||||||
return {
|
|
||||||
default: {
|
|
||||||
methods: {
|
|
||||||
arePagePrerequisitesValid: jest.fn().mockReturnValueOnce(true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
store.getters.damage.isRepair = undefined;
|
|
||||||
store.getters.vehicle.carId = 'C00000';
|
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const result = await getPageToRouteExistingOrderTo(toRoute, false);
|
const result = await getPageToRouteExistingOrderTo(toRoute, false);
|
||||||
|
|
||||||
//Assert
|
//Assert
|
||||||
expect(result).toBe('vehicle-damage');
|
expect(result).toBe(fmgPageValues.VEHICLE_MODEL);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("getPageToRouteExistingOrderTo, should return vin-lookup", async () => {
|
test("should return vehicle-style", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const toRoute = {
|
const toRoute = {
|
||||||
query: {}
|
query: {}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Mock out the lazy load calls for all components.
|
// Mock out the lazy load calls for all components.
|
||||||
lazyLoadComponent
|
mockLazyLoadComponentReturnValues({
|
||||||
.mockReturnValueOnce(() => {
|
[fmgPageValues.VEHICLE_MAKE]: true,
|
||||||
return {
|
[fmgPageValues.VEHICLE_MODEL]: true,
|
||||||
default: {
|
[fmgPageValues.VEHICLE_STYLE]: true,
|
||||||
methods: {
|
[fmgPageValues.VEHICLE_DAMAGE]: false,
|
||||||
arePagePrerequisitesValid: jest.fn().mockReturnValueOnce(true)
|
})
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.mockReturnValueOnce(() => {
|
|
||||||
return {
|
|
||||||
default: {
|
|
||||||
methods: {
|
|
||||||
arePagePrerequisitesValid: jest.fn().mockReturnValueOnce(true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.mockReturnValueOnce(() => {
|
|
||||||
return {
|
|
||||||
default: {
|
|
||||||
methods: {
|
|
||||||
arePagePrerequisitesValid: jest.fn().mockReturnValueOnce(true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.mockReturnValueOnce(() => {
|
|
||||||
return {
|
|
||||||
default: {
|
|
||||||
methods: {
|
|
||||||
arePagePrerequisitesValid: jest.fn().mockReturnValueOnce(true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
store.getters.damage.isRepair = true;
|
|
||||||
store.getters.vehicle.carId = 'C00000';
|
|
||||||
store.getters.vehicle.vin = "1FADP3F26DL212886"
|
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const result = await getPageToRouteExistingOrderTo(toRoute, false);
|
const result = await getPageToRouteExistingOrderTo(toRoute, false);
|
||||||
|
|
||||||
//Assert
|
//Assert
|
||||||
expect(result).toBe('vin-lookup');
|
expect(result).toBe(fmgPageValues.VEHICLE_STYLE);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("getPageToRouteExistingOrderTo, should return estimate", async () => {
|
test("should return vehicle-damage", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const toRoute = {
|
const toRoute = {
|
||||||
query: {}
|
query: {}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Mock out the lazy load calls for all components.
|
// Mock out the lazy load calls for all components.
|
||||||
lazyLoadComponent
|
mockLazyLoadComponentReturnValues({
|
||||||
.mockReturnValueOnce(() => {
|
[fmgPageValues.VEHICLE_MAKE]: true,
|
||||||
return {
|
[fmgPageValues.VEHICLE_MODEL]: true,
|
||||||
default: {
|
[fmgPageValues.VEHICLE_STYLE]: true,
|
||||||
methods: {
|
[fmgPageValues.VEHICLE_DAMAGE]: true,
|
||||||
arePagePrerequisitesValid: jest.fn().mockReturnValueOnce(true)
|
[fmgPageValues.ESTIMATE]: false
|
||||||
}
|
})
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.mockReturnValueOnce(() => {
|
|
||||||
return {
|
|
||||||
default: {
|
|
||||||
methods: {
|
|
||||||
arePagePrerequisitesValid: jest.fn().mockReturnValueOnce(true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.mockReturnValueOnce(() => {
|
|
||||||
return {
|
|
||||||
default: {
|
|
||||||
methods: {
|
|
||||||
arePagePrerequisitesValid: jest.fn().mockReturnValueOnce(true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.mockReturnValueOnce(() => {
|
|
||||||
return {
|
|
||||||
default: {
|
|
||||||
methods: {
|
|
||||||
arePagePrerequisitesValid: jest.fn().mockReturnValueOnce(true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
store.getters.damage.isRepair = true;
|
|
||||||
store.getters.vehicle.carId = 'C00000';
|
|
||||||
store.getters.vehicle.vin = null;
|
|
||||||
// Act
|
// Act
|
||||||
const result = await getPageToRouteExistingOrderTo(toRoute, false);
|
const result = await getPageToRouteExistingOrderTo(toRoute, false);
|
||||||
|
|
||||||
//Assert
|
//Assert
|
||||||
expect(result).toBe('estimate');
|
expect(result).toBe(fmgPageValues.VEHICLE_DAMAGE);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("getPageToRouteExistingOrderTo, existing order, should return heritage", async () => {
|
test("user has YMMS and no vehicle questions > should return vin-lookup", async () => {
|
||||||
|
// Arrange
|
||||||
|
const toRoute = {
|
||||||
|
query: {}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Mock out the lazy load calls for all components.
|
||||||
|
mockLazyLoadComponentReturnValues({
|
||||||
|
[fmgPageValues.VEHICLE_MAKE]: true,
|
||||||
|
[fmgPageValues.VEHICLE_MODEL]: true,
|
||||||
|
[fmgPageValues.VEHICLE_STYLE]: true,
|
||||||
|
[fmgPageValues.VEHICLE_DAMAGE]: true,
|
||||||
|
[fmgPageValues.ESTIMATE]: true,
|
||||||
|
[fmgPageValues.CAPABILITY_QUESTIONS]: false,
|
||||||
|
[fmgPageValues.MOLDING_QUESTIONS]: false,
|
||||||
|
[fmgPageValues.VEHICLE_PARTS]: false,
|
||||||
|
[fmgPageValues.PART_QUESTIONS]: false,
|
||||||
|
[fmgPageValues.VIN_LOOKUP]: true,
|
||||||
|
})
|
||||||
|
|
||||||
|
// Act
|
||||||
|
const result = await getPageToRouteExistingOrderTo(toRoute, false);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
expect(result).toBe(fmgPageValues.VIN_LOOKUP);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("user has YMMS but no questions or carId > should return estimate", async () => {
|
||||||
|
// Arrange
|
||||||
|
const toRoute = {
|
||||||
|
query: {}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Mock out the lazy load calls for all components.
|
||||||
|
mockLazyLoadComponentReturnValues({
|
||||||
|
[fmgPageValues.VEHICLE_MAKE]: true,
|
||||||
|
[fmgPageValues.VEHICLE_MODEL]: true,
|
||||||
|
[fmgPageValues.VEHICLE_STYLE]: true,
|
||||||
|
[fmgPageValues.VEHICLE_DAMAGE]: true,
|
||||||
|
[fmgPageValues.ESTIMATE]: true,
|
||||||
|
[fmgPageValues.CAPABILITY_QUESTIONS]: false,
|
||||||
|
[fmgPageValues.MOLDING_QUESTIONS]: false,
|
||||||
|
[fmgPageValues.VEHICLE_PARTS]: false,
|
||||||
|
[fmgPageValues.PART_QUESTIONS]: false,
|
||||||
|
[fmgPageValues.VIN_LOOKUP]: false,
|
||||||
|
})
|
||||||
|
|
||||||
|
// Act
|
||||||
|
const result = await getPageToRouteExistingOrderTo(toRoute, false);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
expect(result).toBe(fmgPageValues.ESTIMATE);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("user has capability questions and molding questions > should return capability questions", async () => {
|
||||||
|
// Arrange
|
||||||
|
const toRoute = {
|
||||||
|
query: {}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Mock out the lazy load calls for all components.
|
||||||
|
mockLazyLoadComponentReturnValues({
|
||||||
|
[fmgPageValues.VEHICLE_MAKE]: true,
|
||||||
|
[fmgPageValues.VEHICLE_MODEL]: true,
|
||||||
|
[fmgPageValues.VEHICLE_STYLE]: true,
|
||||||
|
[fmgPageValues.VEHICLE_DAMAGE]: true,
|
||||||
|
[fmgPageValues.ESTIMATE]: true,
|
||||||
|
[fmgPageValues.CAPABILITY_QUESTIONS]: true,
|
||||||
|
[fmgPageValues.MOLDING_QUESTIONS]: true,
|
||||||
|
[fmgPageValues.VEHICLE_PARTS]: false,
|
||||||
|
[fmgPageValues.PART_QUESTIONS]: false,
|
||||||
|
[fmgPageValues.VIN_LOOKUP]: false,
|
||||||
|
})
|
||||||
|
|
||||||
|
// Act
|
||||||
|
const result = await getPageToRouteExistingOrderTo(toRoute, false);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
expect(result).toBe(fmgPageValues.CAPABILITY_QUESTIONS);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("user has molding questions and part questions > should return molding questions", async () => {
|
||||||
|
// Arrange
|
||||||
|
const toRoute = {
|
||||||
|
query: {}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Mock out the lazy load calls for all components.
|
||||||
|
mockLazyLoadComponentReturnValues({
|
||||||
|
[fmgPageValues.VEHICLE_MAKE]: true,
|
||||||
|
[fmgPageValues.VEHICLE_MODEL]: true,
|
||||||
|
[fmgPageValues.VEHICLE_STYLE]: true,
|
||||||
|
[fmgPageValues.VEHICLE_DAMAGE]: true,
|
||||||
|
[fmgPageValues.ESTIMATE]: true,
|
||||||
|
[fmgPageValues.CAPABILITY_QUESTIONS]: false,
|
||||||
|
[fmgPageValues.MOLDING_QUESTIONS]: true,
|
||||||
|
[fmgPageValues.VEHICLE_PARTS]: false,
|
||||||
|
[fmgPageValues.PART_QUESTIONS]: true,
|
||||||
|
[fmgPageValues.VIN_LOOKUP]: false,
|
||||||
|
})
|
||||||
|
|
||||||
|
// Act
|
||||||
|
const result = await getPageToRouteExistingOrderTo(toRoute, false);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
expect(result).toBe(fmgPageValues.MOLDING_QUESTIONS);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("user has vehicle parts questions > should return vehicle-parts", async () => {
|
||||||
|
// Arrange
|
||||||
|
const toRoute = {
|
||||||
|
query: {}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Mock out the lazy load calls for all components.
|
||||||
|
mockLazyLoadComponentReturnValues({
|
||||||
|
[fmgPageValues.VEHICLE_MAKE]: true,
|
||||||
|
[fmgPageValues.VEHICLE_MODEL]: true,
|
||||||
|
[fmgPageValues.VEHICLE_STYLE]: true,
|
||||||
|
[fmgPageValues.VEHICLE_DAMAGE]: true,
|
||||||
|
[fmgPageValues.ESTIMATE]: true,
|
||||||
|
[fmgPageValues.CAPABILITY_QUESTIONS]: false,
|
||||||
|
[fmgPageValues.MOLDING_QUESTIONS]: false,
|
||||||
|
[fmgPageValues.VEHICLE_PARTS]: true,
|
||||||
|
[fmgPageValues.PART_QUESTIONS]: true,
|
||||||
|
[fmgPageValues.VIN_LOOKUP]: false,
|
||||||
|
})
|
||||||
|
|
||||||
|
// Act
|
||||||
|
const result = await getPageToRouteExistingOrderTo(toRoute, false);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
expect(result).toBe(fmgPageValues.VEHICLE_PARTS);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("user has part questions > should return part-questions", async () => {
|
||||||
|
// Arrange
|
||||||
|
const toRoute = {
|
||||||
|
query: {}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Mock out the lazy load calls for all components.
|
||||||
|
mockLazyLoadComponentReturnValues({
|
||||||
|
[fmgPageValues.VEHICLE_MAKE]: true,
|
||||||
|
[fmgPageValues.VEHICLE_MODEL]: true,
|
||||||
|
[fmgPageValues.VEHICLE_STYLE]: true,
|
||||||
|
[fmgPageValues.VEHICLE_DAMAGE]: true,
|
||||||
|
[fmgPageValues.ESTIMATE]: true,
|
||||||
|
[fmgPageValues.CAPABILITY_QUESTIONS]: false,
|
||||||
|
[fmgPageValues.MOLDING_QUESTIONS]: false,
|
||||||
|
[fmgPageValues.VEHICLE_PARTS]: false,
|
||||||
|
[fmgPageValues.PART_QUESTIONS]: true,
|
||||||
|
[fmgPageValues.VIN_LOOKUP]: false,
|
||||||
|
})
|
||||||
|
|
||||||
|
// Act
|
||||||
|
const result = await getPageToRouteExistingOrderTo(toRoute, false);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
expect(result).toBe(fmgPageValues.PART_QUESTIONS);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("existing order > should return heritage", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const toRoute = {
|
const toRoute = {
|
||||||
query: {
|
query: {
|
||||||
|
|
@ -298,7 +290,7 @@ describe("getPageToRouteExistingOrderTo", () => {
|
||||||
const result = await getPageToRouteExistingOrderTo(toRoute, true);
|
const result = await getPageToRouteExistingOrderTo(toRoute, true);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(result).toBe("heritage");
|
expect(result).toBe(fmgPageValues.HERITAGE);
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -401,4 +393,22 @@ describe("navigateToHeritageFunnel", () => {
|
||||||
expect(router.navigateToExternalUrl).toHaveBeenCalled();
|
expect(router.navigateToExternalUrl).toHaveBeenCalled();
|
||||||
saveOrderFunction.mockRestore();
|
saveOrderFunction.mockRestore();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* `arePagePrerequisitesValidObject` is an object where the keys are fmgPageValue names and the values are booleans that indicate
|
||||||
|
* whether arePagePrerequisitesValid is true or false
|
||||||
|
*/
|
||||||
|
function mockLazyLoadComponentReturnValues(arePagePrerequisitesValidObject = {}) {
|
||||||
|
lazyLoadComponent.mockImplementation((pageName) => {
|
||||||
|
return async () => {
|
||||||
|
return Promise.resolve({
|
||||||
|
default: {
|
||||||
|
methods: {
|
||||||
|
arePagePrerequisitesValid: jest.fn().mockReturnValueOnce(arePagePrerequisitesValidObject[pageName])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,16 +31,12 @@ export function isSavedSessionStillActive() {
|
||||||
const savedSessionTimeStamp = new Date(getFunnelCookie().SavedSessionTimeoutDate);
|
const savedSessionTimeStamp = new Date(getFunnelCookie().SavedSessionTimeoutDate);
|
||||||
const isSavedSessionTimedOut = (new Date(new Date().toUTCString()) > savedSessionTimeStamp);
|
const isSavedSessionTimedOut = (new Date(new Date().toUTCString()) > savedSessionTimeStamp);
|
||||||
|
|
||||||
if (isSavedSessionTimedOut) {
|
return !isSavedSessionTimedOut;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Function to get the date for the saved session timeout.
|
Function to calculate the date for the saved session timeout.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export function getDateForSavedSessionTimeout() {
|
export function getDateForSavedSessionTimeout() {
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import { fmgPageValues } from "@/router/router-constants/fmgPage-values";
|
||||||
import { cookieNames } from "@/constants/cookie-names";
|
import { cookieNames } from "@/constants/cookie-names";
|
||||||
import { Form } from "vee-validate";
|
import { Form } from "vee-validate";
|
||||||
import baseMixin from "@/mixins/base-mixin";
|
import baseMixin from "@/mixins/base-mixin";
|
||||||
import { getCookieDomainValue } from "@/helpers/heritage-integration/cookie-helper";
|
import { getCookieDomainValue, setCookieProperties } from "@/helpers/heritage-integration/cookie-helper";
|
||||||
import { analyticsPageEvents, GaCategories, GaActions, GaLabels, GaEvents, ValueToLogTypes } from "@/constants/analytics";
|
import { analyticsPageEvents, GaCategories, GaActions, GaLabels, GaEvents, ValueToLogTypes } from "@/constants/analytics";
|
||||||
import { queryStrings } from "@/constants/query-strings";
|
import { queryStrings } from "@/constants/query-strings";
|
||||||
import { routerParams } from "@/router/router-constants/router-params";
|
import { routerParams } from "@/router/router-constants/router-params";
|
||||||
|
|
@ -106,7 +106,7 @@ export function setupCookies({ funnelCookieValue = "", includeHeritageCookie = t
|
||||||
Object.keys(cookies).forEach(key => {
|
Object.keys(cookies).forEach(key => {
|
||||||
const cookieValue = key == cookieNames.FUNNEL_SESSION_INFO ? funnelCookieValue : cookies[key];
|
const cookieValue = key == cookieNames.FUNNEL_SESSION_INFO ? funnelCookieValue : cookies[key];
|
||||||
if (includeHeritageCookie || key != cookieNames.FUNNEL_SESSION_INFO)
|
if (includeHeritageCookie || key != cookieNames.FUNNEL_SESSION_INFO)
|
||||||
document.cookie = `${key}=${cookieValue}; path=/; ${getCookieDomainValue()}`;
|
setCookieProperties({ [key]: cookieValue }, { isSecure: false });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
arePagePrerequisitesValid() {
|
arePagePrerequisitesValid() {
|
||||||
return true; // TODO - DO TRUE TEST OF PAGEDATA
|
return false; // TODO - DO TRUE TEST OF PAGEDATA
|
||||||
// return Object.keys(store.getters.pageData(fmgPageValues.CAPABILITY_QUESTIONS)).length > 0;
|
// return Object.keys(store.getters.pageData(fmgPageValues.CAPABILITY_QUESTIONS)).length > 0;
|
||||||
},
|
},
|
||||||
showThisPartQuestionChain(part, i) {
|
showThisPartQuestionChain(part, i) {
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
arePagePrerequisitesValid() {
|
arePagePrerequisitesValid() {
|
||||||
if(store.getters.damage.isRepair!=null){
|
if(store.getters.damage.isRepair != null){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,7 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
arePagePrerequisitesValid() {
|
arePagePrerequisitesValid() {
|
||||||
return true; // TODO - DO TRUE TEST OF PAGEDATA
|
return false; // TODO - DO TRUE TEST OF PAGEDATA
|
||||||
// return Object.keys(store.getters.pageData(fmgPageValues.MOLDING_QUESTIONS)).length > 0;
|
// return Object.keys(store.getters.pageData(fmgPageValues.MOLDING_QUESTIONS)).length > 0;
|
||||||
},
|
},
|
||||||
showThisPartQuestionChain(part, i) {
|
showThisPartQuestionChain(part, i) {
|
||||||
|
|
|
||||||
|
|
@ -182,7 +182,8 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
arePagePrerequisitesValid() {
|
arePagePrerequisitesValid() {
|
||||||
return Object.keys(store.getters.pageData(fmgPageValues.PART_QUESTIONS)).length > 0;
|
const partQuestionsFromPageData = store.getters.pageData(fmgPageValues.PART_QUESTIONS);
|
||||||
|
return partQuestionsFromPageData && Object.keys(partQuestionsFromPageData).length > 0;
|
||||||
},
|
},
|
||||||
handleAnswerUpdates(key, answer) { // only runs when all questions in a question-chain have been answered
|
handleAnswerUpdates(key, answer) { // 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
|
||||||
|
|
|
||||||
|
|
@ -155,7 +155,7 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
arePagePrerequisitesValid() {
|
arePagePrerequisitesValid() {
|
||||||
if(store.getters.vehicle.carId){
|
if (store.getters.vehicle.carId) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ export default {
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
arePagePrerequisitesValid() {
|
arePagePrerequisitesValid() {
|
||||||
if (store.getters.vehicle.year){
|
if (store.getters.vehicle.year){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import { nextTick } from "vue";
|
||||||
import baseMixin from "@/mixins/base-mixin.js";
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
||||||
|
import { navigationScenarios } from "@/router/router-constants/navigation-scenarios";
|
||||||
|
|
||||||
// Mock our module for promises.
|
// Mock our module for promises.
|
||||||
jest.mock("@/helpers/layout-helper.js", () => ({
|
jest.mock("@/helpers/layout-helper.js", () => ({
|
||||||
|
|
@ -145,7 +146,7 @@ describe("vehicle-parts.vue", () => {
|
||||||
test("Initial data, should populate this.glassParts", async () => {
|
test("Initial data, should populate this.glassParts", async () => {
|
||||||
|
|
||||||
//Arrange
|
//Arrange
|
||||||
store.getters.pageData.mockReturnValueOnce(basePartResponse);
|
store.getters.pageData.mockReturnValue(basePartResponse);
|
||||||
store.getters.lineItems = { glassParts: [{ partNumber: 'DB12209YPYNOEM' }] }
|
store.getters.lineItems = { glassParts: [{ partNumber: 'DB12209YPYNOEM' }] }
|
||||||
|
|
||||||
const { wrapper } = setupMocks({
|
const { wrapper } = setupMocks({
|
||||||
|
|
@ -178,12 +179,8 @@ describe("vehicle-parts.vue", () => {
|
||||||
expect(wrapper.vm.glassParts).toEqual({ "Rear-Stationary": { "Rear": ['DB12209YPYNOEM'] } });
|
expect(wrapper.vm.glassParts).toEqual({ "Rear-Stationary": { "Rear": ['DB12209YPYNOEM'] } });
|
||||||
});
|
});
|
||||||
|
|
||||||
test("BackButtonAction triggers a router.navigate change", async () => {
|
test("User had part questions > BackButtonAction triggers a router.navigate change with correct scenario", async () => {
|
||||||
|
|
||||||
//Arrange
|
//Arrange
|
||||||
store.getters.pageData.mockReturnValueOnce(basePartResponse);
|
|
||||||
store.getters.lineItems = { glassParts: null }
|
|
||||||
|
|
||||||
const { wrapper } = setupMocks({
|
const { wrapper } = setupMocks({
|
||||||
mountOptionsMockData: {
|
mountOptionsMockData: {
|
||||||
router: {
|
router: {
|
||||||
|
|
@ -196,7 +193,25 @@ describe("vehicle-parts.vue", () => {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
store: {
|
store: {
|
||||||
getters: store.getters
|
getters: {
|
||||||
|
pageData: () => {
|
||||||
|
return {
|
||||||
|
partsOrQuestions: [
|
||||||
|
{
|
||||||
|
glassName: "Stationary",
|
||||||
|
glassLocation: "Rear",
|
||||||
|
parts: null,
|
||||||
|
partQuestions: [{
|
||||||
|
testProperty: "some value"
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
lineItems: {
|
||||||
|
glassParts: null
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -212,7 +227,46 @@ describe("vehicle-parts.vue", () => {
|
||||||
wrapper.vm.backButtonAction();
|
wrapper.vm.backButtonAction();
|
||||||
|
|
||||||
//Assert
|
//Assert
|
||||||
expect(wrapper.vm.$router.navigate).toHaveBeenCalled();
|
expect(wrapper.vm.$router.navigate).toHaveBeenCalledWith(navigationScenarios.CLICKED_BACK_WITH_PART_QUESTION_ANSWERS, wrapper.vm.$route);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
test("User did not have part questions > BackButtonAction triggers a router.navigate change with correct scenario", async () => {
|
||||||
|
//Arrange
|
||||||
|
const { wrapper } = setupMocks({
|
||||||
|
mountOptionsMockData: {
|
||||||
|
router: {
|
||||||
|
navigate: jest.fn(),
|
||||||
|
navigate: jest.fn()
|
||||||
|
},
|
||||||
|
route: {
|
||||||
|
query: {
|
||||||
|
fmgPage: 'vehicle-parts',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
store: {
|
||||||
|
getters: {
|
||||||
|
pageData: () => basePartResponse,
|
||||||
|
lineItems: {
|
||||||
|
glassParts: null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//Act
|
||||||
|
vehicleParts.beforeRouteEnter.call(
|
||||||
|
wrapper.vm,
|
||||||
|
{ query: { fmgPage: "vehicle-parts" } },
|
||||||
|
undefined,
|
||||||
|
(c) => c(wrapper.vm)
|
||||||
|
);
|
||||||
|
|
||||||
|
wrapper.vm.backButtonAction();
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
expect(wrapper.vm.$router.navigate).toHaveBeenCalledWith(navigationScenarios.CLICKED_BACK_WITHOUT_PART_QUESTION_ANSWERS, wrapper.vm.$route);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,7 @@ import store from "@/store";
|
||||||
import { storeMutations } from "@/constants/store-mutations.js";
|
import { storeMutations } from "@/constants/store-mutations.js";
|
||||||
import vehicleQuestionsMixin from "@/mixins/vehicle-questions-mixin";
|
import vehicleQuestionsMixin from "@/mixins/vehicle-questions-mixin";
|
||||||
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
||||||
|
import { assertParenthesizedExpression } from "@babel/types";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "vehicle-parts",
|
name: "vehicle-parts",
|
||||||
|
|
@ -126,7 +127,7 @@ export default {
|
||||||
return {
|
return {
|
||||||
glassName: g.glassName,
|
glassName: g.glassName,
|
||||||
glassLocation: g.glassLocation,
|
glassLocation: g.glassLocation,
|
||||||
colorAnswers: g.parts.reduce((arr, p) => {
|
colorAnswers: g.parts?.reduce((arr, p) => {
|
||||||
arr.push({
|
arr.push({
|
||||||
ColorAnswerText: p.color,
|
ColorAnswerText: p.color,
|
||||||
FeatureAnswers: [
|
FeatureAnswers: [
|
||||||
|
|
@ -155,7 +156,7 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
arePagePrerequisitesValid() {
|
arePagePrerequisitesValid() {
|
||||||
// Check if isRepair is populated and if the pageData we need is here (Parts data)
|
// Check if isRepair is populated and if the pageData we need is here (Parts data)
|
||||||
return store.getters.damage.isRepair != null &&
|
return store.getters.damage.isRepair != null && store.getters.pageData(fmgPageValues.VEHICLE_PARTS) &&
|
||||||
Object.keys(store.getters.pageData(fmgPageValues.VEHICLE_PARTS)).length !== 0;
|
Object.keys(store.getters.pageData(fmgPageValues.VEHICLE_PARTS)).length !== 0;
|
||||||
},
|
},
|
||||||
backButtonAction() {
|
backButtonAction() {
|
||||||
|
|
@ -175,7 +176,6 @@ export default {
|
||||||
this.PartsFromApi.partsOrQuestions
|
this.PartsFromApi.partsOrQuestions
|
||||||
)) {
|
)) {
|
||||||
for (let [partKey, partValue] of Object.entries(value.parts)) {
|
for (let [partKey, partValue] of Object.entries(value.parts)) {
|
||||||
|
|
||||||
const currentPart = this.PartsFromApi.partsOrQuestions[key].parts[partKey];
|
const currentPart = this.PartsFromApi.partsOrQuestions[key].parts[partKey];
|
||||||
|
|
||||||
const isMatched = this.selectedGlassPartNumbers.some(
|
const isMatched = this.selectedGlassPartNumbers.some(
|
||||||
|
|
@ -184,9 +184,9 @@ export default {
|
||||||
|
|
||||||
if (isMatched) {
|
if (isMatched) {
|
||||||
matchedParts.push({
|
matchedParts.push({
|
||||||
"glassLocation": value.glassLocation,
|
glassLocation: value.glassLocation,
|
||||||
"glassName": value.glassName,
|
glassName: value.glassName,
|
||||||
"parts": [currentPart]
|
parts: [currentPart]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,15 @@ jest.mock("@/store", () => ({
|
||||||
vehicle: {
|
vehicle: {
|
||||||
model: "TL",
|
model: "TL",
|
||||||
},
|
},
|
||||||
|
applicationUser:{
|
||||||
|
pageData: {
|
||||||
|
"part-questions": null,
|
||||||
|
"vehicle-make": {},
|
||||||
|
"vehicle-model": {},
|
||||||
|
"vehicle-style": {},
|
||||||
|
"vehicle-damage": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,21 @@
|
||||||
<funnelHeader cmsWidgetName="FunnelHeaderWidget" />
|
<funnelHeader cmsWidgetName="FunnelHeaderWidget" />
|
||||||
<div class="select-car">
|
<div class="select-car">
|
||||||
<div class="select-car-form rounded text-center">
|
<div class="select-car-form rounded text-center">
|
||||||
<vehicleBanner cmsWidgetName="VehicleBannerWidget" displayGenericVehicleImage />
|
<vehicleBanner
|
||||||
|
cmsWidgetName="VehicleBannerWidget"
|
||||||
|
displayGenericVehicleImage
|
||||||
|
/>
|
||||||
<funnelSubHeader
|
<funnelSubHeader
|
||||||
cmsWidgetName="FunnelSubHeaderWidget"
|
cmsWidgetName="FunnelSubHeaderWidget"
|
||||||
:hasBackButton="true"
|
:hasBackButton="true"
|
||||||
@click-event="backButtonAction"
|
@click-event="backButtonAction"
|
||||||
/>
|
/>
|
||||||
<div class="fade-on-route-transition">
|
<div class="fade-on-route-transition">
|
||||||
<styleQuestion v-model="selectedStyle" ref="styleQuestion" cmsWidgetName="VehicleStyleQuestion" />
|
<styleQuestion
|
||||||
|
v-model="selectedStyle"
|
||||||
|
ref="styleQuestion"
|
||||||
|
cmsWidgetName="VehicleStyleQuestion"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -29,14 +36,19 @@ import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
||||||
import { settleAllPromises } from "@/helpers/layout-helper";
|
import { settleAllPromises } from "@/helpers/layout-helper";
|
||||||
import { storeActions } from "@/constants/store-actions";
|
import { storeActions } from "@/constants/store-actions";
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
|
import { storeMutations } from "@/constants/store-mutations";
|
||||||
|
import { fmgPageValues } from "@/router/router-constants/fmgPage-values";
|
||||||
|
import router from "@/router";
|
||||||
|
import { navigationScenarios } from "@/router/router-constants/navigation-scenarios";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "vehicle-style",
|
name: "vehicle-style",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
selectedStyle: null,
|
selectedStyle: null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {},
|
computed: {},
|
||||||
|
|
||||||
async beforeRouteEnter(to, from, next) {
|
async beforeRouteEnter(to, from, next) {
|
||||||
|
|
@ -58,14 +70,31 @@ export default {
|
||||||
];
|
];
|
||||||
|
|
||||||
const resultMap = await settleAllPromises(promiseResultMap);
|
const resultMap = await settleAllPromises(promiseResultMap);
|
||||||
|
const visitedVehicleDamage = JSON.stringify(store.getters.applicationUser.pageData).indexOf(fmgPageValues.VEHICLE_DAMAGE) < 0 ? false : true;
|
||||||
|
|
||||||
// Call the "next" function to complete the transition to this page.
|
// Call the "next" function to complete the transition to this page.
|
||||||
next((vm) => {
|
|
||||||
vm.setCmsContent(resultMap.cmsContent);
|
// If we have exactly one style then navigate directly to vehicle-damage
|
||||||
vm.$refs.styleQuestion.initializeComponent(
|
if(resultMap.styleQuestionInitialData.length === 1 && !visitedVehicleDamage) {
|
||||||
resultMap.styleQuestionInitialData
|
store.commit(storeMutations.UPDATE_STYLE, resultMap.styleQuestionInitialData[0]);
|
||||||
);
|
|
||||||
});
|
await store.dispatch(storeActions.SET_VEHICLE,
|
||||||
|
{
|
||||||
|
year: store.getters.vehicle.year,
|
||||||
|
make: store.getters.vehicle.make,
|
||||||
|
model: store.getters.vehicle.model,
|
||||||
|
style: store.getters.vehicle.style,
|
||||||
|
});
|
||||||
|
|
||||||
|
//emulate selecting the vehicle style
|
||||||
|
router.overrideNavigation(navigationScenarios.SELECTED_STYLE, to, next);
|
||||||
|
|
||||||
|
} else{
|
||||||
|
next( (vm) => {
|
||||||
|
vm.setCmsContent(resultMap.cmsContent);
|
||||||
|
vm.$refs.styleQuestion.initializeComponent(resultMap.styleQuestionInitialData)
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,11 @@ import store from "@/store";
|
||||||
jest.mock("@/store", () => ({
|
jest.mock("@/store", () => ({
|
||||||
commit: jest.fn(),
|
commit: jest.fn(),
|
||||||
dispatch: jest.fn(),
|
dispatch: jest.fn(),
|
||||||
|
getters: {
|
||||||
|
applicationUser: {
|
||||||
|
experiments: []
|
||||||
|
}
|
||||||
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// Mock our module for promises.
|
// Mock our module for promises.
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ import { settleAllPromises } from "@/helpers/layout-helper";
|
||||||
import { storeActions } from "@/constants/store-actions";
|
import { storeActions } from "@/constants/store-actions";
|
||||||
import { experimentUniverses } from "@/constants/experiments";
|
import { experimentUniverses } from "@/constants/experiments";
|
||||||
import { getDeviceIdValue, getSessionKeyValue } from "@/helpers/heritage-integration/cookie-helper";
|
import { getDeviceIdValue, getSessionKeyValue } from "@/helpers/heritage-integration/cookie-helper";
|
||||||
|
import store from "@/store";
|
||||||
|
|
||||||
import baseMixin from "@/mixins/base-mixin";
|
import baseMixin from "@/mixins/base-mixin";
|
||||||
|
|
||||||
|
|
@ -48,14 +49,19 @@ export default {
|
||||||
const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage);
|
const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage);
|
||||||
const yearQuestionInitialDataPromise = yearQuestion.methods.loadInitialData();
|
const yearQuestionInitialDataPromise = yearQuestion.methods.loadInitialData();
|
||||||
|
|
||||||
// Log experiment exposure
|
const experimentForLogging = store.getters.applicationUser.experiments.find(e => e.universeName === experimentUniverses.CONCEPT_FUNNEL);
|
||||||
const logExperimentExposurePromise = baseMixin.methods.dispatchStoreAction(storeActions.LOG_EXPERIMENT_EXPOSURE,
|
|
||||||
{
|
// If the concept funnel experiment is found, as it should be when coming from safelite.com, then log the experiment exposure.
|
||||||
userId: getDeviceIdValue(),
|
if (experimentForLogging !== undefined) {
|
||||||
sessionKey: getSessionKeyValue(),
|
// Log experiment exposure
|
||||||
pageName: to.query.fmgPage,
|
baseMixin.methods.dispatchStoreAction(storeActions.LOG_EXPERIMENT_EXPOSURE,
|
||||||
universeName: experimentUniverses.CONCEPT_FUNNEL
|
{
|
||||||
}, false);
|
userId: getDeviceIdValue(),
|
||||||
|
sessionKey: getSessionKeyValue(),
|
||||||
|
pageName: to.query.fmgPage,
|
||||||
|
experiment: experimentForLogging
|
||||||
|
}, false);
|
||||||
|
}
|
||||||
|
|
||||||
// Settle promises and get results
|
// Settle promises and get results
|
||||||
const promiseResultMap = [
|
const promiseResultMap = [
|
||||||
|
|
@ -67,10 +73,6 @@ export default {
|
||||||
resultKey: "yearQuestionInitialData",
|
resultKey: "yearQuestionInitialData",
|
||||||
promise: yearQuestionInitialDataPromise,
|
promise: yearQuestionInitialDataPromise,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
resultKey: "logExperimentExposure",
|
|
||||||
promise: logExperimentExposurePromise,
|
|
||||||
},
|
|
||||||
];
|
];
|
||||||
|
|
||||||
let resultMap = await settleAllPromises(promiseResultMap);
|
let resultMap = await settleAllPromises(promiseResultMap);
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import { queryStrings } from "@/constants/query-strings";
|
||||||
import { experimentSettings } from "@/constants/experiments";
|
import { experimentSettings } from "@/constants/experiments";
|
||||||
import { analyticsPageEvents, GaCategories, GaActions, GaLabels, GaEvents, ValueToLogTypes } from "@/constants/analytics";
|
import { analyticsPageEvents, GaCategories, GaActions, GaLabels, GaEvents, ValueToLogTypes } from "@/constants/analytics";
|
||||||
import { cookieNames } from "@/constants/cookie-names";
|
import { cookieNames } from "@/constants/cookie-names";
|
||||||
|
import store from "@/store";
|
||||||
|
|
||||||
import baseMixin from "@/mixins/base-mixin";
|
import baseMixin from "@/mixins/base-mixin";
|
||||||
|
|
||||||
|
|
@ -19,6 +20,7 @@ export default {
|
||||||
action: '',
|
action: '',
|
||||||
event: pageEvent,
|
event: pageEvent,
|
||||||
shouldUseSessionId: false,
|
shouldUseSessionId: false,
|
||||||
|
experimentsForUser: store.getters.applicationUser.experiments,
|
||||||
};
|
};
|
||||||
|
|
||||||
baseMixin.methods.dispatchStoreAction(storeActions.LOG_PAGE_VIEW, payload, false);
|
baseMixin.methods.dispatchStoreAction(storeActions.LOG_PAGE_VIEW, payload, false);
|
||||||
|
|
@ -37,6 +39,7 @@ export default {
|
||||||
label: label,
|
label: label,
|
||||||
value: value,
|
value: value,
|
||||||
shouldUseSessionId: false,
|
shouldUseSessionId: false,
|
||||||
|
experimentsForUser: store.getters.applicationUser.experiments
|
||||||
};
|
};
|
||||||
|
|
||||||
baseMixin.methods.dispatchStoreAction(storeActions.LOG_CUSTOM_EVENT, payload, false);
|
baseMixin.methods.dispatchStoreAction(storeActions.LOG_CUSTOM_EVENT, payload, false);
|
||||||
|
|
@ -57,7 +60,7 @@ export default {
|
||||||
pushToDataLayerIfDefined(eventToBePushed);
|
pushToDataLayerIfDefined(eventToBePushed);
|
||||||
|
|
||||||
if (pushToLogApp) {
|
if (pushToLogApp) {
|
||||||
this.logCustomEvent(category, action, labelToLog, undefined);
|
this.logCustomEvent(category, action, labelToLog, undefined);
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
@ -75,7 +78,8 @@ export default {
|
||||||
this.logPageView(analyticsPageEvents.ENTRY);
|
this.logPageView(analyticsPageEvents.ENTRY);
|
||||||
},
|
},
|
||||||
|
|
||||||
pushExperimentsToDataLayer(experiments) {
|
pushExperimentsToDataLayer() {
|
||||||
|
const experiments = store.getters.applicationUser.experiments;
|
||||||
experiments?.forEach(exp => {
|
experiments?.forEach(exp => {
|
||||||
|
|
||||||
// Set Google Dimension Index based on experiment settings.
|
// Set Google Dimension Index based on experiment settings.
|
||||||
|
|
@ -122,10 +126,14 @@ export default {
|
||||||
|
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
if (response.data.sessionKey && skey === 0) {
|
if (response.data.sessionKey && skey === 0) {
|
||||||
setCookieProperties({ [cookieNames.SESSION_KEY]: response.data.sessionKey});
|
setCookieProperties({ [cookieNames.SESSION_KEY]: response.data.sessionKey}, {
|
||||||
|
useDefaultFunnelCookieAttributes: false
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (response.data.sessionId && sid === '00000000-0000-0000-0000-000000000000') {
|
if (response.data.sessionId && sid === '00000000-0000-0000-0000-000000000000') {
|
||||||
setCookieProperties({ [cookieNames.SESSION_ID]: response.data.sessionId});
|
setCookieProperties({ [cookieNames.SESSION_ID]: response.data.sessionId}, {
|
||||||
|
maxAge: 60 * 30 // 30 minutes
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import analyticsMixin from "@/mixins/analytics-mixin";
|
||||||
import { setupMocksForJsFiles, setupCookies } from "@/helpers/unit-test-helper.js";
|
import { setupMocksForJsFiles, setupCookies } from "@/helpers/unit-test-helper.js";
|
||||||
import { storeActions } from "@/constants/store-actions";
|
import { storeActions } from "@/constants/store-actions";
|
||||||
import { analyticsPageEvents, GaCategories, GaActions, GaLabels, GaEvents, ValueToLogTypes } from "@/constants/analytics";
|
import { analyticsPageEvents, GaCategories, GaActions, GaLabels, GaEvents, ValueToLogTypes } from "@/constants/analytics";
|
||||||
|
import store from "@/store";
|
||||||
|
|
||||||
describe("analyticsMixin.js", () => {
|
describe("analyticsMixin.js", () => {
|
||||||
test("logPageView: calls dispatch with type and payload", () => {
|
test("logPageView: calls dispatch with type and payload", () => {
|
||||||
|
|
@ -119,6 +120,21 @@ describe("analyticsMixin.js", () => {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
// Mock store
|
||||||
|
jest.mock("@/store", () => { return {}; }, { virtual: true });
|
||||||
|
|
||||||
|
store.getters = {
|
||||||
|
applicationUser: {
|
||||||
|
experiments: [
|
||||||
|
{
|
||||||
|
settings: {},
|
||||||
|
variationName: 'test',
|
||||||
|
universeName: 'testUniverse'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
analyticsMixin.methods.pushExperimentsToDataLayer(mockExperimentData);
|
analyticsMixin.methods.pushExperimentsToDataLayer(mockExperimentData);
|
||||||
|
|
@ -147,6 +163,20 @@ describe("analyticsMixin.js", () => {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
// Mock store
|
||||||
|
jest.mock("@/store", () => { return {}; }, { virtual: true });
|
||||||
|
|
||||||
|
store.getters = {
|
||||||
|
applicationUser: {
|
||||||
|
experiments: [
|
||||||
|
{
|
||||||
|
settings: { "Google Custom Dimension Index": "5" },
|
||||||
|
variationName: 'test',
|
||||||
|
universeName: 'testUniverse'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
analyticsMixin.methods.pushExperimentsToDataLayer(mockExperimentData);
|
analyticsMixin.methods.pushExperimentsToDataLayer(mockExperimentData);
|
||||||
|
|
|
||||||
|
|
@ -8,12 +8,12 @@ export default {
|
||||||
return partsOrQuestions?.some(pq => pq.parts?.length > 1);
|
return partsOrQuestions?.some(pq => pq.parts?.length > 1);
|
||||||
},
|
},
|
||||||
hasChildPartQuestions(partsOrQuestions) {
|
hasChildPartQuestions(partsOrQuestions) {
|
||||||
return partsOrQuestions.some(pq => {
|
return partsOrQuestions?.some(pq => {
|
||||||
return pq.parts?.some(part => part.childPartQuestions?.length > 0);
|
return pq.parts?.some(part => part.childPartQuestions?.length > 0);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
hasCapabilityQuestions(partsOrQuestions) {
|
hasCapabilityQuestions(partsOrQuestions) {
|
||||||
return partsOrQuestions.some(pq => {
|
return partsOrQuestions?.some(pq => {
|
||||||
return pq.parts?.some(part => part.requiresCapabilityQuestions === true);
|
return pq.parts?.some(part => part.requiresCapabilityQuestions === true);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import { getDeviceIdValue } from "@/helpers/heritage-integration/cookie-helper";
|
||||||
|
|
||||||
// Heritage integration
|
// Heritage integration
|
||||||
import { isSavedSessionStillActive } from "@/helpers/heritage-integration/session-helper";
|
import { isSavedSessionStillActive } from "@/helpers/heritage-integration/session-helper";
|
||||||
import { updateOrCreateFunnelCookie, getFunnelCookie } from "@/helpers/heritage-integration/cookie-helper";
|
import { updateOrCreateFunnelCookie, getFunnelCookie, updateSessionIdCookie } from "@/helpers/heritage-integration/cookie-helper";
|
||||||
import { loadOrderIfPresent, saveOrder } from "@/helpers/heritage-integration/order-helper";
|
import { loadOrderIfPresent, saveOrder } from "@/helpers/heritage-integration/order-helper";
|
||||||
import { getPageToRouteExistingOrderTo, navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
import { getPageToRouteExistingOrderTo, navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
||||||
|
|
||||||
|
|
@ -18,6 +18,8 @@ import baseMixin from "@/mixins/base-mixin";
|
||||||
import eventBus from "@/helpers/event-bus/event-bus";
|
import eventBus from "@/helpers/event-bus/event-bus";
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
import analyticsMixin from "@/mixins/analytics-mixin";
|
import analyticsMixin from "@/mixins/analytics-mixin";
|
||||||
|
import { experimentTriggers } from "../constants/experiments";
|
||||||
|
import { applicationConfig } from "../constants/application-config";
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
{
|
{
|
||||||
|
|
@ -29,6 +31,9 @@ const routes = [
|
||||||
if (analyticsMixin.methods.noSession()) {
|
if (analyticsMixin.methods.noSession()) {
|
||||||
await analyticsMixin.methods.initSession();
|
await analyticsMixin.methods.initSession();
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
updateSessionIdCookie();
|
||||||
|
}
|
||||||
|
|
||||||
if (getFunnelCookie()?.SuppressConceptFunnel) {
|
if (getFunnelCookie()?.SuppressConceptFunnel) {
|
||||||
await navigateToHeritageFunnel(false);
|
await navigateToHeritageFunnel(false);
|
||||||
|
|
@ -60,6 +65,8 @@ const routes = [
|
||||||
to.query.fmgPage = pageToRedirectTo;
|
to.query.fmgPage = pageToRedirectTo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await runExperiments(to.query.fmgPage);
|
||||||
|
|
||||||
// Process funnel cookie.
|
// Process funnel cookie.
|
||||||
updateOrCreateFunnelCookie();
|
updateOrCreateFunnelCookie();
|
||||||
|
|
||||||
|
|
@ -124,13 +131,12 @@ const router = createRouter({
|
||||||
router.afterEach((to, from) => {
|
router.afterEach((to, from) => {
|
||||||
// Update lastPageVisited in the store
|
// Update lastPageVisited in the store
|
||||||
store.commit(storeMutations.UPDATE_LAST_PAGE_VISITED, to.name);
|
store.commit(storeMutations.UPDATE_LAST_PAGE_VISITED, to.name);
|
||||||
// Push page view to GA
|
|
||||||
analyticsMixin.methods.pushPageViewToGA(to.query[queryStrings.FMG_PAGE]);
|
|
||||||
|
|
||||||
baseMixin.methods.dispatchStoreAction(storeActions.GET_EXPERIMENTS_BY_USER, { userId: getDeviceIdValue() })
|
// Push page view to GA
|
||||||
.then( (response) => {
|
analyticsMixin.methods.pushPageViewToGA();
|
||||||
analyticsMixin.methods.pushExperimentsToDataLayer(response.data);
|
|
||||||
});
|
// Push experiments to Data Layer
|
||||||
|
analyticsMixin.methods.pushExperimentsToDataLayer();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -138,11 +144,16 @@ router.navigate = (scenario, currentRoute, optionalQuery = {}, optionalParams =
|
||||||
navigate(scenario, currentRoute, optionalQuery, optionalParams, optionalPageData);
|
navigate(scenario, currentRoute, optionalQuery, optionalParams, optionalPageData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
router.navigateToExternalUrl = (url, optionalQuery = {}) => {
|
router.navigateToExternalUrl = (url, optionalQuery = {}) => {
|
||||||
navigateToUrl(url, optionalQuery);
|
navigateToUrl(url, optionalQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Use this navigation when you need to call next() explicitly. beforeRouteEnter is a good example.
|
||||||
|
router.overrideNavigation = (scenario, currentRoute, next, optionalQuery = {}, optionalParams = {}, optionalPageData) => {
|
||||||
|
router.navigate(scenario, currentRoute, optionalQuery, optionalParams, optionalPageData);
|
||||||
|
next();
|
||||||
|
}
|
||||||
|
|
||||||
// PRIVATE FUNCTIONS
|
// PRIVATE FUNCTIONS
|
||||||
|
|
||||||
// Navigate to the next route, depending on the scenario.
|
// Navigate to the next route, depending on the scenario.
|
||||||
|
|
@ -258,4 +269,21 @@ function arePagePrerequisitesValid(component) {
|
||||||
return component.default.methods.arePagePrerequisitesValid();
|
return component.default.methods.arePagePrerequisitesValid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Run SiteEntry and PageEntry triggers for experiments
|
||||||
|
async function runExperiments(nextPage) {
|
||||||
|
if (!store.getters.applicationUser.triggeredSiteEntry) {
|
||||||
|
await baseMixin.methods.dispatchStoreAction(storeActions.RUN_EXPERIMENTS_FOR_TRIGGER, {
|
||||||
|
userId: getDeviceIdValue(),
|
||||||
|
triggerEvent: experimentTriggers.SITE_ENTRY,
|
||||||
|
triggerValue: applicationConfig.SITE_ENTRY_TRIGGER_VALUE
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
await baseMixin.methods.dispatchStoreAction(storeActions.RUN_EXPERIMENTS_FOR_TRIGGER, {
|
||||||
|
userId: getDeviceIdValue(),
|
||||||
|
triggerEvent: experimentTriggers.PAGE_ENTRY,
|
||||||
|
triggerValue: nextPage
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export default router;
|
export default router;
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,8 @@ const fmgPageValues = {
|
||||||
REVEAL: "reveal",
|
REVEAL: "reveal",
|
||||||
ESTIMATE: "estimate",
|
ESTIMATE: "estimate",
|
||||||
ADDRESS_VEHICLES: "address-vehicles",
|
ADDRESS_VEHICLES: "address-vehicles",
|
||||||
QUOTE: "quote"
|
QUOTE: "quote",
|
||||||
|
HERITAGE: "heritage"
|
||||||
};
|
};
|
||||||
|
|
||||||
export { fmgPageValues };
|
export { fmgPageValues };
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,10 @@ import { storeMutations } from "@/constants/store-mutations";
|
||||||
import { getDateForSavedSessionTimeout } from "@/helpers/heritage-integration/session-helper";
|
import { getDateForSavedSessionTimeout } from "@/helpers/heritage-integration/session-helper";
|
||||||
import createPersistedState from "vuex-persistedstate";
|
import createPersistedState from "vuex-persistedstate";
|
||||||
import globalMethods from "@/global-methods";
|
import globalMethods from "@/global-methods";
|
||||||
import { storeActions } from "../constants/store-actions";
|
import { storeActions } from "@/constants/store-actions";
|
||||||
|
import { applicationConfig } from "@/constants/application-config";
|
||||||
|
import { experimentTriggers } from "@/constants/experiments";
|
||||||
|
import { damageLocationsSelected } from "@/constants/damage-locations-selected";
|
||||||
import { fmgPageValues } from "@/router/router-constants/fmgPage-values";
|
import { fmgPageValues } from "@/router/router-constants/fmgPage-values";
|
||||||
|
|
||||||
// Export State
|
// Export State
|
||||||
|
|
@ -60,6 +63,7 @@ const getDefaultState = () => {
|
||||||
referralDate: null,
|
referralDate: null,
|
||||||
referralCorrelationId: null,
|
referralCorrelationId: null,
|
||||||
accountNumber: 0,
|
accountNumber: 0,
|
||||||
|
eon: null
|
||||||
},
|
},
|
||||||
applicationUser: {
|
applicationUser: {
|
||||||
eventBus: [],
|
eventBus: [],
|
||||||
|
|
@ -69,7 +73,8 @@ const getDefaultState = () => {
|
||||||
savedSessionId: null,
|
savedSessionId: null,
|
||||||
crmCustomerId: null,
|
crmCustomerId: null,
|
||||||
lastPageVisited: null,
|
lastPageVisited: null,
|
||||||
experiments: []
|
experiments: [],
|
||||||
|
triggeredSiteEntry: false
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -124,6 +129,9 @@ export const mutations = {
|
||||||
updateGlassParts(state, partsData) {
|
updateGlassParts(state, partsData) {
|
||||||
state.order.lineItems.glassParts = partsData;
|
state.order.lineItems.glassParts = partsData;
|
||||||
},
|
},
|
||||||
|
updateOtherParts(state, partsData) {
|
||||||
|
state.order.lineItems.otherParts = partsData;
|
||||||
|
},
|
||||||
updatePageData(state, pageData) {
|
updatePageData(state, pageData) {
|
||||||
state.applicationUser.pageData[pageData.page] = pageData.data;
|
state.applicationUser.pageData[pageData.page] = pageData.data;
|
||||||
},
|
},
|
||||||
|
|
@ -139,6 +147,9 @@ export const mutations = {
|
||||||
updateParentAcctNumber(state, parentAcctNumber) {
|
updateParentAcctNumber(state, parentAcctNumber) {
|
||||||
state.order.accountNumber = parentAcctNumber;
|
state.order.accountNumber = parentAcctNumber;
|
||||||
},
|
},
|
||||||
|
updateEON(state, eon) {
|
||||||
|
state.order.eon = eon;
|
||||||
|
},
|
||||||
updateIsInsurance(state, isInsurance) {
|
updateIsInsurance(state, isInsurance) {
|
||||||
state.order.payment.isInsurance = isInsurance;
|
state.order.payment.isInsurance = isInsurance;
|
||||||
},
|
},
|
||||||
|
|
@ -267,6 +278,9 @@ export const mutations = {
|
||||||
state.order.lineItems.glassParts = null;
|
state.order.lineItems.glassParts = null;
|
||||||
state.order.damage.partQuestionAnswers = null;
|
state.order.damage.partQuestionAnswers = null;
|
||||||
state.applicationUser.pageData[fmgPageValues.PART_QUESTIONS] = null;
|
state.applicationUser.pageData[fmgPageValues.PART_QUESTIONS] = null;
|
||||||
|
state.applicationUser.pageData[fmgPageValues.VEHICLE_PARTS] = null;
|
||||||
|
state.applicationUser.pageData[fmgPageValues.MOLDING_QUESTIONS] = null;
|
||||||
|
state.applicationUser.pageData[fmgPageValues.CAPABILITY_QUESTIONS] = null;
|
||||||
},
|
},
|
||||||
resetState(state) {
|
resetState(state) {
|
||||||
Object.assign(state, getDefaultState());
|
Object.assign(state, getDefaultState());
|
||||||
|
|
@ -279,6 +293,14 @@ export const mutations = {
|
||||||
state.order.referralNumber = orderInformation.referralNumber;
|
state.order.referralNumber = orderInformation.referralNumber;
|
||||||
state.order.referralDate = orderInformation.referralDate;
|
state.order.referralDate = orderInformation.referralDate;
|
||||||
state.order.referralCorrelationId = orderInformation.referralCorrelationId;
|
state.order.referralCorrelationId = orderInformation.referralCorrelationId;
|
||||||
|
state.order.eon = orderInformation.eon;
|
||||||
|
|
||||||
|
if (state.order.vehicle.vin !== orderInformation.vehicle?.vin) {
|
||||||
|
state.applicationUser.pageData[fmgPageValues.PART_QUESTIONS] = null;
|
||||||
|
state.applicationUser.pageData[fmgPageValues.VEHICLE_PARTS] = null;
|
||||||
|
state.applicationUser.pageData[fmgPageValues.MOLDING_QUESTIONS] = null;
|
||||||
|
state.applicationUser.pageData[fmgPageValues.CAPABILITY_QUESTIONS] = null;
|
||||||
|
}
|
||||||
|
|
||||||
state.order.vehicle = Object.assign(state.order.vehicle, {
|
state.order.vehicle = Object.assign(state.order.vehicle, {
|
||||||
year: orderInformation.vehicle?.year,
|
year: orderInformation.vehicle?.year,
|
||||||
|
|
@ -317,7 +339,14 @@ export const mutations = {
|
||||||
state.order.payment.insuranceCoverage.isVerified = orderInformation?.insuranceInfo.coverageVerified;
|
state.order.payment.insuranceCoverage.isVerified = orderInformation?.insuranceInfo.coverageVerified;
|
||||||
|
|
||||||
state.order.customer.emailAddress = orderInformation.customer.emailAddress;
|
state.order.customer.emailAddress = orderInformation.customer.emailAddress;
|
||||||
|
state.applicationUser.experiments = orderInformation.experiments;
|
||||||
},
|
},
|
||||||
|
updateExperiments(state, experiments) {
|
||||||
|
state.applicationUser.experiments = experiments;
|
||||||
|
},
|
||||||
|
updateTriggeredSiteEntry(state, wasSiteEntryTriggered) {
|
||||||
|
state.applicationUser.triggeredSiteEntry = wasSiteEntryTriggered;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Export Getters
|
// Export Getters
|
||||||
|
|
@ -338,9 +367,37 @@ export const getters = {
|
||||||
applicationUser: (state) => state.applicationUser,
|
applicationUser: (state) => state.applicationUser,
|
||||||
order: (state) => state.order,
|
order: (state) => state.order,
|
||||||
payment: (state) => state.order.payment,
|
payment: (state) => state.order.payment,
|
||||||
|
experimentOrder: (state) => {
|
||||||
|
return {
|
||||||
|
vehicleYear: state.order.vehicle.year,
|
||||||
|
vehicleMake: state.order.vehicle.make,
|
||||||
|
vehicleModel: state.order.vehicle.model,
|
||||||
|
vehicleStyle: state.order.vehicle.style,
|
||||||
|
isRepair: state.order.damage.isRepair,
|
||||||
|
numberOfChips: state.order.damage.numberOfChips,
|
||||||
|
carId: state.order.vehicle.carId,
|
||||||
|
serviceCity: state.order.serviceLocation.city,
|
||||||
|
serviceState: state.order.serviceLocation.state,
|
||||||
|
serviceZipCode: state.order.serviceLocation.zipCode,
|
||||||
|
parentAccountNumber: state.order.accountNumber,
|
||||||
|
isCoverageVerified: state.order.payment.insuranceCoverage.isVerified,
|
||||||
|
orderPartNumbers: [...getAllValuesOfPropertyInArrayOfObjects(state.order.lineItems.glassParts, "partNumber"), ...getAllValuesOfPropertyInArrayOfObjects(state.order.lineItems.otherParts, "partNumber")],
|
||||||
|
orderPartTypes: [...getAllValuesOfPropertyInArrayOfObjects(state.order.lineItems.glassParts, "recalibrationType"), ...getAllValuesOfPropertyInArrayOfObjects(state.order.lineItems.otherParts, "recalibrationType")],
|
||||||
|
hasRecalibrationPart: getAllValuesOfPropertyInArrayOfObjects(state.order.lineItems.glassParts, "requiresRecalibration")?.length > 0,
|
||||||
|
selectedMultiGlass: state.order.damage.glassToReplace?.length > 1,
|
||||||
|
selectedWindshieldGlass: getAllValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, "glassLocation").includes(damageLocationsSelected.WINDSHIELD),
|
||||||
|
selectedBackGlass: getAllValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, "glassLocation").includes(damageLocationsSelected.REAR),
|
||||||
|
selectedDriverSideGlass: getAllValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, "glassLocation").includes(damageLocationsSelected.DRIVER),
|
||||||
|
selectedPassengerSideGlass: getAllValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, "glassLocation").includes(damageLocationsSelected.PASSENGER)
|
||||||
|
}
|
||||||
|
},
|
||||||
experimentSettings: (state) => state.applicationUser.experiments.map(x => x.settings).reduce((r, c) => Object.assign(r, c), {})
|
experimentSettings: (state) => state.applicationUser.experiments.map(x => x.settings).reduce((r, c) => Object.assign(r, c), {})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getAllValuesOfPropertyInArrayOfObjects(array, propertyName) {
|
||||||
|
return (array ?? []).map(x => x[propertyName]).filter(x => x);
|
||||||
|
}
|
||||||
|
|
||||||
// Export Actions
|
// Export Actions
|
||||||
export const actions = {
|
export const actions = {
|
||||||
|
|
||||||
|
|
@ -490,39 +547,51 @@ export const actions = {
|
||||||
},
|
},
|
||||||
|
|
||||||
// Analytics Actions
|
// Analytics Actions
|
||||||
logExperimentExposure(context, { userId, sessionKey, pageName, universeName }) {
|
logExperimentExposure(context, { userId, sessionKey, pageName, experiment }) {
|
||||||
return globalMethods.callHttpClient({
|
return globalMethods.callHttpClient({
|
||||||
method: endpoints.LogExperimentExposureIfAssigned.method,
|
method: endpoints.LogExperimentExposureIfAssigned.method,
|
||||||
endpoint: endpoints.LogExperimentExposureIfAssigned.url,
|
endpoint: endpoints.LogExperimentExposureIfAssigned.url,
|
||||||
payload: {
|
payload: {
|
||||||
userId: userId,
|
experimentForLogging: {
|
||||||
sessionKey: sessionKey,
|
userId: userId,
|
||||||
pageName: pageName,
|
experimentUniverseId: experiment.universeId,
|
||||||
universeName: universeName
|
experimentUniverseName: experiment.universeName,
|
||||||
|
experimentTestId: experiment.testId,
|
||||||
|
experimentTestName: experiment.testName,
|
||||||
|
experimentVariationId: experiment.variationId,
|
||||||
|
experimentVariationName: experiment.variationName,
|
||||||
|
enabled: experiment.isActive,
|
||||||
|
isExposed: experiment.isExposed,
|
||||||
|
userPartitionNumber: experiment.userPartitionNumber,
|
||||||
|
assignmentId: experiment.assignmentId,
|
||||||
|
sessionKey: sessionKey,
|
||||||
|
pageName: pageName,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// Misc Actions
|
// Misc Actions
|
||||||
updateStoreWithSaveOrderResponse(context, { referralNumber, referralDate, referralCorrelationId, accountNumber, savedSessionId, crmCustomerId }) {
|
updateStoreWithSaveOrderResponse(context, { referralNumber, referralDate, referralCorrelationId, eon, accountNumber, savedSessionId, crmCustomerId }) {
|
||||||
context.commit(storeMutations.UPDATE_REFERRAL_NUMBER, referralNumber);
|
context.commit(storeMutations.UPDATE_REFERRAL_NUMBER, referralNumber);
|
||||||
context.commit(storeMutations.UPDATE_REFERRAL_DATE, referralDate);
|
context.commit(storeMutations.UPDATE_REFERRAL_DATE, referralDate);
|
||||||
context.commit(storeMutations.UPDATE_REFERRAL_CORRELATION_ID, referralCorrelationId);
|
context.commit(storeMutations.UPDATE_REFERRAL_CORRELATION_ID, referralCorrelationId);
|
||||||
|
context.commit(storeMutations.UPDATE_EON, eon);
|
||||||
context.commit(storeMutations.UPDATE_PARENT_ACCT_NUMBER, accountNumber);
|
context.commit(storeMutations.UPDATE_PARENT_ACCT_NUMBER, accountNumber);
|
||||||
context.commit(storeMutations.UPDATE_SAVED_SESSION_ID, savedSessionId);
|
context.commit(storeMutations.UPDATE_SAVED_SESSION_ID, savedSessionId);
|
||||||
context.commit(storeMutations.UPDATE_CRM_CUSTOMER_ID, crmCustomerId);
|
context.commit(storeMutations.UPDATE_CRM_CUSTOMER_ID, crmCustomerId);
|
||||||
},
|
},
|
||||||
|
logPageView(context, { userId, sessionKey, pageName, sessionId, action, event, shouldUseSessionId, experimentsForUser }) {
|
||||||
logPageView(context, { userId, sessionKey, pageName, sessionId, action, event, shouldUseSessionId }) {
|
|
||||||
var payload = {
|
var payload = {
|
||||||
userId: userId,
|
userId: userId,
|
||||||
sessionKey: sessionKey,
|
sessionKey: sessionKey,
|
||||||
sessionId: sessionId,
|
sessionId: sessionId,
|
||||||
pageName: pageName,
|
pageName: pageName,
|
||||||
applicationName: 'SafeliteDotCom',
|
applicationName: applicationConfig.APPLICATION_NAME,
|
||||||
action: action,
|
action: action,
|
||||||
event: event,
|
event: event,
|
||||||
shouldUseSessionId: shouldUseSessionId
|
shouldUseSessionId: shouldUseSessionId,
|
||||||
|
experimentsForUser: experimentsForUser
|
||||||
};
|
};
|
||||||
|
|
||||||
return globalMethods.callHttpClient({
|
return globalMethods.callHttpClient({
|
||||||
|
|
@ -532,18 +601,19 @@ export const actions = {
|
||||||
logApiCall: false
|
logApiCall: false
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
logCustomEvent(context, { userId, sessionKey, pageName, sessionId, category, action, label, value, shouldUseSessionId }) {
|
logCustomEvent(context, { userId, sessionKey, pageName, sessionId, category, action, label, value, shouldUseSessionId, experimentsForUser }) {
|
||||||
var payload = {
|
var payload = {
|
||||||
userId: userId,
|
userId: userId,
|
||||||
sessionKey: sessionKey,
|
sessionKey: sessionKey,
|
||||||
sessionId: sessionId,
|
sessionId: sessionId,
|
||||||
pageName: pageName,
|
pageName: pageName,
|
||||||
applicationName: 'SafeliteDotCom',
|
applicationName: applicationConfig.APPLICATION_NAME,
|
||||||
category: category,
|
category: category,
|
||||||
action: action,
|
action: action,
|
||||||
label: label,
|
label: label,
|
||||||
value: value,
|
value: value,
|
||||||
shouldUseSessionId: shouldUseSessionId
|
shouldUseSessionId: shouldUseSessionId,
|
||||||
|
experimentsForUser: experimentsForUser
|
||||||
};
|
};
|
||||||
|
|
||||||
return globalMethods.callHttpClient({
|
return globalMethods.callHttpClient({
|
||||||
|
|
@ -555,7 +625,7 @@ export const actions = {
|
||||||
},
|
},
|
||||||
initializeSession(context, { userId, sessionId, userAgent, referrer }) {
|
initializeSession(context, { userId, sessionId, userAgent, referrer }) {
|
||||||
var payload = {
|
var payload = {
|
||||||
applicationName: 'SafeliteDotCom',
|
applicationName: applicationConfig.APPLICATION_NAME,
|
||||||
userId: userId,
|
userId: userId,
|
||||||
deviceId: userId,
|
deviceId: userId,
|
||||||
sessionId: sessionId,
|
sessionId: sessionId,
|
||||||
|
|
@ -574,10 +644,11 @@ export const actions = {
|
||||||
},
|
},
|
||||||
|
|
||||||
// Misc Actions
|
// Misc Actions
|
||||||
setReferralInformation(context, { referralNumber, referralDate, referralCorrelationId }) {
|
setReferralInformation(context, { referralNumber, referralDate, referralCorrelationId, eon }) {
|
||||||
context.commit(storeMutations.UPDATE_REFERRAL_NUMBER, referralNumber);
|
context.commit(storeMutations.UPDATE_REFERRAL_NUMBER, referralNumber);
|
||||||
context.commit(storeMutations.UPDATE_REFERRAL_DATE, referralDate);
|
context.commit(storeMutations.UPDATE_REFERRAL_DATE, referralDate);
|
||||||
context.commit(storeMutations.UPDATE_REFERRAL_CORRELATION_ID, referralCorrelationId);
|
context.commit(storeMutations.UPDATE_REFERRAL_CORRELATION_ID, referralCorrelationId);
|
||||||
|
context.commit(storeMutations.UPDATE_EON, eon);
|
||||||
},
|
},
|
||||||
|
|
||||||
GetExperimentsByUser(context, { userId }) {
|
GetExperimentsByUser(context, { userId }) {
|
||||||
|
|
@ -588,6 +659,28 @@ export const actions = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
async runExperimentsForTrigger(context, { userId, triggerEvent, triggerValue }) {
|
||||||
|
if (triggerEvent == experimentTriggers.SITE_ENTRY) {
|
||||||
|
context.commit(storeMutations.UPDATE_TRIGGERED_SITE_ENTRY, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
var payload = {
|
||||||
|
applicationName: applicationConfig.APPLICATION_NAME,
|
||||||
|
userId: userId,
|
||||||
|
triggerEvent: triggerEvent,
|
||||||
|
triggerValue: triggerValue,
|
||||||
|
experimentOrder: context.getters.experimentOrder
|
||||||
|
};
|
||||||
|
|
||||||
|
const response = await globalMethods.callHttpClient({
|
||||||
|
method: endpoints.RunExperimentsForTrigger.method,
|
||||||
|
endpoint: endpoints.RunExperimentsForTrigger.url,
|
||||||
|
payload: payload,
|
||||||
|
});
|
||||||
|
|
||||||
|
context.commit(storeMutations.UPDATE_EXPERIMENTS, response.data.experiments);
|
||||||
|
},
|
||||||
|
|
||||||
getEvoxImage(context, { relativeUrl }) {
|
getEvoxImage(context, { relativeUrl }) {
|
||||||
return globalMethods.callHttpClient({
|
return globalMethods.callHttpClient({
|
||||||
method: endpoints.GetPageData.method,
|
method: endpoints.GetPageData.method,
|
||||||
|
|
@ -650,6 +743,7 @@ export const actions = {
|
||||||
const damage = context.getters.damage;
|
const damage = context.getters.damage;
|
||||||
const order = context.state.order;
|
const order = context.state.order;
|
||||||
const applicationUser = context.getters.applicationUser;
|
const applicationUser = context.getters.applicationUser;
|
||||||
|
const lineItems = context.state.order.lineItems;
|
||||||
|
|
||||||
return globalMethods.callHttpClient({
|
return globalMethods.callHttpClient({
|
||||||
method: endpoints.SaveOrder.method,
|
method: endpoints.SaveOrder.method,
|
||||||
|
|
@ -680,6 +774,9 @@ export const actions = {
|
||||||
customer: {
|
customer: {
|
||||||
emailAddress: order.customer.emailAddress,
|
emailAddress: order.customer.emailAddress,
|
||||||
},
|
},
|
||||||
|
lineItems: {
|
||||||
|
glassParts: lineItems.glassParts
|
||||||
|
},
|
||||||
serviceLocation: {
|
serviceLocation: {
|
||||||
streetAddress: order.serviceLocation.address,
|
streetAddress: order.serviceLocation.address,
|
||||||
city: order.serviceLocation.city,
|
city: order.serviceLocation.city,
|
||||||
|
|
@ -693,7 +790,7 @@ export const actions = {
|
||||||
lastPage: applicationUser.lastPageVisited,
|
lastPage: applicationUser.lastPageVisited,
|
||||||
crmCustomerId: applicationUser.crmCustomerId,
|
crmCustomerId: applicationUser.crmCustomerId,
|
||||||
savedSessionId: applicationUser.savedSessionId,
|
savedSessionId: applicationUser.savedSessionId,
|
||||||
|
experiments: applicationUser.experiments,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
@ -708,8 +805,8 @@ export const actions = {
|
||||||
accountNumber: accountNumber?.toString()
|
accountNumber: accountNumber?.toString()
|
||||||
},
|
},
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
// clear the state if the existing referral number does not equal what is returned from loadOrder
|
// clear the state if the existing EON does not equal what is returned from loadOrder
|
||||||
if (context.state.order.referralNumber != response.data.referralNumber) {
|
if (context.state.order.eon && context.state.order.eon != response.data.eon) {
|
||||||
context.commit(storeMutations.RESET_STATE);
|
context.commit(storeMutations.RESET_STATE);
|
||||||
}
|
}
|
||||||
context.commit(storeMutations.UPDATE_STATE_WITH_ORDER_INFORMATION, response.data);
|
context.commit(storeMutations.UPDATE_STATE_WITH_ORDER_INFORMATION, response.data);
|
||||||
|
|
@ -736,6 +833,7 @@ export const actions = {
|
||||||
|
|
||||||
context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES);
|
context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES);
|
||||||
context.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES);
|
context.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES);
|
||||||
|
context.dispatch(storeActions.RESET_PARTS_STATE_AND_DEPENDENCIES);
|
||||||
|
|
||||||
//Save new values
|
//Save new values
|
||||||
context.commit(storeMutations.UPDATE_YEAR, year);
|
context.commit(storeMutations.UPDATE_YEAR, year);
|
||||||
|
|
@ -756,6 +854,7 @@ export const actions = {
|
||||||
|
|
||||||
context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES);
|
context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES);
|
||||||
context.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES);
|
context.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES);
|
||||||
|
context.dispatch(storeActions.RESET_PARTS_STATE_AND_DEPENDENCIES);
|
||||||
|
|
||||||
//Save new values
|
//Save new values
|
||||||
context.commit(storeMutations.UPDATE_MAKE, make);
|
context.commit(storeMutations.UPDATE_MAKE, make);
|
||||||
|
|
@ -775,6 +874,7 @@ export const actions = {
|
||||||
|
|
||||||
context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES);
|
context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES);
|
||||||
context.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES);
|
context.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES);
|
||||||
|
context.dispatch(storeActions.RESET_PARTS_STATE_AND_DEPENDENCIES);
|
||||||
|
|
||||||
//Save new values
|
//Save new values
|
||||||
context.commit(storeMutations.UPDATE_MODEL, model);
|
context.commit(storeMutations.UPDATE_MODEL, model);
|
||||||
|
|
@ -792,6 +892,7 @@ export const actions = {
|
||||||
|
|
||||||
context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES);
|
context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES);
|
||||||
context.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES);
|
context.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES);
|
||||||
|
context.dispatch(storeActions.RESET_PARTS_STATE_AND_DEPENDENCIES);
|
||||||
|
|
||||||
//Save new values
|
//Save new values
|
||||||
context.commit(storeMutations.UPDATE_STYLE, style);
|
context.commit(storeMutations.UPDATE_STYLE, style);
|
||||||
|
|
@ -822,6 +923,7 @@ export const actions = {
|
||||||
//Reset dependent state when changing
|
//Reset dependent state when changing
|
||||||
if (vehicleInfo.vin !== context.state.order.vehicle.vin) {
|
if (vehicleInfo.vin !== context.state.order.vehicle.vin) {
|
||||||
context.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES);
|
context.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES);
|
||||||
|
context.dispatch(storeActions.RESET_PARTS_STATE_AND_DEPENDENCIES);
|
||||||
|
|
||||||
if (!isSelectedGlassAvailableForVehicle) {
|
if (!isSelectedGlassAvailableForVehicle) {
|
||||||
context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES);
|
context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES);
|
||||||
|
|
@ -840,6 +942,7 @@ export const actions = {
|
||||||
|
|
||||||
if (!isSelectedGlassAvailableForVehicle) {
|
if (!isSelectedGlassAvailableForVehicle) {
|
||||||
context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES);
|
context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES);
|
||||||
|
context.dispatch(storeActions.RESET_PARTS_STATE_AND_DEPENDENCIES);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Save new values
|
//Save new values
|
||||||
|
|
@ -855,6 +958,7 @@ export const actions = {
|
||||||
|
|
||||||
if (!isSelectedGlassAvailableForVehicle) {
|
if (!isSelectedGlassAvailableForVehicle) {
|
||||||
context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES);
|
context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES);
|
||||||
|
context.dispatch(storeActions.RESET_PARTS_STATE_AND_DEPENDENCIES);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Save new values
|
//Save new values
|
||||||
|
|
@ -880,6 +984,7 @@ export const actions = {
|
||||||
|
|
||||||
if (!isSelectedGlassAvailableForVehicle) {
|
if (!isSelectedGlassAvailableForVehicle) {
|
||||||
context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES);
|
context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES);
|
||||||
|
context.dispatch(storeActions.RESET_PARTS_STATE_AND_DEPENDENCIES);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Save new values
|
//Save new values
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ import globalMethods from "@/global-methods";
|
||||||
import { mutations, state, actions, getters } from "@/store";
|
import { mutations, state, actions, getters } from "@/store";
|
||||||
import { storeMutations } from "@/constants/store-mutations";
|
import { storeMutations } from "@/constants/store-mutations";
|
||||||
import { storeActions } from "@/constants/store-actions";
|
import { storeActions } from "@/constants/store-actions";
|
||||||
|
import { experimentTriggers } from "@/constants/experiments";
|
||||||
|
|
||||||
// Mock global method
|
// Mock global method
|
||||||
globalMethods.callHttpClient = jest.fn();
|
globalMethods.callHttpClient = jest.fn();
|
||||||
|
|
||||||
|
|
@ -249,6 +251,36 @@ describe("Mutations", () => {
|
||||||
expect(storeState.order.payment.insuranceCoverage.isVerified).toEqual(true);
|
expect(storeState.order.payment.insuranceCoverage.isVerified).toEqual(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("updateExperiments, should set experiments", () => {
|
||||||
|
// Arrange
|
||||||
|
const storeState = state;
|
||||||
|
const mockExperimentsList = [
|
||||||
|
{
|
||||||
|
universeName: "XYZ",
|
||||||
|
settings: {
|
||||||
|
ExperimentSetting: "ExperimentValue"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
// Act
|
||||||
|
mutations.updateExperiments(storeState, mockExperimentsList);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(storeState.applicationUser.experiments).toEqual(mockExperimentsList);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("updateTriggeredSiteEntry, should set triggeredSiteEntry", () => {
|
||||||
|
// Arrange
|
||||||
|
const storeState = state;
|
||||||
|
|
||||||
|
// Act
|
||||||
|
mutations.updateTriggeredSiteEntry(storeState, true);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(storeState.applicationUser.triggeredSiteEntry).toEqual(true);
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("Actions", () => {
|
describe("Actions", () => {
|
||||||
|
|
@ -575,12 +607,13 @@ describe("Actions", () => {
|
||||||
lastPageVisited: "test-page",
|
lastPageVisited: "test-page",
|
||||||
crmCustomerId: "xxx-xxx-xxx",
|
crmCustomerId: "xxx-xxx-xxx",
|
||||||
savedSessionId: "xxx-xxx-xxx"
|
savedSessionId: "xxx-xxx-xxx"
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
context.state = {
|
context.state = {
|
||||||
order: {
|
order: {
|
||||||
serviceLocation: {},
|
serviceLocation: {},
|
||||||
customer: {}
|
customer: {},
|
||||||
|
lineItems: {}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -793,13 +826,27 @@ describe("Actions", () => {
|
||||||
|
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const payload = { isCarIdDifferent: true, isSelectedGlassAvailableForVehicle: false, vehicleInfo: { carId: 'C010101', vin: "XXXXX" }, registrationInfo: { zipCode: "80020" }, serviceLocationInfo: { state: "CO" }, customerEmail: "test@safleite.com" };
|
const payload = {
|
||||||
|
isCarIdDifferent: true,
|
||||||
|
isSelectedGlassAvailableForVehicle: false,
|
||||||
|
vehicleInfo: {
|
||||||
|
carId: 'C010101', vin: "XXXXX"
|
||||||
|
},
|
||||||
|
registrationInfo: {
|
||||||
|
zipCode: "80020"
|
||||||
|
},
|
||||||
|
serviceLocationInfo: {
|
||||||
|
state: "CO"
|
||||||
|
},
|
||||||
|
customerEmail: "test@safleite.com"
|
||||||
|
};
|
||||||
|
|
||||||
actions.saveVinLookup(context, payload);
|
actions.saveVinLookup(context, payload);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(dispatch).toHaveBeenNthCalledWith(1, storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES);
|
expect(dispatch).toHaveBeenNthCalledWith(1, storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES);
|
||||||
expect(dispatch).toHaveBeenNthCalledWith(2, storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES);
|
expect(dispatch).toHaveBeenNthCalledWith(2, storeActions.RESET_PARTS_STATE_AND_DEPENDENCIES);
|
||||||
|
expect(dispatch).toHaveBeenNthCalledWith(3, storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES);
|
||||||
|
|
||||||
expect(commit).toBeCalledWith(storeMutations.UPDATE_VEHICLE, payload.vehicleInfo);
|
expect(commit).toBeCalledWith(storeMutations.UPDATE_VEHICLE, payload.vehicleInfo);
|
||||||
expect(commit).toBeCalledWith(storeMutations.UPDATE_REGISTRATION, payload.registrationInfo);
|
expect(commit).toBeCalledWith(storeMutations.UPDATE_REGISTRATION, payload.registrationInfo);
|
||||||
|
|
@ -1041,6 +1088,72 @@ describe("Actions", () => {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe("runExperimentsForTrigger", () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
mutations.resetState(state);
|
||||||
|
globalMethods.callHttpClient = jest.fn().mockReturnValue({
|
||||||
|
data: {
|
||||||
|
experiments: [
|
||||||
|
{
|
||||||
|
mockProperty: "mockValue"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
|
test("triggerEvent is SiteEntry => set triggeredSiteEntry to true in store", async () => {
|
||||||
|
// Arrange
|
||||||
|
const context = state;
|
||||||
|
context.commit = jest.fn().mockImplementation((storeMutation, value) => mutations[storeMutation](context, value));
|
||||||
|
context.getters = {
|
||||||
|
...getters,
|
||||||
|
applicationUser: getters.applicationUser(context)
|
||||||
|
};
|
||||||
|
|
||||||
|
// Act
|
||||||
|
await actions.runExperimentsForTrigger(context, {
|
||||||
|
triggerEvent: experimentTriggers.SITE_ENTRY,
|
||||||
|
});
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(context.commit).toHaveBeenNthCalledWith(1, storeMutations.UPDATE_TRIGGERED_SITE_ENTRY, true);
|
||||||
|
expect(context.getters.applicationUser.triggeredSiteEntry).toBe(true);
|
||||||
|
expect(globalMethods.callHttpClient).toHaveBeenCalled();
|
||||||
|
expect(context.commit).toHaveBeenNthCalledWith(2, storeMutations.UPDATE_EXPERIMENTS, [
|
||||||
|
{
|
||||||
|
mockProperty: "mockValue"
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("triggerEvent is not SiteEntry => triggeredSiteEntry is false in store", async () => {
|
||||||
|
// Arrange
|
||||||
|
const context = state;
|
||||||
|
context.commit = jest.fn().mockImplementation((storeMutation, value) => mutations[storeMutation](context, value));
|
||||||
|
context.getters = {
|
||||||
|
...getters,
|
||||||
|
applicationUser: getters.applicationUser(context)
|
||||||
|
};
|
||||||
|
expect(context.commit).toHaveBeenCalledTimes(0);
|
||||||
|
|
||||||
|
// Act
|
||||||
|
await actions.runExperimentsForTrigger(context, {
|
||||||
|
triggerEvent: "NotSiteEntry",
|
||||||
|
});
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(context.commit).not.toHaveBeenCalledWith(storeMutations.UPDATE_TRIGGERED_SITE_ENTRY, expect.any);
|
||||||
|
expect(context.getters.applicationUser.triggeredSiteEntry).toBe(false);
|
||||||
|
|
||||||
|
expect(globalMethods.callHttpClient).toHaveBeenCalledTimes(1);
|
||||||
|
expect(context.commit).toHaveBeenNthCalledWith(1, storeMutations.UPDATE_EXPERIMENTS, [
|
||||||
|
{
|
||||||
|
mockProperty: "mockValue"
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1138,4 +1251,321 @@ describe("Getters", () => {
|
||||||
expect(getters.payment(storeState).insuranceCoverage.isVerified).toEqual(true);
|
expect(getters.payment(storeState).insuranceCoverage.isVerified).toEqual(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe("experimentOrder", () => {
|
||||||
|
test("glassToReplace, glassParts, and otherParts are null > return correct experimentOrder values", () => {
|
||||||
|
// Arrange
|
||||||
|
const storeState = state;
|
||||||
|
const mockStateValues = {
|
||||||
|
vehicleYear: 1000,
|
||||||
|
vehicleMake: "CarMake",
|
||||||
|
vehicleModel: "CarModel",
|
||||||
|
vehicleStyle: "SuperCoolStyle",
|
||||||
|
isRepair: true,
|
||||||
|
numberOfChips: 9999999,
|
||||||
|
carId: "Gibberish",
|
||||||
|
serviceCity: "Columbus",
|
||||||
|
serviceState: "OH-IO",
|
||||||
|
serviceZipCode: 43215,
|
||||||
|
parentAccountNumber: "999999",
|
||||||
|
isCoverageVerified: true,
|
||||||
|
glassParts: null,
|
||||||
|
otherParts: null,
|
||||||
|
glassToReplace: null
|
||||||
|
}
|
||||||
|
|
||||||
|
//Act
|
||||||
|
mutations.updateYear(storeState, mockStateValues.vehicleYear);
|
||||||
|
mutations.updateMake(storeState, mockStateValues.vehicleMake);
|
||||||
|
mutations.updateModel(storeState, mockStateValues.vehicleModel);
|
||||||
|
mutations.updateStyle(storeState, mockStateValues.vehicleStyle);
|
||||||
|
mutations.updateIsRepair(storeState, mockStateValues.isRepair);
|
||||||
|
mutations.updateNumberOfChips(storeState, mockStateValues.numberOfChips);
|
||||||
|
mutations.updateCarId(storeState, mockStateValues.carId);
|
||||||
|
mutations.updateServiceLocation(storeState, {
|
||||||
|
city: mockStateValues.serviceCity,
|
||||||
|
state: mockStateValues.serviceState,
|
||||||
|
zipCode: mockStateValues.serviceZipCode
|
||||||
|
});
|
||||||
|
mutations.updateParentAcctNumber(storeState, mockStateValues.parentAccountNumber);
|
||||||
|
mutations.updateInsuranceVerifiedStatus(storeState, mockStateValues.isCoverageVerified);
|
||||||
|
mutations.updateGlassParts(storeState, mockStateValues.glassParts);
|
||||||
|
mutations.updateOtherParts(storeState, mockStateValues.otherParts);
|
||||||
|
mutations.updateGlassToReplace(storeState, mockStateValues.glassToReplace);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
expect(getters.experimentOrder(storeState)).toEqual({
|
||||||
|
vehicleYear: mockStateValues.vehicleYear,
|
||||||
|
vehicleMake: mockStateValues.vehicleMake,
|
||||||
|
vehicleModel: mockStateValues.vehicleModel,
|
||||||
|
vehicleStyle: mockStateValues.vehicleStyle,
|
||||||
|
isRepair: mockStateValues.isRepair,
|
||||||
|
numberOfChips: mockStateValues.numberOfChips,
|
||||||
|
carId: mockStateValues.carId,
|
||||||
|
serviceCity: mockStateValues.serviceCity,
|
||||||
|
serviceState: mockStateValues.serviceState,
|
||||||
|
serviceZipCode: mockStateValues.serviceZipCode,
|
||||||
|
parentAccountNumber: mockStateValues.parentAccountNumber,
|
||||||
|
isCoverageVerified: mockStateValues.isCoverageVerified,
|
||||||
|
orderPartNumbers: [],
|
||||||
|
orderPartTypes: [],
|
||||||
|
hasRecalibrationPart: false,
|
||||||
|
selectedMultiGlass: false,
|
||||||
|
selectedWindshieldGlass: false,
|
||||||
|
selectedBackGlass: false,
|
||||||
|
selectedDriverSideGlass: false,
|
||||||
|
selectedPassengerSideGlass: false
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test("glassToReplace, glassParts, and otherParts are empty > return correct experimentOrder values", () => {
|
||||||
|
// Arrange
|
||||||
|
const storeState = state;
|
||||||
|
const mockStateValues = {
|
||||||
|
vehicleYear: 1000,
|
||||||
|
vehicleMake: "CarMake",
|
||||||
|
vehicleModel: "CarModel",
|
||||||
|
vehicleStyle: "SuperCoolStyle",
|
||||||
|
isRepair: true,
|
||||||
|
numberOfChips: 9999999,
|
||||||
|
carId: "Gibberish",
|
||||||
|
serviceCity: "Columbus",
|
||||||
|
serviceState: "OH-IO",
|
||||||
|
serviceZipCode: 43215,
|
||||||
|
parentAccountNumber: "999999",
|
||||||
|
isCoverageVerified: true,
|
||||||
|
glassParts: [],
|
||||||
|
otherParts: [],
|
||||||
|
glassToReplace: []
|
||||||
|
}
|
||||||
|
|
||||||
|
//Act
|
||||||
|
mutations.updateYear(storeState, mockStateValues.vehicleYear);
|
||||||
|
mutations.updateMake(storeState, mockStateValues.vehicleMake);
|
||||||
|
mutations.updateModel(storeState, mockStateValues.vehicleModel);
|
||||||
|
mutations.updateStyle(storeState, mockStateValues.vehicleStyle);
|
||||||
|
mutations.updateIsRepair(storeState, mockStateValues.isRepair);
|
||||||
|
mutations.updateNumberOfChips(storeState, mockStateValues.numberOfChips);
|
||||||
|
mutations.updateCarId(storeState, mockStateValues.carId);
|
||||||
|
mutations.updateServiceLocation(storeState, {
|
||||||
|
city: mockStateValues.serviceCity,
|
||||||
|
state: mockStateValues.serviceState,
|
||||||
|
zipCode: mockStateValues.serviceZipCode
|
||||||
|
});
|
||||||
|
mutations.updateParentAcctNumber(storeState, mockStateValues.parentAccountNumber);
|
||||||
|
mutations.updateInsuranceVerifiedStatus(storeState, mockStateValues.isCoverageVerified);
|
||||||
|
mutations.updateGlassParts(storeState, mockStateValues.glassParts);
|
||||||
|
mutations.updateOtherParts(storeState, mockStateValues.otherParts);
|
||||||
|
mutations.updateGlassToReplace(storeState, mockStateValues.glassToReplace);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
expect(getters.experimentOrder(storeState)).toEqual({
|
||||||
|
vehicleYear: mockStateValues.vehicleYear,
|
||||||
|
vehicleMake: mockStateValues.vehicleMake,
|
||||||
|
vehicleModel: mockStateValues.vehicleModel,
|
||||||
|
vehicleStyle: mockStateValues.vehicleStyle,
|
||||||
|
isRepair: mockStateValues.isRepair,
|
||||||
|
numberOfChips: mockStateValues.numberOfChips,
|
||||||
|
carId: mockStateValues.carId,
|
||||||
|
serviceCity: mockStateValues.serviceCity,
|
||||||
|
serviceState: mockStateValues.serviceState,
|
||||||
|
serviceZipCode: mockStateValues.serviceZipCode,
|
||||||
|
parentAccountNumber: mockStateValues.parentAccountNumber,
|
||||||
|
isCoverageVerified: mockStateValues.isCoverageVerified,
|
||||||
|
orderPartNumbers: [],
|
||||||
|
orderPartTypes: [],
|
||||||
|
hasRecalibrationPart: false,
|
||||||
|
selectedMultiGlass: false,
|
||||||
|
selectedWindshieldGlass: false,
|
||||||
|
selectedBackGlass: false,
|
||||||
|
selectedDriverSideGlass: false,
|
||||||
|
selectedPassengerSideGlass: false
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Single windshield requiring recalibration is selected > return correct experimentOrder values", () => {
|
||||||
|
// Arrange
|
||||||
|
const storeState = state;
|
||||||
|
const mockStateValues = {
|
||||||
|
vehicleYear: 1000,
|
||||||
|
vehicleMake: "CarMake",
|
||||||
|
vehicleModel: "CarModel",
|
||||||
|
vehicleStyle: "SuperCoolStyle",
|
||||||
|
isRepair: false,
|
||||||
|
numberOfChips: 0,
|
||||||
|
carId: "Gibberish",
|
||||||
|
serviceCity: "Columbus",
|
||||||
|
serviceState: "OH-IO",
|
||||||
|
serviceZipCode: 43215,
|
||||||
|
parentAccountNumber: "999999",
|
||||||
|
isCoverageVerified: false,
|
||||||
|
glassParts: [
|
||||||
|
{
|
||||||
|
partNumber: "WINDSHIELDPARTNUMBER",
|
||||||
|
description: "This is a windshield",
|
||||||
|
recalibrationType: "ADAS, maybe",
|
||||||
|
requiresRecalibration: true,
|
||||||
|
requiresCapabilityQuestions: false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
otherParts: [
|
||||||
|
|
||||||
|
],
|
||||||
|
glassToReplace: [
|
||||||
|
{
|
||||||
|
glassLocation: "Windshield",
|
||||||
|
glassName: "Single"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
//Act
|
||||||
|
mutations.updateYear(storeState, mockStateValues.vehicleYear);
|
||||||
|
mutations.updateMake(storeState, mockStateValues.vehicleMake);
|
||||||
|
mutations.updateModel(storeState, mockStateValues.vehicleModel);
|
||||||
|
mutations.updateStyle(storeState, mockStateValues.vehicleStyle);
|
||||||
|
mutations.updateIsRepair(storeState, mockStateValues.isRepair);
|
||||||
|
mutations.updateNumberOfChips(storeState, mockStateValues.numberOfChips);
|
||||||
|
mutations.updateCarId(storeState, mockStateValues.carId);
|
||||||
|
mutations.updateServiceLocation(storeState, {
|
||||||
|
city: mockStateValues.serviceCity,
|
||||||
|
state: mockStateValues.serviceState,
|
||||||
|
zipCode: mockStateValues.serviceZipCode
|
||||||
|
});
|
||||||
|
mutations.updateParentAcctNumber(storeState, mockStateValues.parentAccountNumber);
|
||||||
|
mutations.updateInsuranceVerifiedStatus(storeState, mockStateValues.isCoverageVerified);
|
||||||
|
mutations.updateGlassParts(storeState, mockStateValues.glassParts);
|
||||||
|
mutations.updateOtherParts(storeState, mockStateValues.otherParts);
|
||||||
|
mutations.updateGlassToReplace(storeState, mockStateValues.glassToReplace);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
expect(getters.experimentOrder(storeState)).toEqual({
|
||||||
|
vehicleYear: mockStateValues.vehicleYear,
|
||||||
|
vehicleMake: mockStateValues.vehicleMake,
|
||||||
|
vehicleModel: mockStateValues.vehicleModel,
|
||||||
|
vehicleStyle: mockStateValues.vehicleStyle,
|
||||||
|
isRepair: mockStateValues.isRepair,
|
||||||
|
numberOfChips: mockStateValues.numberOfChips,
|
||||||
|
carId: mockStateValues.carId,
|
||||||
|
serviceCity: mockStateValues.serviceCity,
|
||||||
|
serviceState: mockStateValues.serviceState,
|
||||||
|
serviceZipCode: mockStateValues.serviceZipCode,
|
||||||
|
parentAccountNumber: mockStateValues.parentAccountNumber,
|
||||||
|
isCoverageVerified: mockStateValues.isCoverageVerified,
|
||||||
|
orderPartNumbers: ["WINDSHIELDPARTNUMBER"],
|
||||||
|
orderPartTypes: ["ADAS, maybe"],
|
||||||
|
hasRecalibrationPart: true,
|
||||||
|
selectedMultiGlass: false,
|
||||||
|
selectedWindshieldGlass: true,
|
||||||
|
selectedBackGlass: false,
|
||||||
|
selectedDriverSideGlass: false,
|
||||||
|
selectedPassengerSideGlass: false
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Select multiglass > return correct experimentOrder values", () => {
|
||||||
|
// Arrange
|
||||||
|
const storeState = state;
|
||||||
|
const mockStateValues = {
|
||||||
|
vehicleYear: 1000,
|
||||||
|
vehicleMake: "CarMake",
|
||||||
|
vehicleModel: "CarModel",
|
||||||
|
vehicleStyle: "SuperCoolStyle",
|
||||||
|
isRepair: false,
|
||||||
|
numberOfChips: 0,
|
||||||
|
carId: "Gibberish",
|
||||||
|
serviceCity: "Columbus",
|
||||||
|
serviceState: "OH-IO",
|
||||||
|
serviceZipCode: 43215,
|
||||||
|
parentAccountNumber: "999999",
|
||||||
|
isCoverageVerified: false,
|
||||||
|
glassParts: [
|
||||||
|
{
|
||||||
|
partNumber: "BACKGLASS_PN",
|
||||||
|
description: "This is a back glass",
|
||||||
|
recalibrationType: null,
|
||||||
|
requiresRecalibration: false,
|
||||||
|
requiresCapabilityQuestions: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
partNumber: "DRIVERGLASS_PN",
|
||||||
|
description: "This is a driver side glass",
|
||||||
|
recalibrationType: null,
|
||||||
|
requiresRecalibration: false,
|
||||||
|
requiresCapabilityQuestions: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
partNumber: "PASSENGERGLASS_PN",
|
||||||
|
description: "This is a passenger side glass",
|
||||||
|
recalibrationType: null,
|
||||||
|
requiresRecalibration: false,
|
||||||
|
requiresCapabilityQuestions: false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
otherParts: [
|
||||||
|
|
||||||
|
],
|
||||||
|
glassToReplace: [
|
||||||
|
{
|
||||||
|
glassLocation: "Rear",
|
||||||
|
glassName: "Stationary"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
glassLocation: "Driver",
|
||||||
|
glassName: "Front"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
glassLocation: "Passenger",
|
||||||
|
glassName: "Front"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
glassLocation: "Passenger",
|
||||||
|
glassName: "Quarter"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
//Act
|
||||||
|
mutations.updateYear(storeState, mockStateValues.vehicleYear);
|
||||||
|
mutations.updateMake(storeState, mockStateValues.vehicleMake);
|
||||||
|
mutations.updateModel(storeState, mockStateValues.vehicleModel);
|
||||||
|
mutations.updateStyle(storeState, mockStateValues.vehicleStyle);
|
||||||
|
mutations.updateIsRepair(storeState, mockStateValues.isRepair);
|
||||||
|
mutations.updateNumberOfChips(storeState, mockStateValues.numberOfChips);
|
||||||
|
mutations.updateCarId(storeState, mockStateValues.carId);
|
||||||
|
mutations.updateServiceLocation(storeState, {
|
||||||
|
city: mockStateValues.serviceCity,
|
||||||
|
state: mockStateValues.serviceState,
|
||||||
|
zipCode: mockStateValues.serviceZipCode
|
||||||
|
});
|
||||||
|
mutations.updateParentAcctNumber(storeState, mockStateValues.parentAccountNumber);
|
||||||
|
mutations.updateInsuranceVerifiedStatus(storeState, mockStateValues.isCoverageVerified);
|
||||||
|
mutations.updateGlassParts(storeState, mockStateValues.glassParts);
|
||||||
|
mutations.updateOtherParts(storeState, mockStateValues.otherParts);
|
||||||
|
mutations.updateGlassToReplace(storeState, mockStateValues.glassToReplace);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
expect(getters.experimentOrder(storeState)).toEqual({
|
||||||
|
vehicleYear: mockStateValues.vehicleYear,
|
||||||
|
vehicleMake: mockStateValues.vehicleMake,
|
||||||
|
vehicleModel: mockStateValues.vehicleModel,
|
||||||
|
vehicleStyle: mockStateValues.vehicleStyle,
|
||||||
|
isRepair: mockStateValues.isRepair,
|
||||||
|
numberOfChips: mockStateValues.numberOfChips,
|
||||||
|
carId: mockStateValues.carId,
|
||||||
|
serviceCity: mockStateValues.serviceCity,
|
||||||
|
serviceState: mockStateValues.serviceState,
|
||||||
|
serviceZipCode: mockStateValues.serviceZipCode,
|
||||||
|
parentAccountNumber: mockStateValues.parentAccountNumber,
|
||||||
|
isCoverageVerified: mockStateValues.isCoverageVerified,
|
||||||
|
orderPartNumbers: ["BACKGLASS_PN", "DRIVERGLASS_PN", "PASSENGERGLASS_PN"],
|
||||||
|
orderPartTypes: [],
|
||||||
|
hasRecalibrationPart: false,
|
||||||
|
selectedMultiGlass: true,
|
||||||
|
selectedWindshieldGlass: false,
|
||||||
|
selectedBackGlass: true,
|
||||||
|
selectedDriverSideGlass: true,
|
||||||
|
selectedPassengerSideGlass: true
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
@ -2,5 +2,5 @@
|
||||||
|
|
||||||
//Blue gradient background mixin
|
//Blue gradient background mixin
|
||||||
@mixin blue-gradient {
|
@mixin blue-gradient {
|
||||||
background: linear-gradient(270deg, $blue-500 0%, $blue-700 100%);
|
background: linear-gradient(270deg, $blue 0%, $blue-800 100%);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,14 +54,14 @@ export default {
|
||||||
.btn {
|
.btn {
|
||||||
&.btn-primary {
|
&.btn-primary {
|
||||||
position: relative;
|
position: relative;
|
||||||
background: linear-gradient(270deg, $blue-500 0%, $blue-700 100%);
|
background: linear-gradient(270deg, $blue 0%, $blue-800 100%);
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: $border-radius-lg;
|
border-radius: $border-radius-lg;
|
||||||
color: $white;
|
color: $white;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
@media (hover: hover) {
|
@media (hover: hover) {
|
||||||
background: linear-gradient(270deg, $blue-500 0%, $blue-700 100%);
|
background: linear-gradient(270deg, $blue 0%, $blue-800 100%);
|
||||||
}
|
}
|
||||||
&:focus {
|
&:focus {
|
||||||
box-shadow: 0 0 0 3px, 0 0 0 5.5px $blue-700;
|
box-shadow: 0 0 0 3px, 0 0 0 5.5px $blue-700;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue