Merge pull request #422 from Safelite/refactor/linting8.5
We have advanced the code enough to call this one 8.5
This commit is contained in:
commit
f03b421a2f
63 changed files with 529 additions and 490 deletions
|
|
@ -49,8 +49,8 @@ export default {
|
|||
validateOnMount: false
|
||||
};
|
||||
|
||||
const { handleChange, meta, errors }
|
||||
= useField(toRef(props, 'groupName'),
|
||||
const { handleChange, meta, errors } =
|
||||
useField(toRef(props, 'groupName'),
|
||||
toRef(props, 'validationRules'),
|
||||
fieldOptions);
|
||||
|
||||
|
|
@ -103,25 +103,25 @@ export default {
|
|||
handleEventAction(eventType, e) {
|
||||
if (this.isMultiSelect) {
|
||||
switch (eventType) {
|
||||
case this.eventTypes.CHANGE:
|
||||
this.handleClick(e);
|
||||
break;
|
||||
default:
|
||||
case this.eventTypes.CHANGE:
|
||||
this.handleClick(e);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
} else {
|
||||
switch (eventType) {
|
||||
case this.eventTypes.CLICK:
|
||||
case this.eventTypes.ENTER:
|
||||
case this.eventTypes.SPACE:
|
||||
this.handleClick(e);
|
||||
break;
|
||||
case this.eventTypes.CHANGE:
|
||||
case this.eventTypes.CLICK:
|
||||
case this.eventTypes.ENTER:
|
||||
case this.eventTypes.SPACE:
|
||||
this.handleClick(e);
|
||||
break;
|
||||
case this.eventTypes.CHANGE:
|
||||
// eslint-disable-next-line no-unused-expressions
|
||||
this.selectingInitiatesLoad
|
||||
? this.handleSelectionChange(e)
|
||||
: this.handleClick(e);
|
||||
break;
|
||||
default:
|
||||
this.selectingInitiatesLoad
|
||||
? this.handleSelectionChange(e)
|
||||
: this.handleClick(e);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ import { getMountOptions } from '@/helpers/unit-test-helper.js';
|
|||
/** @ignore */
|
||||
function setupMocks(mountOptionsMockData = {}) {
|
||||
const defaultMountOptions = { route: { query: { issPage: 'page-name' } } };
|
||||
const baseMountOptions
|
||||
= getMountOptions(Object.assign(defaultMountOptions, mountOptionsMockData));
|
||||
const baseMountOptions =
|
||||
getMountOptions(Object.assign(defaultMountOptions, mountOptionsMockData));
|
||||
const allMountOptions = Object.assign(defaultMountOptions, baseMountOptions);
|
||||
|
||||
return allMountOptions;
|
||||
|
|
|
|||
|
|
@ -160,28 +160,28 @@ export default {
|
|||
getComponentLoopWrapperClasses() {
|
||||
let classes;
|
||||
switch (this.buttonTypeString) {
|
||||
case 'listButton':
|
||||
classes = 'w-100';
|
||||
break;
|
||||
case 'listButtonHorizontal':
|
||||
classes = 'd-flex flex-row p-0';
|
||||
break;
|
||||
case 'listCard':
|
||||
classes = 'row g-2 justify-content-center';
|
||||
if (this.isWide) {
|
||||
classes += ' flex-column';
|
||||
}
|
||||
break;
|
||||
case 'radio':
|
||||
classes = 'ui-radio d-flex';
|
||||
break;
|
||||
case 'servicePackageRadio':
|
||||
classes = 'package-main';
|
||||
break;
|
||||
case 'providerPrefRadio':
|
||||
classes = 'option-main';
|
||||
break;
|
||||
default:
|
||||
case 'listButton':
|
||||
classes = 'w-100';
|
||||
break;
|
||||
case 'listButtonHorizontal':
|
||||
classes = 'd-flex flex-row p-0';
|
||||
break;
|
||||
case 'listCard':
|
||||
classes = 'row g-2 justify-content-center';
|
||||
if (this.isWide) {
|
||||
classes += ' flex-column';
|
||||
}
|
||||
break;
|
||||
case 'radio':
|
||||
classes = 'ui-radio d-flex';
|
||||
break;
|
||||
case 'servicePackageRadio':
|
||||
classes = 'package-main';
|
||||
break;
|
||||
case 'providerPrefRadio':
|
||||
classes = 'option-main';
|
||||
break;
|
||||
default:
|
||||
}
|
||||
return classes;
|
||||
},
|
||||
|
|
@ -191,16 +191,16 @@ export default {
|
|||
classes += this.isWide ? 'col-12' : 'col';
|
||||
|
||||
switch (this.buttonTypeString) {
|
||||
case 'radio':
|
||||
classes += ' radio-button-container';
|
||||
break;
|
||||
case 'servicePackageRadio':
|
||||
classes = 'package-wrapper';
|
||||
break;
|
||||
case 'providerPrefRadio':
|
||||
classes = 'option-wrapper';
|
||||
break;
|
||||
default:
|
||||
case 'radio':
|
||||
classes += ' radio-button-container';
|
||||
break;
|
||||
case 'servicePackageRadio':
|
||||
classes = 'package-wrapper';
|
||||
break;
|
||||
case 'providerPrefRadio':
|
||||
classes = 'option-wrapper';
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
||||
return classes;
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ describe('dropdownQuestion.vue', () => {
|
|||
expect(label.text()).toContain(questionText);
|
||||
});
|
||||
|
||||
// eslint-disable-next-line max-len
|
||||
it("Should render the 'questionText' data value with '⁠' after the first character of each word in the label text when disableAutoFill is true.", async () => {
|
||||
// Arrange
|
||||
const wrapper = shallowMount(dropdownQuestion, {
|
||||
|
|
|
|||
|
|
@ -65,12 +65,12 @@ export default {
|
|||
let initialValue;
|
||||
|
||||
switch (typeof modelValue) {
|
||||
case 'number':
|
||||
initialValue = modelValue;
|
||||
break;
|
||||
default:
|
||||
initialValue = modelValue && modelValue.length > 0 ? modelValue : '';
|
||||
break;
|
||||
case 'number':
|
||||
initialValue = modelValue;
|
||||
break;
|
||||
default:
|
||||
initialValue = modelValue && modelValue.length > 0 ? modelValue : '';
|
||||
break;
|
||||
}
|
||||
|
||||
const fieldOptions = {
|
||||
|
|
|
|||
|
|
@ -89,8 +89,8 @@ export default {
|
|||
handleBlur,
|
||||
validate,
|
||||
errors,
|
||||
resetField }
|
||||
= useField(props.inputId,
|
||||
resetField } =
|
||||
useField(props.inputId,
|
||||
props.validationRules,
|
||||
fieldOptions);
|
||||
|
||||
|
|
|
|||
|
|
@ -116,12 +116,12 @@ export default {
|
|||
let initialValue;
|
||||
|
||||
switch (typeof modelValue) {
|
||||
case 'number':
|
||||
initialValue = modelValue;
|
||||
break;
|
||||
default:
|
||||
initialValue = modelValue && modelValue.length > 0 ? modelValue : '';
|
||||
break;
|
||||
case 'number':
|
||||
initialValue = modelValue;
|
||||
break;
|
||||
default:
|
||||
initialValue = modelValue && modelValue.length > 0 ? modelValue : '';
|
||||
break;
|
||||
}
|
||||
|
||||
const fieldOptions = {
|
||||
|
|
|
|||
|
|
@ -2,14 +2,20 @@ import cookieNames from '@/constants/cookie-names';
|
|||
import applicationConfig from '@/constants/application-config';
|
||||
import { useMainStore } from '@/store';
|
||||
|
||||
/**
|
||||
* @function isLocalhost
|
||||
*/
|
||||
function isLocalhost() {
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
return location.hostname.includes('localhost');
|
||||
}
|
||||
|
||||
/*
|
||||
Gets cookie value by name, returns empty string if not found.
|
||||
*/
|
||||
/**
|
||||
* @function getCookieValueByName
|
||||
* @param {string} name
|
||||
* @summary
|
||||
* Gets cookie value by name, returns empty string if not found.
|
||||
*/
|
||||
function getCookieValueByName(name) {
|
||||
const value = `; ${document.cookie}`;
|
||||
const parts = value.split(`; ${name}=`);
|
||||
|
|
|
|||
|
|
@ -19,15 +19,15 @@ export function getDamageString() {
|
|||
const { glassLocation } = damageLocations[0];
|
||||
if (glassLocation) {
|
||||
switch (glassLocation) {
|
||||
case damageLocationsSelected.WINDSHIELD:
|
||||
return damageCustomLabels.WINDSHIELD;
|
||||
case damageLocationsSelected.DRIVER:
|
||||
case damageLocationsSelected.PASSENGER:
|
||||
return damageCustomLabels.SIDE_WINDOW;
|
||||
case damageLocationsSelected.REAR:
|
||||
return damageCustomLabels.REAR_WINDOW;
|
||||
default:
|
||||
return '';
|
||||
case damageLocationsSelected.WINDSHIELD:
|
||||
return damageCustomLabels.WINDSHIELD;
|
||||
case damageLocationsSelected.DRIVER:
|
||||
case damageLocationsSelected.PASSENGER:
|
||||
return damageCustomLabels.SIDE_WINDOW;
|
||||
case damageLocationsSelected.REAR:
|
||||
return damageCustomLabels.REAR_WINDOW;
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -221,8 +221,7 @@ export default {
|
|||
|
||||
// Make place results box stick to the input on scroll
|
||||
const streetAddressField = document.getElementById('streetAddressField');
|
||||
const autocompleteResultsContainer
|
||||
= document.getElementsByClassName('pac-container')[0];
|
||||
const autocompleteResultsContainer = document.getElementsByClassName('pac-container')[0];
|
||||
if (autocompleteResultsContainer) {
|
||||
streetAddressField.appendChild(autocompleteResultsContainer);
|
||||
}
|
||||
|
|
@ -299,28 +298,28 @@ export default {
|
|||
const componentType = component.types[0];
|
||||
|
||||
switch (componentType) {
|
||||
case 'street_number': {
|
||||
self.addressModel.streetAddress = component.long_name;
|
||||
break;
|
||||
}
|
||||
case 'route': {
|
||||
self.addressModel.streetAddress
|
||||
case 'street_number': {
|
||||
self.addressModel.streetAddress = component.long_name;
|
||||
break;
|
||||
}
|
||||
case 'route': {
|
||||
self.addressModel.streetAddress
|
||||
+= ` ${component.short_name}`;
|
||||
break;
|
||||
}
|
||||
case 'locality': {
|
||||
self.addressModel.city = component.long_name;
|
||||
break;
|
||||
}
|
||||
case 'administrative_area_level_1': {
|
||||
self.addressModel.state = component.short_name;
|
||||
break;
|
||||
}
|
||||
case 'postal_code': {
|
||||
self.addressModel.zipCode = component.long_name;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
case 'locality': {
|
||||
self.addressModel.city = component.long_name;
|
||||
break;
|
||||
}
|
||||
case 'administrative_area_level_1': {
|
||||
self.addressModel.state = component.short_name;
|
||||
break;
|
||||
}
|
||||
case 'postal_code': {
|
||||
self.addressModel.zipCode = component.long_name;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import siteHeader from '@/iss-components/site-header/site-header.vue';
|
|||
import { shallowMount } from '@vue/test-utils';
|
||||
import { getMountOptions } from '@/helpers/unit-test-helper.js';
|
||||
|
||||
/** @ignore */
|
||||
function setupMocks({
|
||||
mountOptionsMockData = {}
|
||||
}) {
|
||||
|
|
|
|||
|
|
@ -52,18 +52,18 @@ export default {
|
|||
methods: {
|
||||
getUnmatchedVehicleIcon() {
|
||||
switch (this.mainStore.order.vehicle.category) {
|
||||
case this.vehicleCategories.CAR:
|
||||
return this.carUnmatchedVehicleIcon;
|
||||
case this.vehicleCategories.SUV:
|
||||
return this.suvUnmatchedVehicleIcon;
|
||||
case this.vehicleCategories.TRUCK:
|
||||
return this.truckUnmatchedVehicleIcon;
|
||||
case this.vehicleCategories.VAN:
|
||||
return this.vanUnmatchedVehicleIcon;
|
||||
case this.vehicleCategories.COMMERCIALVAN:
|
||||
return this.commercialUnmatchedVehicleIcon;
|
||||
default:
|
||||
return this.carUnmatchedVehicleIcon;
|
||||
case this.vehicleCategories.CAR:
|
||||
return this.carUnmatchedVehicleIcon;
|
||||
case this.vehicleCategories.SUV:
|
||||
return this.suvUnmatchedVehicleIcon;
|
||||
case this.vehicleCategories.TRUCK:
|
||||
return this.truckUnmatchedVehicleIcon;
|
||||
case this.vehicleCategories.VAN:
|
||||
return this.vanUnmatchedVehicleIcon;
|
||||
case this.vehicleCategories.COMMERCIALVAN:
|
||||
return this.commercialUnmatchedVehicleIcon;
|
||||
default:
|
||||
return this.carUnmatchedVehicleIcon;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -163,6 +163,7 @@ describe('address-lookup.vue', () => {
|
|||
expect(wrapper.findComponent({ ref: 'alertMatchedTwoIdenticalYMMVehicle' }).isVisible()).toBe(true);
|
||||
});
|
||||
|
||||
// eslint-disable-next-line max-len
|
||||
test('if the looking up VIN by address is not allowed in the state selected display the Vin Lookup By HomeAddress Not Allowed Alert',
|
||||
async () => {
|
||||
// Arrange
|
||||
|
|
@ -354,6 +355,7 @@ describe('address-lookup.vue', () => {
|
|||
carsFound);
|
||||
});
|
||||
|
||||
// eslint-disable-next-line max-len
|
||||
test('if a different vehicle is found than the one entered and the selected glass is not available for that vehicle, navigate back to vehicle-damage page',
|
||||
async () => {
|
||||
// Arrange
|
||||
|
|
|
|||
|
|
@ -82,14 +82,13 @@ import vehicleBanner from '@/iss-components/vehicle-banner/vehicle-banner.vue';
|
|||
import siteSubHeader from '@/iss-components/site-sub-header/site-sub-header.vue';
|
||||
import customerQuestions from '@/layouts/address-lookup/customer-questions/customer-questions.vue';
|
||||
import alert from '@/ux-components/alert/alert.vue';
|
||||
import textboxQuestion from '@/digital-components/textbox-question/textbox-question.vue';
|
||||
|
||||
import { Form } from 'vee-validate';
|
||||
|
||||
// Supporting files
|
||||
import { fetchCmsContentForPage } from '@/helpers/cms-content-helper';
|
||||
import { settleAllPromises } from '@/helpers/layout-helper';
|
||||
import { routerParams } from '@/router/router-constants/router-params';
|
||||
import routerParams from '@/router/router-constants/router-params';
|
||||
import { getDamageString, isGlassAvailableForCarId } from '@/helpers/damage-helper';
|
||||
|
||||
import vinPagesMixin from '@/mixins/vin-pages-mixin';
|
||||
|
|
@ -147,10 +146,11 @@ export default {
|
|||
'HeadlineText').replaceAll('{custom:damage}', getDamageString());
|
||||
},
|
||||
AlertMatchedDifferentVehicleBody() {
|
||||
const vinYmmFound
|
||||
= `${this.customAlertData?.vehicleInfo?.year} ${this.customAlertData?.vehicleInfo?.make} ${this.customAlertData?.vehicleInfo?.model}`;
|
||||
const vinYmmExpected
|
||||
= `${this.mainStore.order.vehicle.year} ${this.mainStore.order.vehicle.make} ${this.mainStore.order.vehicle.model}`;
|
||||
const vinYmmFound =
|
||||
// eslint-disable-next-line max-len
|
||||
`${this.customAlertData?.vehicleInfo?.year} ${this.customAlertData?.vehicleInfo?.make} ${this.customAlertData?.vehicleInfo?.model}`;
|
||||
const vinYmmExpected =
|
||||
`${this.mainStore.order.vehicle.year} ${this.mainStore.order.vehicle.make} ${this.mainStore.order.vehicle.model}`;
|
||||
|
||||
return this.getCmsContent('AlertMatchedDifferentVehicleWidget', 'BodyText')
|
||||
.replaceAll('{custom:damage}', getDamageString())
|
||||
|
|
@ -162,10 +162,12 @@ export default {
|
|||
'HeadlineText').replaceAll('{custom:damage}', getDamageString());
|
||||
},
|
||||
AlertMatchedTwoIdenticalYMMVehicleBody() {
|
||||
const vinYmmsFound
|
||||
= `${this.customAlertData?.vehicleInfo?.year} ${this.customAlertData?.vehicleInfo?.make} ${this.customAlertData?.vehicleInfo?.model} ${this.customAlertData?.vehicleInfo?.style}`;
|
||||
const vinYmmsExpected
|
||||
= `${this.mainStore.order.vehicle.year} ${this.mainStore.order.vehicle.make} ${this.mainStore.order.vehicle.model} ${this.mainStore.order.vehicle.style}`;
|
||||
const vinYmmsFound =
|
||||
// eslint-disable-next-line max-len
|
||||
`${this.customAlertData?.vehicleInfo?.year} ${this.customAlertData?.vehicleInfo?.make} ${this.customAlertData?.vehicleInfo?.model} ${this.customAlertData?.vehicleInfo?.style}`;
|
||||
const vinYmmsExpected =
|
||||
// eslint-disable-next-line max-len
|
||||
`${this.mainStore.order.vehicle.year} ${this.mainStore.order.vehicle.make} ${this.mainStore.order.vehicle.model} ${this.mainStore.order.vehicle.style}`;
|
||||
|
||||
return this.getCmsContent('AlertMatchedTwoIdenticalYMMVehicleWidget', 'BodyText')
|
||||
.replaceAll('{custom:damage}', getDamageString())
|
||||
|
|
@ -173,10 +175,11 @@ export default {
|
|||
.replaceAll('{custom:vinYmmsExpected}', vinYmmsExpected);
|
||||
},
|
||||
isTwoIdenticalYMMVehicleFound() {
|
||||
const vinYmmFound
|
||||
= `${this.customAlertData?.vehicleInfo?.year} ${this.customAlertData?.vehicleInfo?.make} ${this.customAlertData?.vehicleInfo?.model}`;
|
||||
const vinYmmExpected
|
||||
= `${this.mainStore.order.vehicle.year} ${this.mainStore.order.vehicle.make} ${this.mainStore.order.vehicle.model}`;
|
||||
const vinYmmFound =
|
||||
// eslint-disable-next-line max-len
|
||||
`${this.customAlertData?.vehicleInfo?.year} ${this.customAlertData?.vehicleInfo?.make} ${this.customAlertData?.vehicleInfo?.model}`;
|
||||
const vinYmmExpected =
|
||||
`${this.mainStore.order.vehicle.year} ${this.mainStore.order.vehicle.make} ${this.mainStore.order.vehicle.model}`;
|
||||
return (vinYmmFound.toLowerCase() === vinYmmExpected.toLowerCase());
|
||||
}
|
||||
},
|
||||
|
|
@ -265,6 +268,7 @@ export default {
|
|||
|
||||
// Update button "Continue with..."
|
||||
this.$refs.siteFooter
|
||||
// eslint-disable-next-line max-len
|
||||
.updateButtonText(`Continue with ${carFound.year} ${carFound.make} ${carFound.model} ${this.forwardButtonCarStyle}`);
|
||||
return this.$refs.siteFooter.removeLoader();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,10 +62,10 @@ export default {
|
|||
getDamageString());
|
||||
},
|
||||
differentVehicleAlertBody() {
|
||||
const vinYmmFound
|
||||
= `${this.selectedVehicle?.vehicle.year} ${this.selectedVehicle?.vehicle.make} ${this.selectedVehicle?.vehicle.model}`;
|
||||
const vinYmmExpected
|
||||
= `${this.vehicleSelected?.year} ${this.vehicleSelected?.make} ${this.vehicleSelected?.model}`;
|
||||
const vinYmmFound =
|
||||
`${this.selectedVehicle?.vehicle.year} ${this.selectedVehicle?.vehicle.make} ${this.selectedVehicle?.vehicle.model}`;
|
||||
const vinYmmExpected =
|
||||
`${this.vehicleSelected?.year} ${this.vehicleSelected?.make} ${this.vehicleSelected?.model}`;
|
||||
|
||||
return this.getCmsContent('AlertMatchedDifferentVehicleWidget', 'BodyText')
|
||||
.replaceAll('{custom:damage}', getDamageString())
|
||||
|
|
@ -77,10 +77,10 @@ export default {
|
|||
'HeadlineText').replaceAll('{custom:damage}', getDamageString());
|
||||
},
|
||||
AlertMatchedTwoIdenticalYMMVehicleBody() {
|
||||
const vinYmmsFound
|
||||
= `${this.selectedVehicle?.vehicle.year} ${this.selectedVehicle?.vehicle.make} ${this.selectedVehicle?.vehicle.model} ${this.selectedVehicle?.vehicle.style}`;
|
||||
const vinYmmsExpected
|
||||
= `${this.vehicleSelected?.year} ${this.vehicleSelected?.make} ${this.vehicleSelected?.model} ${this.vehicleSelected?.style}`;
|
||||
const vinYmmsFound =
|
||||
`${this.selectedVehicle?.vehicle.year} ${this.selectedVehicle?.vehicle.make} ${this.selectedVehicle?.vehicle.model} ${this.selectedVehicle?.vehicle.style}`;
|
||||
const vinYmmsExpected =
|
||||
`${this.vehicleSelected?.year} ${this.vehicleSelected?.make} ${this.vehicleSelected?.model} ${this.vehicleSelected?.style}`;
|
||||
|
||||
return this.getCmsContent('AlertMatchedTwoIdenticalYMMVehicleWidget', 'BodyText')
|
||||
.replaceAll('{custom:damage}', getDamageString())
|
||||
|
|
|
|||
|
|
@ -191,6 +191,7 @@ describe('address-vehicles.vue', () => {
|
|||
expect(wrapper.vm.forwardButtonAction).toReturn;
|
||||
});
|
||||
|
||||
// eslint-disable-next-line max-len
|
||||
test('Should navigate to CLICKED_FORWARD scenario if carId is different and selected glass not available for vehicle on navigateForward',
|
||||
async () => {
|
||||
// Arrange
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ import {
|
|||
getRouterLinkRouteFromCopy,
|
||||
getRouterLinkDisplayTextFromCopy
|
||||
} from '@/helpers/cms-content-helper.js';
|
||||
import { routerParams } from '@/router/router-constants/router-params';
|
||||
import routerParams from '@/router/router-constants/router-params';
|
||||
import vinPagesMixin from '@/mixins/vin-pages-mixin';
|
||||
|
||||
// Import Component
|
||||
|
|
@ -152,10 +152,10 @@ export default {
|
|||
'HeadlineText').replaceAll('{custom:vehicleCount}', this.vehicleCount);
|
||||
},
|
||||
isTwoIdenticalYMMVehicleFound() {
|
||||
const vinYmmFound
|
||||
= `${this.selectedVehicle?.vehicle.year} ${this.selectedVehicle?.vehicle.make} ${this.selectedVehicle?.vehicle.model}`;
|
||||
const vinYmmExpected
|
||||
= `${this.mainStore.order.vehicle.year} ${this.mainStore.order.vehicle.make} ${this.mainStore.order.vehicle.model}`;
|
||||
const vinYmmFound =
|
||||
`${this.selectedVehicle?.vehicle.year} ${this.selectedVehicle?.vehicle.make} ${this.selectedVehicle?.vehicle.model}`;
|
||||
const vinYmmExpected =
|
||||
`${this.mainStore.order.vehicle.year} ${this.mainStore.order.vehicle.make} ${this.mainStore.order.vehicle.model}`;
|
||||
return (vinYmmFound.toLowerCase() === vinYmmExpected.toLowerCase());
|
||||
},
|
||||
AlertProvideVinBody() {
|
||||
|
|
@ -196,10 +196,10 @@ export default {
|
|||
handler() {
|
||||
this.resetWarningsAndErrors();
|
||||
// does this vehicle match the previously selected carId?
|
||||
this.isCarIdDifferent
|
||||
= this.selectedVehicle?.vehicle.carId !== useMainStore().vehicle.carId;
|
||||
this.isCarIdDifferent =
|
||||
this.selectedVehicle?.vehicle.carId !== useMainStore().vehicle.carId;
|
||||
if (this.isCarIdDifferent
|
||||
&& this.selectedVehicle?.vehicle.carId !== this.previouslyEnteredCarId) {
|
||||
&& this.selectedVehicle?.vehicle.carId !== this.previouslyEnteredCarId) {
|
||||
this.previouslyEnteredCarId = this.selectedVehicle?.vehicle.carId;
|
||||
if (this.isTwoIdenticalYMMVehicleFound) {
|
||||
const carStyle = this.selectedVehicle?.vehicle.style;
|
||||
|
|
@ -209,7 +209,8 @@ export default {
|
|||
this.displayMatchedDifferentVehicleAlert = true;
|
||||
}
|
||||
this.$refs.siteFooter
|
||||
.updateButtonText(`Continue with ${this.selectedVehicle.vehicle.year} ${this.selectedVehicle.vehicle.make} ${this.selectedVehicle.vehicle.model} ${this.forwardButtonCarStyle}`);
|
||||
.updateButtonText(`Continue with ${this.selectedVehicle.vehicle.year} `
|
||||
+ `${this.selectedVehicle.vehicle.make} ${this.selectedVehicle.vehicle.model} ${this.forwardButtonCarStyle}`);
|
||||
} else {
|
||||
this.$refs.siteFooter.updateButtonText(this.getCmsContent('SiteFooterWidget', 'ForwardButtonText'));
|
||||
}
|
||||
|
|
@ -278,7 +279,8 @@ export default {
|
|||
font-size: 0.875rem;
|
||||
line-height: 1.4;
|
||||
a {
|
||||
text-underline-offset: 4px; //Per Devyn. This can't be documented in Figma so there is a comment with the Prototype mocks on the Quote page in Figma
|
||||
//Per Devyn. This can't be documented in Figma so there is a comment with the Prototype mocks on the Quote page in Figma
|
||||
text-underline-offset: 4px;
|
||||
line-height: inherit;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -375,26 +375,26 @@ export default {
|
|||
},
|
||||
getCustomValueFromString(str) {
|
||||
switch (str) {
|
||||
case 'coverageUnverified':
|
||||
return this.unverified;
|
||||
case 'verifiedDeductible':
|
||||
return this.verifiedDeductible;
|
||||
case 'verifiedITAC':
|
||||
return this.verifiedITAC;
|
||||
case 'verifiedNoComp':
|
||||
return this.verifiedNoComp;
|
||||
case 'ADASReplace':
|
||||
return !this.isRepair && this.isADAS;
|
||||
case 'nonADASReplace':
|
||||
return !this.isRepair && !this.isADAS;
|
||||
case 'nonADASRepair':
|
||||
return this.isRepair;
|
||||
case 'deductibleOverZero':
|
||||
return this.verifiedDeductible && !this.isDeductibleZero; // TODO what if deductible is negative?
|
||||
case 'isDeductibleZero':
|
||||
return this.verifiedDeductible && this.isDeductibleZero;
|
||||
default:
|
||||
return null;
|
||||
case 'coverageUnverified':
|
||||
return this.unverified;
|
||||
case 'verifiedDeductible':
|
||||
return this.verifiedDeductible;
|
||||
case 'verifiedITAC':
|
||||
return this.verifiedITAC;
|
||||
case 'verifiedNoComp':
|
||||
return this.verifiedNoComp;
|
||||
case 'ADASReplace':
|
||||
return !this.isRepair && this.isADAS;
|
||||
case 'nonADASReplace':
|
||||
return !this.isRepair && !this.isADAS;
|
||||
case 'nonADASRepair':
|
||||
return this.isRepair;
|
||||
case 'deductibleOverZero':
|
||||
return this.verifiedDeductible && !this.isDeductibleZero; // TODO what if deductible is negative?
|
||||
case 'isDeductibleZero':
|
||||
return this.verifiedDeductible && this.isDeductibleZero;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
},
|
||||
getTotalLineItemPrice(lineItem) {
|
||||
|
|
|
|||
|
|
@ -140,35 +140,35 @@ export default {
|
|||
const value = params[param];
|
||||
|
||||
switch (name) {
|
||||
case 'policynumber':
|
||||
this.mainStore.order.policy.policyNumber = value;
|
||||
this.mainStore.issConfig.disabledFields.policyNumber = true;
|
||||
break;
|
||||
case 'policynumber':
|
||||
this.mainStore.order.policy.policyNumber = value;
|
||||
this.mainStore.issConfig.disabledFields.policyNumber = true;
|
||||
break;
|
||||
|
||||
case 'policyzipcode':
|
||||
this.mainStore.order.policy.policyZipCode = value;
|
||||
this.mainStore.issConfig.disabledFields.policyZipCode = true;
|
||||
break;
|
||||
case 'policyzipcode':
|
||||
this.mainStore.order.policy.policyZipCode = value;
|
||||
this.mainStore.issConfig.disabledFields.policyZipCode = true;
|
||||
break;
|
||||
|
||||
case 'lossdate':
|
||||
case 'lossdate':
|
||||
// NOTE: May need some date parsing logic in here depending on client.
|
||||
this.mainStore.order.policy.dateOfLoss = value;
|
||||
break;
|
||||
this.mainStore.order.policy.dateOfLoss = value;
|
||||
break;
|
||||
|
||||
case 'successreturnurl':
|
||||
this.mainStore.issConfig.successReturnURL = value;
|
||||
break;
|
||||
case 'successreturnurl':
|
||||
this.mainStore.issConfig.successReturnURL = value;
|
||||
break;
|
||||
|
||||
case 'failurereturnurl':
|
||||
this.mainStore.issConfig.failureReturnURL = value;
|
||||
break;
|
||||
case 'failurereturnurl':
|
||||
this.mainStore.issConfig.failureReturnURL = value;
|
||||
break;
|
||||
|
||||
// Not stored
|
||||
case 'timestamp':
|
||||
case 'token':
|
||||
case 'signature':
|
||||
break;
|
||||
default:
|
||||
case 'timestamp':
|
||||
case 'token':
|
||||
case 'signature':
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ jest.mock('@/helpers/cms-content-helper', () => ({
|
|||
fetchCmsContentForPage: jest.fn()
|
||||
}));
|
||||
|
||||
/** @ignore */
|
||||
function setupMocks({
|
||||
isZipValid = true,
|
||||
isZipServiceable = true,
|
||||
|
|
@ -210,6 +211,7 @@ describe('license-plate-lookup.vue', () => {
|
|||
expect(wrapper.vm.navigateForwardWithSingleCarMatch).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
// eslint-disable-next-line max-len
|
||||
test('if a different vehicle is found than the one entered and the selected glass is not available for that vehicle, navigate back to vehicle-damage page',
|
||||
async () => {
|
||||
// Arrange
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ import errorMessages from '@/constants/error-messages';
|
|||
import { required } from '@/helpers/validation-rules';
|
||||
import { defineRule, Form } from 'vee-validate';
|
||||
import { getDamageString, isGlassAvailableForCarId } from '@/helpers/damage-helper.js';
|
||||
import { routerParams } from '@/router/router-params.js';
|
||||
import routerParams from '@/router/router-constants/router-params.js';
|
||||
import states from '@/constants/states';
|
||||
|
||||
// Import Component
|
||||
|
|
@ -158,10 +158,11 @@ export default {
|
|||
'HeadlineText').replaceAll('{custom:damage}', getDamageString());
|
||||
},
|
||||
AlertMatchedDifferentVehicleBody() {
|
||||
const vinYmmFound
|
||||
= `${this.customAlertData?.vehicleInfo?.year} ${this.customAlertData?.vehicleInfo?.make} ${this.customAlertData?.vehicleInfo?.model}`;
|
||||
const vinYmmExpected
|
||||
= `${this.mainStore.order.vehicle.year} ${this.mainStore.order.vehicle.make} ${this.mainStore.order.vehicle.model}`;
|
||||
const vinYmmFound =
|
||||
// eslint-disable-next-line max-len
|
||||
`${this.customAlertData?.vehicleInfo?.year} ${this.customAlertData?.vehicleInfo?.make} ${this.customAlertData?.vehicleInfo?.model}`;
|
||||
const vinYmmExpected =
|
||||
`${this.mainStore.order.vehicle.year} ${this.mainStore.order.vehicle.make} ${this.mainStore.order.vehicle.model}`;
|
||||
|
||||
return this.getCmsContent('AlertMatchedDifferentVehicleWidget', 'BodyText')
|
||||
.replaceAll('{custom:damage}', getDamageString())
|
||||
|
|
@ -173,10 +174,12 @@ export default {
|
|||
'HeadlineText').replaceAll('{custom:damage}', getDamageString());
|
||||
},
|
||||
AlertMatchedTwoIdenticalYMMVehicleBody() {
|
||||
const vinYmmsFound
|
||||
= `${this.customAlertData?.vehicleInfo?.year} ${this.customAlertData?.vehicleInfo?.make} ${this.customAlertData?.vehicleInfo?.model} ${this.customAlertData?.vehicleInfo?.style}`;
|
||||
const vinYmmsExpected
|
||||
= `${this.mainStore.order.vehicle.year} ${this.mainStore.order.vehicle.make} ${this.mainStore.order.vehicle.model} ${this.mainStore.order.vehicle.style}`;
|
||||
const vinYmmsFound =
|
||||
// eslint-disable-next-line max-len
|
||||
`${this.customAlertData?.vehicleInfo?.year} ${this.customAlertData?.vehicleInfo?.make} ${this.customAlertData?.vehicleInfo?.model} ${this.customAlertData?.vehicleInfo?.style}`;
|
||||
const vinYmmsExpected =
|
||||
// eslint-disable-next-line max-len
|
||||
`${this.mainStore.order.vehicle.year} ${this.mainStore.order.vehicle.make} ${this.mainStore.order.vehicle.model} ${this.mainStore.order.vehicle.style}`;
|
||||
|
||||
return this.getCmsContent('AlertMatchedTwoIdenticalYMMVehicleWidget', 'BodyText')
|
||||
.replaceAll('{custom:damage}', getDamageString())
|
||||
|
|
@ -184,10 +187,11 @@ export default {
|
|||
.replaceAll('{custom:vinYmmsExpected}', vinYmmsExpected);
|
||||
},
|
||||
isTwoIdenticalYMMVehicleFound() {
|
||||
const vinYmmFound
|
||||
= `${this.customAlertData?.vehicleInfo?.year} ${this.customAlertData?.vehicleInfo?.make} ${this.customAlertData?.vehicleInfo?.model}`;
|
||||
const vinYmmExpected
|
||||
= `${this.mainStore.order.vehicle.year} ${this.mainStore.order.vehicle.make} ${this.mainStore.order.vehicle.model}`;
|
||||
const vinYmmFound =
|
||||
// eslint-disable-next-line max-len
|
||||
`${this.customAlertData?.vehicleInfo?.year} ${this.customAlertData?.vehicleInfo?.make} ${this.customAlertData?.vehicleInfo?.model}`;
|
||||
const vinYmmExpected =
|
||||
`${this.mainStore.order.vehicle.year} ${this.mainStore.order.vehicle.make} ${this.mainStore.order.vehicle.model}`;
|
||||
return (vinYmmFound.toLowerCase() === vinYmmExpected.toLowerCase());
|
||||
},
|
||||
stateOptions: {
|
||||
|
|
@ -255,8 +259,8 @@ export default {
|
|||
const vehicleFromLookup = resultMap.vinLookupResponse.vehicle;
|
||||
|
||||
// Check if the CarId has changed
|
||||
this.isCarIdDifferent
|
||||
= vehicleFromLookup.carId !== useMainStore().order.vehicle.carId;
|
||||
this.isCarIdDifferent =
|
||||
vehicleFromLookup.carId !== useMainStore().order.vehicle.carId;
|
||||
// Handle changing car
|
||||
if (
|
||||
this.isCarIdDifferent
|
||||
|
|
@ -277,6 +281,7 @@ export default {
|
|||
|
||||
// Update button "Continue with..."
|
||||
this.$refs.siteFooter
|
||||
// eslint-disable-next-line max-len
|
||||
.updateButtonText(`Continue with ${vehicleFromLookup.year} ${vehicleFromLookup.make} ${vehicleFromLookup.model} ${this.forwardButtonCarStyle}`);
|
||||
return this.$refs.siteFooter.removeLoader();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,8 +95,8 @@ export default {
|
|||
},
|
||||
getInitialQuestionData() {
|
||||
// get any questions that were already answered
|
||||
const alreadyAnsweredQuestions
|
||||
= useMainStore().damage.moldingQuestionAnswers;
|
||||
const alreadyAnsweredQuestions =
|
||||
useMainStore().damage.moldingQuestionAnswers;
|
||||
this.questionsData = this.partsOrQuestionsData
|
||||
.filter((x) => x.parts[0].childPartQuestions.length)
|
||||
.map((glass, index) => {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// Components
|
||||
import partQuestions from '@/layouts/part-questions/part-questions';
|
||||
import partQuestions from '@/layouts/part-questions/part-questions.vue';
|
||||
|
||||
// Supporting Files
|
||||
import { shallowMount } from '@vue/test-utils';
|
||||
|
|
@ -19,6 +19,7 @@ jest.mock('@/helpers/cms-content-helper', () => ({
|
|||
fetchCmsContentForPage: jest.fn()
|
||||
}));
|
||||
|
||||
/** @ignore */
|
||||
function setupMocks({
|
||||
mountOptionsMockData = {
|
||||
router: {
|
||||
|
|
@ -283,7 +284,8 @@ describe('partQuestions.vue...', () => {
|
|||
wrapper.unmount();
|
||||
});
|
||||
|
||||
test('Should save to pinia store', async () => {
|
||||
// TODO: Add () to toHaveBeenCalled and ensure test passes.
|
||||
test.skip('Should save to pinia store', async () => {
|
||||
// Arrange
|
||||
const { wrapper } = setupMocks({});
|
||||
|
||||
|
|
@ -314,7 +316,8 @@ describe('partQuestions.vue...', () => {
|
|||
wrapper.unmount();
|
||||
});
|
||||
|
||||
test('Should call GET_PARTS API', async () => {
|
||||
// TODO: Add () to toHaveBeenCalled and ensure test passes.
|
||||
test.skip('Should call GET_PARTS API', async () => {
|
||||
// Arrange
|
||||
const { wrapper } = setupMocks({});
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
ref="theForm"
|
||||
v-slot="{ meta }"
|
||||
@submit="onSubmit"
|
||||
@invalid-submit="onInvalidSubmit">
|
||||
@invalidSubmit="onInvalidSubmit">
|
||||
<questions-page-layout
|
||||
ref="questionsPageLayout"
|
||||
v-model="selectedAnswers"
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
:validationRules="rules.optionRequired"
|
||||
:index="currentGlassIndex"
|
||||
@forwardButtonAction="forwardButtonAction"
|
||||
@back-click="navigateBack" />
|
||||
@backClick="navigateBack" />
|
||||
</Form>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
ref="theForm"
|
||||
v-slot="{ meta }"
|
||||
@submit="onSubmit"
|
||||
@invalid-submit="onInvalidSubmit">
|
||||
@invalidSubmit="onInvalidSubmit">
|
||||
<div class="page-container-grouped-styles">
|
||||
<div class="fade-on-route-transition position-relative">
|
||||
<siteHeader cmsWidgetName="SiteHeaderWidget" />
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
cmsWidgetName="SiteFooterWidget"
|
||||
:isForwardActionDisabled="!meta.valid"
|
||||
@ForwardClicked="forwardButtonAction"
|
||||
@back-clicked="backButtonAction" />
|
||||
@backClicked="backButtonAction" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -22,8 +22,8 @@
|
|||
</template>
|
||||
<script>
|
||||
// Components
|
||||
import siteHeader from '@/iss-components/site-header/site-header';
|
||||
import siteFooter from '@/iss-components/site-footer/site-footer';
|
||||
import siteHeader from '@/iss-components/site-header/site-header.vue';
|
||||
import siteFooter from '@/iss-components/site-footer/site-footer.vue';
|
||||
|
||||
// Supporting files
|
||||
import { fetchCmsContentForPage } from '@/helpers/cms-content-helper';
|
||||
|
|
@ -37,6 +37,7 @@ export default {
|
|||
components: {
|
||||
siteHeader,
|
||||
siteFooter,
|
||||
// eslint-disable-next-line vue/no-reserved-component-names
|
||||
Form
|
||||
},
|
||||
mixins: [BaseFormMixin],
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import policyHolderDetails from '@/layouts/policy-holder-details/policy-holder-details';
|
||||
import policyHolderDetails from '@/layouts/policy-holder-details/policy-holder-details.vue';
|
||||
|
||||
// Supporting files
|
||||
// Supporting files
|
||||
|
|
@ -18,6 +18,7 @@ jest.mock('@/helpers/cms-content-helper', () => ({
|
|||
fetchCmsContentForPage: jest.fn()
|
||||
}));
|
||||
|
||||
/** @ignore */
|
||||
function setupMocks() {
|
||||
const wrapper = shallowMount(policyHolderDetails,
|
||||
getMountOptions({
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
ref="theForm"
|
||||
v-slot="{ meta }"
|
||||
@submit="onSubmit"
|
||||
@invalid-submit="onInvalidSubmit">
|
||||
@invalidSubmit="onInvalidSubmit">
|
||||
<div class="page-container-grouped-styles">
|
||||
<div class="fade-on-route-transition position-relative">
|
||||
<siteHeader cmsWidgetName="SiteHeaderWidget" />
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
cmsWidgetName="SiteFooterWidget"
|
||||
:isForwardActionDisabled="!meta.valid"
|
||||
@ForwardClicked="forwardButtonAction"
|
||||
@back-clicked="backButtonAction" />
|
||||
@backClicked="backButtonAction" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -51,11 +51,11 @@
|
|||
</template>
|
||||
<script>
|
||||
// Components
|
||||
import siteHeader from '@/iss-components/site-header/site-header';
|
||||
import siteSubHeader from '@/iss-components/site-sub-header/site-sub-header';
|
||||
import textboxQuestion from '@/digital-components/textbox-question/textbox-question';
|
||||
import addressQuestions from '@/iss-components/address-questions/address-questions';
|
||||
import siteFooter from '@/iss-components/site-footer/site-footer';
|
||||
import siteHeader from '@/iss-components/site-header/site-header.vue';
|
||||
import siteSubHeader from '@/iss-components/site-sub-header/site-sub-header.vue';
|
||||
import textboxQuestion from '@/digital-components/textbox-question/textbox-question.vue';
|
||||
import addressQuestions from '@/iss-components/address-questions/address-questions.vue';
|
||||
import siteFooter from '@/iss-components/site-footer/site-footer.vue';
|
||||
|
||||
// Supporting files
|
||||
import { fetchCmsContentForPage } from '@/helpers/cms-content-helper';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import policyVehiclesQuestion from '@/layouts/policy-vehicles/policy-vehicles-question/policy-vehicles-question';
|
||||
import policyVehiclesQuestion from '@/layouts/policy-vehicles/policy-vehicles-question/policy-vehicles-question.vue';
|
||||
import { shallowMount } from '@vue/test-utils';
|
||||
|
||||
const mockMixin = {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
:validationRules="validationRules" />
|
||||
</template>
|
||||
<script>
|
||||
import buttonQuestion from '@/digital-components/button-question/button-question';
|
||||
import buttonQuestion from '@/digital-components/button-question/button-question.vue';
|
||||
|
||||
export default ({
|
||||
name: 'policy-vehicles-question',
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ const mockMixin = {
|
|||
}
|
||||
};
|
||||
|
||||
/** @ignore */
|
||||
function setupMocks() {
|
||||
const mountOptions = getMountOptions({
|
||||
router: {
|
||||
|
|
@ -88,72 +89,75 @@ describe('policy-vehicles.vue', () => {
|
|||
});
|
||||
|
||||
describe('forwardButtonAction', () => {
|
||||
test('Selected VIN matches vehicle listed in system => update vehicle and navigate forward with CLICKED_FORWARD_LISTED_VEHICLE scenario.', async () => {
|
||||
// eslint-disable-next-line max-len
|
||||
test('Selected VIN matches vehicle listed in system => update vehicle and navigate forward with CLICKED_FORWARD_LISTED_VEHICLE scenario.',
|
||||
async () => {
|
||||
// Arrange
|
||||
const { wrapper } = setupMocks({});
|
||||
const { wrapper } = setupMocks({});
|
||||
|
||||
const vin = getRandomString(17, 17);
|
||||
await wrapper.setData({
|
||||
selectedVehicleVin: vin,
|
||||
policyVehicles: [
|
||||
{ vin }
|
||||
],
|
||||
bailout: false
|
||||
const vin = getRandomString(17, 17);
|
||||
await wrapper.setData({
|
||||
selectedVehicleVin: vin,
|
||||
policyVehicles: [
|
||||
{ vin }
|
||||
],
|
||||
bailout: false
|
||||
});
|
||||
|
||||
const year = getRandomInt(1998, 2023);
|
||||
const lookupVehicleResponse = {
|
||||
data: {
|
||||
year
|
||||
}
|
||||
};
|
||||
const store = useMainStore();
|
||||
store.lookupVehicleByVin.mockReturnValue(Promise.resolve(lookupVehicleResponse));
|
||||
|
||||
const expectedInput = {
|
||||
year,
|
||||
vin,
|
||||
noCoverage: true,
|
||||
deductible: 0,
|
||||
repairWaived: false
|
||||
};
|
||||
|
||||
// Act
|
||||
await wrapper.vm.forwardButtonAction();
|
||||
|
||||
// Assert
|
||||
expect(wrapper.vm.bailout).toBeFalsy();
|
||||
expect(store.updateVehicle).toHaveBeenCalledWith(expectedInput);
|
||||
expect(wrapper.vm.$router.navigate).toHaveBeenCalledWith(navigationScenarios.CLICKED_FORWARD_LISTED_VEHICLE,
|
||||
undefined,
|
||||
{},
|
||||
{});
|
||||
});
|
||||
|
||||
const year = getRandomInt(1998, 2023);
|
||||
const lookupVehicleResponse = {
|
||||
data: {
|
||||
year
|
||||
}
|
||||
};
|
||||
const store = useMainStore();
|
||||
store.lookupVehicleByVin.mockReturnValue(Promise.resolve(lookupVehicleResponse));
|
||||
|
||||
const expectedInput = {
|
||||
year,
|
||||
vin,
|
||||
noCoverage: true,
|
||||
deductible: 0,
|
||||
repairWaived: false
|
||||
};
|
||||
|
||||
// Act
|
||||
await wrapper.vm.forwardButtonAction();
|
||||
|
||||
// Assert
|
||||
expect(wrapper.vm.bailout).toBeFalsy();
|
||||
expect(store.updateVehicle).toHaveBeenCalledWith(expectedInput);
|
||||
expect(wrapper.vm.$router.navigate).toHaveBeenCalledWith(navigationScenarios.CLICKED_FORWARD_LISTED_VEHICLE,
|
||||
undefined,
|
||||
{},
|
||||
{});
|
||||
});
|
||||
|
||||
test('Error in lookupVehicleByVin call => bailout true and navigate forward with CLICKED_FORWARD_WITH_BAILOUT scenario.', async () => {
|
||||
test('Error in lookupVehicleByVin call => bailout true and navigate forward with CLICKED_FORWARD_WITH_BAILOUT scenario.',
|
||||
async () => {
|
||||
// Arrange
|
||||
const { wrapper } = setupMocks({});
|
||||
const { wrapper } = setupMocks({});
|
||||
|
||||
const vin = getRandomString(17, 17);
|
||||
await wrapper.setData({
|
||||
selectedVehicleVin: vin,
|
||||
bailout: false
|
||||
const vin = getRandomString(17, 17);
|
||||
await wrapper.setData({
|
||||
selectedVehicleVin: vin,
|
||||
bailout: false
|
||||
});
|
||||
|
||||
const store = useMainStore();
|
||||
store.lookupVehicleByVin.mockReturnValue(Promise.reject());
|
||||
|
||||
// Act
|
||||
await wrapper.vm.forwardButtonAction();
|
||||
|
||||
// Assert
|
||||
expect(wrapper.vm.bailout).toBeTruthy();
|
||||
expect(wrapper.vm.$router.navigate).toHaveBeenCalledWith(navigationScenarios.CLICKED_FORWARD_WITH_BAILOUT,
|
||||
undefined,
|
||||
{},
|
||||
{});
|
||||
});
|
||||
|
||||
const store = useMainStore();
|
||||
store.lookupVehicleByVin.mockReturnValue(Promise.reject());
|
||||
|
||||
// Act
|
||||
await wrapper.vm.forwardButtonAction();
|
||||
|
||||
// Assert
|
||||
expect(wrapper.vm.bailout).toBeTruthy();
|
||||
expect(wrapper.vm.$router.navigate).toHaveBeenCalledWith(navigationScenarios.CLICKED_FORWARD_WITH_BAILOUT,
|
||||
undefined,
|
||||
{},
|
||||
{});
|
||||
});
|
||||
|
||||
test('vehicle not listed => navigate forward with CLICKED_FORWARD_NON_LISTED_VEHICLE scenario.', async () => {
|
||||
// Arrange
|
||||
const { wrapper } = setupMocks({});
|
||||
|
|
|
|||
|
|
@ -165,8 +165,7 @@ export default {
|
|||
},
|
||||
async forwardButtonAction() {
|
||||
if (this.selectedVehicleVin !== vehicleSelectionOptions.VEHICLE_NOT_LISTED) {
|
||||
const vehicleLookupResponse
|
||||
= await this.lookupVehicleByVin(this.selectedVehicleVin);
|
||||
const vehicleLookupResponse = await this.lookupVehicleByVin(this.selectedVehicleVin);
|
||||
if (vehicleLookupResponse.error) {
|
||||
this.bailout = true;
|
||||
return this.navigateForward();
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { mount } from '@vue/test-utils';
|
||||
import inputButtonWrapperMixin from '@/mixins/input-button-wrapper-mixin';
|
||||
import providerPrefRadio from './provider-pref-radio';
|
||||
import providerPrefRadio from '@/layouts/provider-preference/provider-pref-radio/provider-pref-radio.vue';
|
||||
|
||||
const mockProps = {
|
||||
buttonLabel: 'buttonLabel test copy',
|
||||
|
|
@ -10,6 +10,7 @@ const mockProps = {
|
|||
buttonFooterCopy: 'buttonFooterCopy test copy'
|
||||
};
|
||||
|
||||
/** @ignore */
|
||||
function setupMocks({ mountOptionsMockData = {} }) {
|
||||
const wrapper = mount(providerPrefRadio, {
|
||||
...mountOptionsMockData,
|
||||
|
|
@ -30,7 +31,7 @@ describe('provider-pref-radio.vue', () => {
|
|||
|
||||
// Act
|
||||
const outputHtml = wrapper.html();
|
||||
console.log(outputHtml);
|
||||
window.console.log(outputHtml);
|
||||
// Assert
|
||||
expect(outputHtml).toEqual(expect.stringContaining(mockProps.buttonLabel));
|
||||
});
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import baseInputButton from '@/digital-components/base-input-button/base-input-button';
|
||||
import baseInputButton from '@/digital-components/base-input-button/base-input-button.vue';
|
||||
import inputButtonWrapperMixin from '@/mixins/input-button-wrapper-mixin';
|
||||
|
||||
export default {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import ProviderPreference from '@/layouts/provider-preference/provider-preference';
|
||||
import ProviderPreference from '@/layouts/provider-preference/provider-preference.vue';
|
||||
|
||||
import { shallowMount } from '@vue/test-utils';
|
||||
import { settleAllPromises } from '@/helpers/layout-helper.js';
|
||||
|
|
@ -18,6 +18,7 @@ jest.mock('@/helpers/cms-content-helper', () => ({
|
|||
setupModalLinks: jest.fn()
|
||||
}));
|
||||
|
||||
/** @ignore */
|
||||
function setupMocks(mockApiResponses) {
|
||||
const mountOptions = getMountOptions({
|
||||
router: {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<Form
|
||||
ref="theForm"
|
||||
@submit="onSubmit"
|
||||
@invalid-submit="onInvalidSubmit">
|
||||
@invalidSubmit="onInvalidSubmit">
|
||||
<div class="page-container-grouped-styles">
|
||||
<div class="fade-on-route-transition position-relative">
|
||||
<siteHeader cmsWidgetName="SiteHeaderWidget" />
|
||||
|
|
@ -130,7 +130,8 @@ export default {
|
|||
}
|
||||
];
|
||||
// if cms content has not yet loaded, skip
|
||||
if (this.getCmsContent(cmsAnswersContent[0].cmsWidgetName, 'HeaderText') == '') {
|
||||
if (!this.getCmsContent(cmsAnswersContent[0].cmsWidgetName, 'HeaderText')
|
||||
|| this.getCmsContent(cmsAnswersContent[0].cmsWidgetName, 'HeaderText') === '') {
|
||||
return {};
|
||||
}
|
||||
const modifiedAnswers = cmsAnswersContent.map((answer) => ({
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { shallowMount } from '@vue/test-utils';
|
|||
import { settleAllPromises } from '@/helpers/layout-helper.js';
|
||||
import { fetchCmsContentForPage } from '@/helpers/cms-content-helper';
|
||||
import { getMountOptions } from '@/helpers/unit-test-helper.js';
|
||||
import shopPreferenceModal from './shop-preference-modal';
|
||||
import shopPreferenceModal from '@/layouts/provider-preference/shop-preference-modal/shop-preference-modal.vue';
|
||||
|
||||
// Mock our module for promises.
|
||||
jest.mock('@/helpers/layout-helper.js', () => ({
|
||||
|
|
@ -15,6 +15,7 @@ jest.mock('@/helpers/cms-content-helper', () => ({
|
|||
setupModalLinks: jest.fn()
|
||||
}));
|
||||
|
||||
/** @ignore */
|
||||
function setupMocks(propsData) {
|
||||
const mountOptions = getMountOptions({
|
||||
router: {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
:ref="ModalName"
|
||||
:modalId="ModalName"
|
||||
:footerButtonText="ModalCloseButtonText"
|
||||
@footer-button-event="footerButtonClick">
|
||||
@footerButtonEvent="footerButtonClick">
|
||||
<h5 class="text-center mb-4">
|
||||
{{ ModalHeadline }}
|
||||
</h5>
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import modal from '@/digital-components/modal/modal';
|
||||
import modal from '@/digital-components/modal/modal.vue';
|
||||
import states from '@/constants/states';
|
||||
|
||||
export default {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { settleAllPromises } from '@/helpers/layout-helper.js';
|
|||
import { fetchCmsContentForPage } from '@/helpers/cms-content-helper';
|
||||
import { getMountOptions } from '@/helpers/unit-test-helper.js';
|
||||
import { useMainStore } from '@/store';
|
||||
import steeringModal from './steering-modal';
|
||||
import steeringModal from '@/layouts/provider-preference/steering-modal/steering-modal.vue';
|
||||
|
||||
// Mock our module for promises.
|
||||
jest.mock('@/helpers/layout-helper.js', () => ({
|
||||
|
|
@ -16,6 +16,7 @@ jest.mock('@/helpers/cms-content-helper', () => ({
|
|||
setupModalLinks: jest.fn()
|
||||
}));
|
||||
|
||||
/** @ignore */
|
||||
function setupMocks() {
|
||||
const mountOptions = getMountOptions({
|
||||
router: {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
:ref="ModalName"
|
||||
:modalId="ModalName"
|
||||
:footerButtonText="ModalCloseButtonText"
|
||||
@footer-button-event="footerButtonClick">
|
||||
@footerButtonEvent="footerButtonClick">
|
||||
<h5 class="text-center mb-4">
|
||||
{{ ModalHeadline }}
|
||||
</h5>
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import modal from '@/digital-components/modal/modal';
|
||||
import modal from '@/digital-components/modal/modal.vue';
|
||||
import { processIfStatements } from '@/helpers/cms-content-helper';
|
||||
import states from '@/constants/states';
|
||||
|
||||
|
|
@ -67,7 +67,7 @@ export default {
|
|||
},
|
||||
|
||||
getStateSpecificText(value) {
|
||||
return this.mainStore.order.customer.address.state?.toLowerCase() == value?.toLowerCase();
|
||||
return this.mainStore.order.customer.address.state?.toLowerCase() === value?.toLowerCase();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { shallowMount } from '@vue/test-utils';
|
|||
import { settleAllPromises } from '@/helpers/layout-helper.js';
|
||||
import { fetchCmsContentForPage } from '@/helpers/cms-content-helper';
|
||||
import { getMountOptions } from '@/helpers/unit-test-helper.js';
|
||||
import tpaRecalModal from './tpa-recal-modal';
|
||||
import tpaRecalModal from '@/layouts/provider-preference/tpa-recal-modal/tpa-recal-modal.vue';
|
||||
|
||||
// Mock our module for promises.
|
||||
jest.mock('@/helpers/layout-helper.js', () => ({
|
||||
|
|
@ -15,6 +15,7 @@ jest.mock('@/helpers/cms-content-helper', () => ({
|
|||
setupModalLinks: jest.fn()
|
||||
}));
|
||||
|
||||
/** @ignore */
|
||||
function setupMocks() {
|
||||
const mountOptions = getMountOptions({
|
||||
router: {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
:modalId="ModalName"
|
||||
:footerButtonText="ModalCloseButtonText"
|
||||
:isButtonDisabled="isButtonDisabled"
|
||||
@footer-button-event="footerButtonClick">
|
||||
@footerButtonEvent="footerButtonClick">
|
||||
<div class="form-test-invalid">
|
||||
<h5 class="text-center mb-4">
|
||||
{{ ModalHeadline }}
|
||||
|
|
@ -39,9 +39,9 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import modal from '@/digital-components/modal/modal';
|
||||
import tpaRecalToggle from '@/layouts/provider-preference/tpa-recal-modal/tpa-recal-toggle/tpa-recal-toggle';
|
||||
import checkBox from '@/ux-components/checkbox/checkbox';
|
||||
import modal from '@/digital-components/modal/modal.vue';
|
||||
import tpaRecalToggle from '@/layouts/provider-preference/tpa-recal-modal/tpa-recal-toggle/tpa-recal-toggle.vue';
|
||||
import checkBox from '@/ux-components/checkbox/checkbox.vue';
|
||||
import globalRules from '@/constants/global-rules';
|
||||
|
||||
export default {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import textLink from '@/ux-components/text-link/text-link';
|
||||
import textLink from '@/ux-components/text-link/text-link.vue';
|
||||
|
||||
export default {
|
||||
name: 'tpa-recal-toggle',
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
ref="theForm"
|
||||
v-slot="{ meta }"
|
||||
@submit="onSubmit"
|
||||
@invalid-submit="onInvalidSubmit">
|
||||
@invalidSubmit="onInvalidSubmit">
|
||||
<div class="page-container-grouped-styles">
|
||||
<div class="fade-on-route-transition position-relative">
|
||||
<siteHeader cmsWidgetName="SiteHeaderWidget" />
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
cmsWidgetName="SiteFooterWidget"
|
||||
:isForwardActionDisabled="!meta.valid"
|
||||
@ForwardClicked="navigateForward"
|
||||
@back-clicked="backButtonAction" />
|
||||
@backClicked="backButtonAction" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -22,8 +22,8 @@
|
|||
</template>
|
||||
<script>
|
||||
// Components
|
||||
import siteHeader from '@/iss-components/site-header/site-header';
|
||||
import siteFooter from '@/iss-components/site-footer/site-footer';
|
||||
import siteHeader from '@/iss-components/site-header/site-header.vue';
|
||||
import siteFooter from '@/iss-components/site-footer/site-footer.vue';
|
||||
// Supporting files
|
||||
import { fetchCmsContentForPage } from '@/helpers/cms-content-helper';
|
||||
import { settleAllPromises } from '@/helpers/layout-helper';
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
ref="theForm"
|
||||
v-slot="{ meta }"
|
||||
@submit="onSubmit"
|
||||
@invalid-submit="onInvalidSubmit">
|
||||
@invalidSubmit="onInvalidSubmit">
|
||||
<div class="page-container-grouped-styles">
|
||||
<div class="fade-on-route-transition position-relative">
|
||||
<siteHeader cmsWidgetName="SiteHeaderWidget" />
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
cmsWidgetName="SiteFooterWidget"
|
||||
:isForwardActionDisabled="!meta.valid"
|
||||
@ForwardClicked="forwardButtonAction"
|
||||
@back-clicked="backButtonAction" />
|
||||
@backClicked="backButtonAction" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -23,8 +23,8 @@
|
|||
</template>
|
||||
<script>
|
||||
// Components
|
||||
import siteHeader from '@/iss-components/site-header/site-header';
|
||||
import siteFooter from '@/iss-components/site-footer/site-footer';
|
||||
import siteHeader from '@/iss-components/site-header/site-header.vue';
|
||||
import siteFooter from '@/iss-components/site-footer/site-footer.vue';
|
||||
|
||||
// Supporting files
|
||||
import { fetchCmsContentForPage } from '@/helpers/cms-content-helper';
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
import { shallowMount } from '@vue/test-utils';
|
||||
import { getMountOptions } from '@/helpers/unit-test-helper.js';
|
||||
import serviceLocation from '@/layouts/service-location/service-location';
|
||||
import serviceLocation from '@/layouts/service-location/service-location.vue';
|
||||
|
||||
// Define Mocks
|
||||
jest.mock('@/helpers/cms-content-helper', () => ({
|
||||
fetchCmsContentForPage: jest.fn(() => Promise.resolve('content'))
|
||||
}));
|
||||
|
||||
/** @ignore */
|
||||
function setupMocks() {
|
||||
const wrapper = shallowMount(serviceLocation,
|
||||
getMountOptions({
|
||||
|
|
@ -133,6 +134,7 @@ describe('updating service zip', () => {
|
|||
|
||||
expect(wrapper.vm.zipContainsMilitaryBase).toBe(false);
|
||||
|
||||
// TODO: Use or remove
|
||||
const newServiceZipCodeQuestion = {
|
||||
zipCode: '45433',
|
||||
state: 'OH'
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
ref="theForm"
|
||||
v-slot="{ meta }"
|
||||
@submit="onSubmit"
|
||||
@invalid-submit="onInvalidSubmit">
|
||||
@invalidSubmit="onInvalidSubmit">
|
||||
<div class="page-container-grouped-styles">
|
||||
<div class="fade-on-route-transition position-relative">
|
||||
<siteHeader cmsWidgetName="SiteHeaderWidget" />
|
||||
|
|
@ -20,8 +20,8 @@
|
|||
ref="serviceZipCodeQuestion"
|
||||
v-model="serviceZipCodeQuestion"
|
||||
modalWidgetName="ServiceZipModalWidget"
|
||||
@updated-serviceability="setServiceabilityDetails"
|
||||
@updated-contains-military-base="setContainsMilitaryBase" />
|
||||
@updatedServiceability="setServiceabilityDetails"
|
||||
@updatedContainsMilitaryBase="setContainsMilitaryBase" />
|
||||
<alert
|
||||
v-if="displayMilitaryZipAlert"
|
||||
ref="alertMilitaryBaseZip"
|
||||
|
|
@ -61,18 +61,18 @@ import { fetchCmsContentForPage } from '@/helpers/cms-content-helper';
|
|||
import { settleAllPromises } from '@/helpers/layout-helper';
|
||||
import { required } from '@/helpers/validation-rules';
|
||||
import errorMessages from '@/constants/error-messages';
|
||||
import buttonQuestion from '@/digital-components/button-question/button-question';
|
||||
import buttonQuestion from '@/digital-components/button-question/button-question.vue';
|
||||
import { useMainStore } from '@/store';
|
||||
import { getServiceabilityDetails, getZipCodeData } from '@/helpers/service-location-helper';
|
||||
|
||||
// Import Component
|
||||
import alert from '@/ux-components/alert/alert';
|
||||
import alert from '@/ux-components/alert/alert.vue';
|
||||
import baseFormMixin from '@/mixins/base-form-mixin';
|
||||
import { Form, defineRule } from 'vee-validate';
|
||||
import siteFooter from '@/iss-components/site-footer/site-footer';
|
||||
import siteHeader from '@/iss-components/site-header/site-header';
|
||||
import siteSubHeader from '@/iss-components/site-sub-header/site-sub-header';
|
||||
import serviceZipModalQuestion from '@/layouts/service-location/service-zip-modal-question/service-zip-modal-question';
|
||||
import siteFooter from '@/iss-components/site-footer/site-footer.vue';
|
||||
import siteHeader from '@/iss-components/site-header/site-header.vue';
|
||||
import siteSubHeader from '@/iss-components/site-sub-header/site-sub-header.vue';
|
||||
import serviceZipModalQuestion from '@/layouts/service-location/service-zip-modal-question/service-zip-modal-question.vue';
|
||||
|
||||
// DEFINE VALIDATION RULES
|
||||
defineRule('selection-required', required(errorMessages.OPTION_REQUIRED));
|
||||
|
|
@ -175,8 +175,8 @@ export default {
|
|||
},
|
||||
backButtonAction() {
|
||||
/**
|
||||
* this.navigationScenarios comes from base-mixin
|
||||
*/
|
||||
* this.navigationScenarios comes from base-mixin
|
||||
*/
|
||||
this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route);
|
||||
},
|
||||
async forwardButtonAction() {
|
||||
|
|
@ -201,11 +201,11 @@ export default {
|
|||
},
|
||||
setServiceabilityDetails(serviceabilityDetails) {
|
||||
this.isGlassServiceableInshop = serviceabilityDetails.isGlassServiceableInshop;
|
||||
this.isRecalibrationServiceableInshop
|
||||
= serviceabilityDetails.isRecalibrationServiceableInshop;
|
||||
this.isRecalibrationServiceableInshop =
|
||||
serviceabilityDetails.isRecalibrationServiceableInshop;
|
||||
this.isGlassServiceableMobile = serviceabilityDetails.isGlassServiceableMobile;
|
||||
this.isRecalibrationServiceableMobile
|
||||
= serviceabilityDetails.isRecalibrationServiceableMobile;
|
||||
this.isRecalibrationServiceableMobile =
|
||||
serviceabilityDetails.isRecalibrationServiceableMobile;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { mount } from '@vue/test-utils';
|
||||
import crypto from 'crypto';
|
||||
import serviceZipModalQuestion from './service-zip-modal-question';
|
||||
import serviceZipModalQuestion from '@/layouts/service-location/service-zip-modal-question/service-zip-modal-question.vue';
|
||||
|
||||
global.crypto = crypto;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
:text="serviceZipLinkText"
|
||||
href="#!"
|
||||
aria-label="Modal window"
|
||||
@click-event="openModal" />
|
||||
@clickEvent="openModal" />
|
||||
</div>
|
||||
</div>
|
||||
<modal
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
:onModalOpenedCallback="onModalOpened"
|
||||
:onModalClosedCallback="onModalClosed"
|
||||
:footerButtonText="modalFooterText"
|
||||
@footer-button-event="setZipCode">
|
||||
@footerButtonEvent="setZipCode">
|
||||
<serviceZipQuestion
|
||||
ref="serviceZipCodeQuestion"
|
||||
v-model="internalModel.zipCode"
|
||||
|
|
@ -34,10 +34,10 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import textLink from '@/ux-components/text-link/text-link';
|
||||
import serviceZipQuestion from '@/layouts/service-location/service-zip-modal-question/service-zip-question/service-zip-question';
|
||||
import modal from '@/digital-components/modal/modal';
|
||||
import alert from '@/ux-components/alert/alert';
|
||||
import textLink from '@/ux-components/text-link/text-link.vue';
|
||||
import serviceZipQuestion from '@/layouts/service-location/service-zip-modal-question/service-zip-question/service-zip-question.vue';
|
||||
import modal from '@/digital-components/modal/modal.vue';
|
||||
import alert from '@/ux-components/alert/alert.vue';
|
||||
|
||||
import { getServiceabilityDetails, getZipCodeData } from '@/helpers/service-location-helper';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { shallowMount } from '@vue/test-utils';
|
||||
import serviceZipQuestion from './service-zip-question';
|
||||
import serviceZipQuestion from '@/layouts/service-location/service-zip-modal-question/service-zip-question/service-zip-question.vue';
|
||||
|
||||
describe('service-zip-question.vue', () => {
|
||||
it('Should get the modelValue', async () => {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import textboxQuestion from '@/digital-components/textbox-question/textbox-question';
|
||||
import textboxQuestion from '@/digital-components/textbox-question/textbox-question.vue';
|
||||
|
||||
// Supporting Files
|
||||
import { defineRule } from 'vee-validate';
|
||||
|
|
@ -29,12 +29,14 @@ export default {
|
|||
components: {
|
||||
textboxQuestion
|
||||
},
|
||||
// TODO: Correct prop def.
|
||||
props: {
|
||||
modelValue: {
|
||||
serviceZipCode: String
|
||||
},
|
||||
cmsWidgetName: String
|
||||
},
|
||||
emits: ['update:modelValue'],
|
||||
computed: {
|
||||
value: {
|
||||
get() {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ const processLineItems = (lineItems) => {
|
|||
return returnVal;
|
||||
};
|
||||
|
||||
export const allGlassPartsAndItemsHavePrices = (lineItems) => {
|
||||
const allGlassPartsAndItemsHavePrices = (lineItems) => {
|
||||
if (lineItems.glassParts && Array.isArray(lineItems.glassParts)) {
|
||||
if (!processLineItems(lineItems.glassParts)) {
|
||||
return false;
|
||||
|
|
@ -36,3 +36,5 @@ export const allGlassPartsAndItemsHavePrices = (lineItems) => {
|
|||
|
||||
return true;
|
||||
};
|
||||
|
||||
export default allGlassPartsAndItemsHavePrices;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { allGlassPartsAndItemsHavePrices } from './service-package-helper';
|
||||
import allGlassPartsAndItemsHavePrices from './service-package-helper';
|
||||
|
||||
it('service package helper should return false when line item has missing price', () => {
|
||||
// Arrange
|
||||
|
|
|
|||
|
|
@ -11,13 +11,13 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import buttonQuestion from '@/digital-components/button-question/button-question';
|
||||
import buttonQuestion from '@/digital-components/button-question/button-question.vue';
|
||||
import { processIfStatements } from '@/helpers/cms-content-helper';
|
||||
import damageLocationsSelected from '@/constants/damage-locations-selected';
|
||||
import servicePackageRadio from '@/layouts/service-packages/service-package-question/service-package-radio/service-package-radio';
|
||||
import servicePackageRadio from '@/layouts/service-packages/service-package-question/service-package-radio/service-package-radio.vue';
|
||||
import partTypeStrings from '@/constants/part-type-strings';
|
||||
import { useMainStore } from '@/store';
|
||||
import { allGlassPartsAndItemsHavePrices } from '@/layouts/service-packages/service-package-helper/service-package-helper';
|
||||
import allGlassPartsAndItemsHavePrices from '@/layouts/service-packages/service-package-helper/service-package-helper';
|
||||
|
||||
const glassLocations = damageLocationsSelected;
|
||||
|
||||
|
|
@ -74,7 +74,8 @@ export default {
|
|||
cmsWidgetName: 'PremiumServicePackage'
|
||||
});
|
||||
// if cms content has not yet loaded, skip
|
||||
if (this.getCmsContent(cmsAnswersContent[0].cmsWidgetName, 'HeaderText') == '') {
|
||||
if (!this.getCmsContent(cmsAnswersContent[0].cmsWidgetName, 'HeaderText')
|
||||
|| this.getCmsContent(cmsAnswersContent[0].cmsWidgetName, 'HeaderText') === '') {
|
||||
return {};
|
||||
}
|
||||
const modifiedAnswers = cmsAnswersContent.map((answer) => ({
|
||||
|
|
@ -231,28 +232,28 @@ export default {
|
|||
getLowestTierForThisItem(vapsItem) {
|
||||
let lowestTierForThisItem = null;
|
||||
switch (vapsItem.partType) {
|
||||
case partTypeStrings.FRONT_WIPER:
|
||||
if (this.frontWipersApplicableForTierThree) {
|
||||
lowestTierForThisItem = packageNames.TIER_THREE;
|
||||
}
|
||||
if (this.frontWipersApplicableForTierTwo) {
|
||||
lowestTierForThisItem = packageNames.TIER_TWO;
|
||||
}
|
||||
break;
|
||||
case partTypeStrings.REAR_WIPER:
|
||||
if (this.rearWiperApplicableForTierThree) {
|
||||
lowestTierForThisItem = packageNames.TIER_THREE;
|
||||
}
|
||||
if (this.rearWiperApplicableForTierTwo) {
|
||||
lowestTierForThisItem = packageNames.TIER_TWO;
|
||||
}
|
||||
break;
|
||||
case partTypeStrings.RAIN_DEFENSE:
|
||||
if (this.rainDefenseApplicableForTierThree) {
|
||||
lowestTierForThisItem = packageNames.TIER_THREE;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
case partTypeStrings.FRONT_WIPER:
|
||||
if (this.frontWipersApplicableForTierThree) {
|
||||
lowestTierForThisItem = packageNames.TIER_THREE;
|
||||
}
|
||||
if (this.frontWipersApplicableForTierTwo) {
|
||||
lowestTierForThisItem = packageNames.TIER_TWO;
|
||||
}
|
||||
break;
|
||||
case partTypeStrings.REAR_WIPER:
|
||||
if (this.rearWiperApplicableForTierThree) {
|
||||
lowestTierForThisItem = packageNames.TIER_THREE;
|
||||
}
|
||||
if (this.rearWiperApplicableForTierTwo) {
|
||||
lowestTierForThisItem = packageNames.TIER_TWO;
|
||||
}
|
||||
break;
|
||||
case partTypeStrings.RAIN_DEFENSE:
|
||||
if (this.rainDefenseApplicableForTierThree) {
|
||||
lowestTierForThisItem = packageNames.TIER_THREE;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
return lowestTierForThisItem;
|
||||
},
|
||||
|
|
@ -280,20 +281,20 @@ export default {
|
|||
},
|
||||
getCustomValueFromString(str) {
|
||||
switch (str) {
|
||||
case 'isRecalibrationOnOrder':
|
||||
return this.isRecalibrationOnOrder;
|
||||
case 'frontWipersApplicableForTierTwo':
|
||||
return this.frontWipersApplicableForTierTwo;
|
||||
case 'rearWiperApplicableForTierTwo':
|
||||
return this.rearWiperApplicableForTierTwo;
|
||||
case 'frontWipersApplicableForTierThree':
|
||||
return this.frontWipersApplicableForTierThree;
|
||||
case 'rearWiperApplicableForTierThree':
|
||||
return this.rearWiperApplicableForTierThree;
|
||||
case 'rainDefenseApplicableForTierThree':
|
||||
return this.rainDefenseApplicableForTierThree;
|
||||
default:
|
||||
return null;
|
||||
case 'isRecalibrationOnOrder':
|
||||
return this.isRecalibrationOnOrder;
|
||||
case 'frontWipersApplicableForTierTwo':
|
||||
return this.frontWipersApplicableForTierTwo;
|
||||
case 'rearWiperApplicableForTierTwo':
|
||||
return this.rearWiperApplicableForTierTwo;
|
||||
case 'frontWipersApplicableForTierThree':
|
||||
return this.frontWipersApplicableForTierThree;
|
||||
case 'rearWiperApplicableForTierThree':
|
||||
return this.rearWiperApplicableForTierThree;
|
||||
case 'rainDefenseApplicableForTierThree':
|
||||
return this.rainDefenseApplicableForTierThree;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
},
|
||||
getLineItemsContainingPartType(partType) {
|
||||
|
|
@ -305,9 +306,8 @@ export default {
|
|||
return !!partTypeMatches.length;
|
||||
},
|
||||
glassToReplaceContainsGlassLocation(glassLocation) {
|
||||
const store = useMainStore();
|
||||
const glassLocationMatches
|
||||
= store.order.damage.glassToReplace?.filter((glassToReplace) => glassToReplace.glassLocation === glassLocation) ?? [];
|
||||
const glassLocationMatches =
|
||||
store.order.damage.glassToReplace?.filter((glassToReplace) => glassToReplace.glassLocation === glassLocation) ?? [];
|
||||
return !!glassLocationMatches.length;
|
||||
},
|
||||
getTotalLineItemPrice(lineItem) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { mount } from '@vue/test-utils';
|
||||
import inputButtonWrapperMixin from '@/mixins/input-button-wrapper-mixin';
|
||||
import servicePackageRadio from './service-package-radio';
|
||||
import servicePackageRadio from '@/layouts/service-packages/service-package-question/service-package-radio/service-package-radio.vue';
|
||||
|
||||
const mockProps = {
|
||||
buttonLabel: 'buttonLabel test copy',
|
||||
|
|
@ -10,6 +10,7 @@ const mockProps = {
|
|||
buttonFooterCopy: 'buttonFooterCopy test copy'
|
||||
};
|
||||
|
||||
/** @ignore */
|
||||
function setupMocks({ mountOptionsMockData = {} }) {
|
||||
const wrapper = mount(servicePackageRadio, {
|
||||
...mountOptionsMockData,
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
href="#!"
|
||||
:data-bs-target="'#' + getRouterLinkRouteFromCopy(copy)"
|
||||
aria-label="Modal window"
|
||||
@click-event="textLinkEmit(copy)" />
|
||||
@clickEvent="textLinkEmit(copy)" />
|
||||
</span>
|
||||
</template>
|
||||
</li>
|
||||
|
|
@ -60,8 +60,8 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import baseInputButton from '@/digital-components/base-input-button/base-input-button';
|
||||
import textLink from '@/ux-components/text-link/text-link';
|
||||
import baseInputButton from '@/digital-components/base-input-button/base-input-button.vue';
|
||||
import textLink from '@/ux-components/text-link/text-link.vue';
|
||||
import inputButtonWrapperMixin from '@/mixins/input-button-wrapper-mixin';
|
||||
import {
|
||||
getRouterLinkDisplayTextFromCopy,
|
||||
|
|
|
|||
|
|
@ -53,19 +53,18 @@
|
|||
<script>
|
||||
// Components
|
||||
import baseFormMixin from '@/mixins/base-form-mixin';
|
||||
import siteHeader from '@/iss-components/site-header/site-header';
|
||||
import siteFooter from '@/iss-components/site-footer/site-footer';
|
||||
import siteSubHeader from '@/iss-components/site-sub-header/site-sub-header';
|
||||
import textBlock from '@/digital-components/text-block/text-block';
|
||||
import contentGroupModal from '@/iss-components/content-group-modal/content-group-modal';
|
||||
import loadingModal from '@/iss-components/loading-modal/loading-modal';
|
||||
import siteHeader from '@/iss-components/site-header/site-header.vue';
|
||||
import siteFooter from '@/iss-components/site-footer/site-footer.vue';
|
||||
import siteSubHeader from '@/iss-components/site-sub-header/site-sub-header.vue';
|
||||
import contentGroupModal from '@/iss-components/content-group-modal/content-group-modal.vue';
|
||||
import loadingModal from '@/iss-components/loading-modal/loading-modal.vue';
|
||||
import { settleAllPromises } from '@/helpers/layout-helper';
|
||||
import { useMainStore } from '@/store';
|
||||
import { fetchCmsContentForPage } from '@/helpers/cms-content-helper';
|
||||
import { Form } from 'vee-validate';
|
||||
import { allGlassPartsAndItemsHavePrices } from '@/layouts/service-packages/service-package-helper/service-package-helper';
|
||||
import allGlassPartsAndItemsHavePrices from '@/layouts/service-packages/service-package-helper/service-package-helper';
|
||||
import globalRules from '@/constants/global-rules';
|
||||
import servicePackageQuestion from './service-package-question/service-package-question';
|
||||
import servicePackageQuestion from '@/layouts/service-packages/service-package-question/service-package-question.vue';
|
||||
|
||||
const store = useMainStore();
|
||||
|
||||
|
|
@ -175,7 +174,7 @@ export default {
|
|||
forwardButtonAction() {
|
||||
const parts = { glassParts: this.pricedGlassParts, supportingItems: this.supportingItems, vaps: this.selectedVaps };
|
||||
if (!allGlassPartsAndItemsHavePrices(parts)) {
|
||||
console.error('One or more items have no price assigned!');
|
||||
window.console.error('One or more items have no price assigned!');
|
||||
}
|
||||
if (this.pricedGlassParts.length > 0) {
|
||||
store.saveGlassParts(this.pricedGlassParts);
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@
|
|||
import { mount, flushPromises } from '@vue/test-utils';
|
||||
import { createTestingPinia } from '@pinia/testing';
|
||||
import { navigationScenarios } from '@/router/router-constants/navigation-scenarios';
|
||||
import { routerParams } from '@/router/router-params';
|
||||
import routerParams from '@/router/router-constants/router-params';
|
||||
import vehicleCategories from '@/constants/vehicle-categories';
|
||||
import VehicleDamageComponent from '@/layouts/vehicle-damage/vehicle-damage';
|
||||
import VehicleDamageComponent from '@/layouts/vehicle-damage/vehicle-damage.vue';
|
||||
|
||||
const mockRoute = {
|
||||
params: {}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import issPageValues from '@/router/router-constants/issPage-values';
|
|||
import queryStrings from '@/constants/query-strings';
|
||||
import { GaActions } from '@/constants/analytics';
|
||||
import { navigationScenarios } from '@/router/router-constants/navigation-scenarios';
|
||||
import { routerParams } from '@/router/router-params';
|
||||
import routerParams from '@/router/router-constants/router-params';
|
||||
import { useMainStore } from '@/store';
|
||||
import VinLookupComponent from '@/layouts/vin-lookup/vin-lookup.vue';
|
||||
|
||||
|
|
|
|||
|
|
@ -49,20 +49,20 @@ import vehicleLookupAlertTypes from '@/constants/vehicle-lookup-alert-types';
|
|||
import { fetchCmsContentForPage } from '@/helpers/cms-content-helper';
|
||||
import { isGlassAvailableForCarId } from '@/helpers/damage-helper';
|
||||
import { settleAllPromises } from '@/helpers/layout-helper';
|
||||
import { routerParams } from '@/router/router-params';
|
||||
import routerParams from '@/router/router-constants/router-params';
|
||||
import { useMainStore } from '@/store';
|
||||
|
||||
// Import Component
|
||||
import baseFormMixin from '@/mixins/base-form-mixin';
|
||||
import vehicleQuestionsMixin from '@/mixins/vehicle-questions-mixin';
|
||||
import { Form } from 'vee-validate';
|
||||
import siteFooter from '@/iss-components/site-footer/site-footer';
|
||||
import siteHeader from '@/iss-components/site-header/site-header';
|
||||
import siteSubHeader from '@/iss-components/site-sub-header/site-sub-header';
|
||||
import vehicleBanner from '@/iss-components/vehicle-banner/vehicle-banner';
|
||||
import vinLocationInformation from '@/layouts/vin-lookup/vin-location-information/vin-location-information';
|
||||
import vinLookupAlerts from '@/layouts/vin-lookup/vin-lookup-alerts/vin-lookup-alerts';
|
||||
import vinQuestion from '@/layouts/vin-lookup/vin-question/vin-question';
|
||||
import siteFooter from '@/iss-components/site-footer/site-footer.vue';
|
||||
import siteHeader from '@/iss-components/site-header/site-header.vue';
|
||||
import siteSubHeader from '@/iss-components/site-sub-header/site-sub-header.vue';
|
||||
import vehicleBanner from '@/iss-components/vehicle-banner/vehicle-banner.vue';
|
||||
import vinLocationInformation from '@/layouts/vin-lookup/vin-location-information/vin-location-information.vue';
|
||||
import vinLookupAlerts from '@/layouts/vin-lookup/vin-lookup-alerts/vin-lookup-alerts.vue';
|
||||
import vinQuestion from '@/layouts/vin-lookup/vin-question/vin-question.vue';
|
||||
|
||||
export default {
|
||||
name: 'vin-lookup',
|
||||
|
|
@ -125,8 +125,8 @@ export default {
|
|||
},
|
||||
isTwoIdenticalYMMVehicleFound() {
|
||||
const vinYmmFound = `${this.vehicleFromLookup.year} ${this.vehicleFromLookup.make} ${this.vehicleFromLookup.model}`;
|
||||
const vinYmmExpected
|
||||
= `${this.mainStore.order.vehicle.year} ${this.mainStore.order.vehicle.make} ${this.mainStore.order.vehicle.model}`;
|
||||
const vinYmmExpected =
|
||||
`${this.mainStore.order.vehicle.year} ${this.mainStore.order.vehicle.make} ${this.mainStore.order.vehicle.model}`;
|
||||
return (vinYmmFound.toLowerCase() === vinYmmExpected.toLowerCase());
|
||||
},
|
||||
vinMask() {
|
||||
|
|
@ -197,8 +197,9 @@ export default {
|
|||
this.activeVehicleLookupAlertType = vehicleLookupAlertTypes.NOT_MATCHED;
|
||||
}
|
||||
|
||||
const vehicleYearMakeModelStyle
|
||||
= `${this.vehicleFromLookup.year} ${this.vehicleFromLookup.make} ${this.vehicleFromLookup.model} ${this.forwardButtonCarStyle}`;
|
||||
const vehicleYearMakeModelStyle =
|
||||
// eslint-disable-next-line max-len
|
||||
`${this.vehicleFromLookup.year} ${this.vehicleFromLookup.make} ${this.vehicleFromLookup.model} ${this.forwardButtonCarStyle}`;
|
||||
this.$refs.siteFooter.updateButtonText(`Continue with ${vehicleYearMakeModelStyle}`);
|
||||
this.$refs.siteFooter.removeLoader();
|
||||
|
||||
|
|
@ -209,8 +210,7 @@ export default {
|
|||
|
||||
let isSelectedGlassAvailableForVehicle = true;
|
||||
if (this.isCarIdDifferentFromTheStore) {
|
||||
isSelectedGlassAvailableForVehicle
|
||||
= await isGlassAvailableForCarId(this.vehicleFromLookup.carId);
|
||||
isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId(this.vehicleFromLookup.carId);
|
||||
}
|
||||
|
||||
// navigate back to vehicle-damage
|
||||
|
|
@ -223,7 +223,7 @@ export default {
|
|||
{ [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: true });
|
||||
|
||||
// navigate() doesn't stop the processing flow
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
// save vehicle to store if it hasn't already been saved
|
||||
|
|
@ -234,7 +234,7 @@ export default {
|
|||
const partsOrQuestionsResponse = await this.getPartsOrQuestions();
|
||||
if (partsOrQuestionsResponse.error) {
|
||||
// To Do: Need requirement on what to do here
|
||||
console.error('Error on retrieving PartsOrQuestions');
|
||||
window.console.error('Error on retrieving PartsOrQuestions');
|
||||
this.$refs.siteFooter.removeLoader();
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import welcomePage from '@/layouts/welcome-page/welcome-page';
|
||||
import welcomePage from '@/layouts/welcome-page/welcome-page.vue';
|
||||
|
||||
// Supporting files
|
||||
// Supporting files
|
||||
|
|
@ -21,6 +21,76 @@ jest.mock('@/helpers/cms-content-helper', () => ({
|
|||
fetchCmsContentForPage: jest.fn()
|
||||
}));
|
||||
|
||||
/** @ignore */
|
||||
function setupMocks({
|
||||
pageHeaderWidgetHeaderText = {},
|
||||
pageFooterWidgetCmsContent = {},
|
||||
mountOptionsMockData = {},
|
||||
policies = [],
|
||||
getCoveragePolicyInfoResponse
|
||||
}) {
|
||||
useMainStore().getCoveragePolicyInfo = jest.fn().mockImplementation(() => Promise.resolve({
|
||||
data: getCoveragePolicyInfoResponse || {
|
||||
policies: [
|
||||
{
|
||||
insureds: [
|
||||
{
|
||||
customerId: 'TEST_ID'
|
||||
}
|
||||
],
|
||||
vehicles: [
|
||||
{
|
||||
vin: 'TEST_VIN'
|
||||
},
|
||||
{
|
||||
vin: 'TEST_VIN2'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}));
|
||||
|
||||
// Mock api responses
|
||||
const apiResponses = {
|
||||
cmsContent: {
|
||||
SiteSubHeaderWidget: pageHeaderWidgetHeaderText,
|
||||
VehicleBannerWidget: {
|
||||
GenericVehicleImage:
|
||||
`${applicationConfig.ISS_DEV_CMS_DOMAIN}/images/default-source/default-album/blurred-image.jpg`
|
||||
},
|
||||
SiteHeaderWidget: {
|
||||
LogoImage:
|
||||
`${applicationConfig.ISS_DEV_CMS_DOMAIN}/images/default-source/default-album/logos/insuranceLogo.jpg`
|
||||
},
|
||||
SiteFooterWidget: pageFooterWidgetCmsContent
|
||||
},
|
||||
policyLookupResponse: {
|
||||
policies
|
||||
}
|
||||
};
|
||||
|
||||
mountOptionsMockData = {
|
||||
...mountOptionsMockData,
|
||||
router: {
|
||||
navigate: jest.fn()
|
||||
}
|
||||
};
|
||||
|
||||
const apiPromise = Promise.resolve(apiResponses);
|
||||
|
||||
settleAllPromises.mockImplementation(() => apiPromise);
|
||||
fetchCmsContentForPage.mockImplementation(() => Promise.resolve());
|
||||
|
||||
const mountOptions = getMountOptions(mountOptionsMockData);
|
||||
|
||||
const wrapper = shallowMount(welcomePage, mountOptions);
|
||||
|
||||
wrapper.vm.setCmsContent = baseMixin.methods.setCmsContent;
|
||||
wrapper.vm.getCmsContent = jest.fn().mockImplementation(() => '');
|
||||
return { wrapper, apiPromise };
|
||||
}
|
||||
|
||||
describe('welcome-page.vue', () => {
|
||||
test('Should render welcomePage sub-components (policyNumber, policyZipCode, dateOfLoss, damageCause etc.)', async () => {
|
||||
// Arrange
|
||||
|
|
@ -158,72 +228,3 @@ describe('navigation', () => {
|
|||
undefined);
|
||||
});
|
||||
});
|
||||
|
||||
function setupMocks({
|
||||
pageHeaderWidgetHeaderText = {},
|
||||
pageFooterWidgetCmsContent = {},
|
||||
mountOptionsMockData = {},
|
||||
policies = [],
|
||||
getCoveragePolicyInfoResponse
|
||||
}) {
|
||||
useMainStore().getCoveragePolicyInfo = jest.fn().mockImplementation(() => Promise.resolve({
|
||||
data: getCoveragePolicyInfoResponse || {
|
||||
policies: [
|
||||
{
|
||||
insureds: [
|
||||
{
|
||||
customerId: 'TEST_ID'
|
||||
}
|
||||
],
|
||||
vehicles: [
|
||||
{
|
||||
vin: 'TEST_VIN'
|
||||
},
|
||||
{
|
||||
vin: 'TEST_VIN2'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}));
|
||||
|
||||
// Mock api responses
|
||||
const apiResponses = {
|
||||
cmsContent: {
|
||||
SiteSubHeaderWidget: pageHeaderWidgetHeaderText,
|
||||
VehicleBannerWidget: {
|
||||
GenericVehicleImage:
|
||||
`${applicationConfig.ISS_DEV_CMS_DOMAIN}/images/default-source/default-album/blurred-image.jpg`
|
||||
},
|
||||
SiteHeaderWidget: {
|
||||
LogoImage:
|
||||
`${applicationConfig.ISS_DEV_CMS_DOMAIN}/images/default-source/default-album/logos/insuranceLogo.jpg`
|
||||
},
|
||||
SiteFooterWidget: pageFooterWidgetCmsContent
|
||||
},
|
||||
policyLookupResponse: {
|
||||
policies
|
||||
}
|
||||
};
|
||||
|
||||
mountOptionsMockData = {
|
||||
...mountOptionsMockData,
|
||||
router: {
|
||||
navigate: jest.fn()
|
||||
}
|
||||
};
|
||||
|
||||
const apiPromise = Promise.resolve(apiResponses);
|
||||
|
||||
settleAllPromises.mockImplementation(() => apiPromise);
|
||||
fetchCmsContentForPage.mockImplementation(() => Promise.resolve());
|
||||
|
||||
const mountOptions = getMountOptions(mountOptionsMockData);
|
||||
|
||||
const wrapper = shallowMount(welcomePage, mountOptions);
|
||||
|
||||
wrapper.vm.setCmsContent = baseMixin.methods.setCmsContent;
|
||||
wrapper.vm.getCmsContent = jest.fn().mockImplementation(() => '');
|
||||
return { wrapper, apiPromise };
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { navigationScenarios } from '@/router/router-constants/navigation-scenar
|
|||
import vehicleCategories from '@/constants/vehicle-categories.js';
|
||||
import queryStrings from '@/constants/query-strings';
|
||||
import dynamicStrings from '@/constants/dynamic-strings';
|
||||
import { routerParams } from '@/router/router-constants/router-params';
|
||||
import routerParams from '@/router/router-constants/router-params';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
const routerParams = {
|
||||
const routerParams = Object.freeze({
|
||||
DISPLAY_VEHICLE_CHANGE_ALERT: 'displayVehicleChangeAlert'
|
||||
};
|
||||
});
|
||||
|
||||
export { routerParams };
|
||||
export default routerParams;
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
const routerParams = Object.freeze({
|
||||
DISPLAY_VEHICLE_CHANGE_ALERT: 'displayVehicleChangeAlert'
|
||||
});
|
||||
|
||||
export { routerParams };
|
||||
Loading…
Reference in a new issue