From ed405fd19bf2bca49dd75c3559cab7f44139c49c Mon Sep 17 00:00:00 2001 From: hiteshkumar87 Date: Thu, 2 Mar 2023 20:58:48 +0530 Subject: [PATCH] updated vinlookupmethod constant updated vin lookup method constant file --- src/constants/vin-lookup-methods.js | 10 +++++----- src/layouts/vehicle-lookup/vehicle-lookup.spec.js | 4 ++-- src/layouts/vehicle-lookup/vehicle-lookup.vue | 8 ++++---- .../vin-lookup-methods/vin-lookup-methods.vue | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/constants/vin-lookup-methods.js b/src/constants/vin-lookup-methods.js index a12f29eb..ce2f2859 100644 --- a/src/constants/vin-lookup-methods.js +++ b/src/constants/vin-lookup-methods.js @@ -1,7 +1,7 @@ -const VIN_LOOKUP_METHODS = Object.freeze({ - manualVin: 'ManualVin', - licensePlate: 'LicensePlate', - homeAddress: 'HomeAddress', +const vinLookupMethodSelections = Object.freeze({ + MANUALVIN: 'ManualVin', + LICENSEPLATE: 'LicensePlate', + HOMEADDRESS: 'HomeAddress', }); -export default VIN_LOOKUP_METHODS; +export {vinLookupMethodSelections}; diff --git a/src/layouts/vehicle-lookup/vehicle-lookup.spec.js b/src/layouts/vehicle-lookup/vehicle-lookup.spec.js index e86a57d1..491adc70 100644 --- a/src/layouts/vehicle-lookup/vehicle-lookup.spec.js +++ b/src/layouts/vehicle-lookup/vehicle-lookup.spec.js @@ -5,7 +5,7 @@ import { issPageValues } from '@/router/router-constants/issPage-values'; import { queryStrings } from '@/constants/query-strings'; import { GaActions } from "@/constants/analytics"; import VehicleLookup from './vehicle-lookup.vue'; -import vinLookupMethods from '@/constants/vin-lookup-methods'; +import {vinLookupMethodSelections} from '@/constants/vin-lookup-methods'; const vinLookupMethodsMockData = { QuestionText: 'To find the right part, let’s get your VIN. Or we can look it up for you!', @@ -121,7 +121,7 @@ describe('vehicle-lookup.vue', () => { // Not using initializeComponent() because it doesn't trigger reactivity in test. const Answers = JSON.parse(JSON.stringify(vinLookupMethodsMockData.Answers)); if(!mockIsVinbyAddressPermissibleToBeFalse.IsVinbyAddressPermissible){ - Answers.splice(Answers.indexOf(vinLookupMethods.homeAddress),1); + Answers.splice(Answers.indexOf(vinLookupMethodSelections.HOMEADDRESS),1); } vinLookupMethodsWrapper.setData({ questionTextFromCms: vinLookupMethodsMockData.QuestionText, diff --git a/src/layouts/vehicle-lookup/vehicle-lookup.vue b/src/layouts/vehicle-lookup/vehicle-lookup.vue index 768cc21d..4f16ccd5 100644 --- a/src/layouts/vehicle-lookup/vehicle-lookup.vue +++ b/src/layouts/vehicle-lookup/vehicle-lookup.vue @@ -38,7 +38,7 @@ import { fetchCmsContentForPage } from '@/helpers/cms-content-helper'; import { settleAllPromises } from '@/helpers/layout-helper'; import { Form } from 'vee-validate'; import BaseFormMixin from '@/mixins/base-form-mixin'; -import constVinLookupMethods from '@/constants/vin-lookup-methods'; +import {vinLookupMethodSelections} from '@/constants/vin-lookup-methods'; // Import Component import SiteFooter from '@/iss-components/site-footer/site-footer.vue'; @@ -98,13 +98,13 @@ export default { }, forwardButtonAction() { switch (this.selectedVinLookupMethod) { - case constVinLookupMethods.manualVin: + case vinLookupMethodSelections.MANUALVIN: this.$router.navigate(this.navigationScenarios.SELECTED_MANUAL_VIN, this.$route); break; - case constVinLookupMethods.licensePlate: + case vinLookupMethodSelections.LICENSEPLATE: this.$router.navigate(this.navigationScenarios.SELECTED_LICENSE_PLATE, this.$route); break; - case constVinLookupMethods.homeAddress: + case vinLookupMethodSelections.HOMEADDRESS: this.$router.navigate(this.navigationScenarios.SELECTED_HOME_ADDRESS, this.$route); break; default: diff --git a/src/layouts/vehicle-lookup/vin-lookup-methods/vin-lookup-methods.vue b/src/layouts/vehicle-lookup/vin-lookup-methods/vin-lookup-methods.vue index 5d3fc77e..392dbdfa 100644 --- a/src/layouts/vehicle-lookup/vin-lookup-methods/vin-lookup-methods.vue +++ b/src/layouts/vehicle-lookup/vin-lookup-methods/vin-lookup-methods.vue @@ -17,7 +17,7 @@ import { defineRule } from 'vee-validate'; import { required } from '@/helpers/validation-rules'; import { errorMessages } from '@/constants/error-messages'; import { useMainStore } from "@/store"; -import vinLookupMethods from '@/constants/vin-lookup-methods'; +import {vinLookupMethodSelections} from '@/constants/vin-lookup-methods'; import { settleAllPromises } from "@/helpers/layout-helper"; // Import Component @@ -64,7 +64,7 @@ export default { const answers = this.getCmsContent(this.cmsWidgetName, 'Answers'); if (Array.isArray(answers)) { if(!isVinbyAddressPermissible){ - answers.splice(answers.indexOf(vinLookupMethods.homeAddress),1); + answers.splice(answers.indexOf(vinLookupMethodSelections.HOMEADDRESS),1); } this.answersFromCms = answers; }