diff --git a/src/layouts/license-plate-lookup/license-plate-lookup-alerts.spec.js b/src/layouts/license-plate-lookup/license-plate-lookup-alerts/license-plate-lookup-alerts.spec.js
similarity index 73%
rename from src/layouts/license-plate-lookup/license-plate-lookup-alerts.spec.js
rename to src/layouts/license-plate-lookup/license-plate-lookup-alerts/license-plate-lookup-alerts.spec.js
index 781079ab..fbeac8a5 100644
--- a/src/layouts/license-plate-lookup/license-plate-lookup-alerts.spec.js
+++ b/src/layouts/license-plate-lookup/license-plate-lookup-alerts/license-plate-lookup-alerts.spec.js
@@ -4,7 +4,7 @@ import vehicleLookupAlertTypes from '@/constants/vehicle-lookup-alert-types';
import { RouterLinkStub } from '@vue/test-utils';
import { render } from '@testing-library/vue';
import '@testing-library/jest-dom';
-import LicensePlateLookupAlertsComponent from './license-plate-lookup-alerts/license-plate-lookup-alerts.vue';
+import LicensePlateLookupAlertsComponent from '@/layouts/license-plate-lookup/license-plate-lookup-alerts/license-plate-lookup-alerts.vue';
jest.mock('@/helpers/damage-helper');
@@ -34,12 +34,12 @@ describe('license-plate-lookup-alerts.vue', () => {
// Act
const { queryByRole } = render(LicensePlateLookupAlertsComponent, mountOptions);
- const VehicleNotFoundAlert = queryByRole('alert', { name: 'vehicle-not-found-alert' });
- const VehicleNotMatchedAlert = queryByRole('alert', { name: 'vehicle-not-matched-alert'});
+ const vehicleNotFoundAlert = queryByRole('alert', { name: 'vehicle-not-found-alert' });
+ const vehicleNotMatchedAlert = queryByRole('alert', { name: 'vehicle-not-matched-alert'});
// Assert
- expect(VehicleNotFoundAlert).toBeVisible();
- expect(VehicleNotMatchedAlert).toEqual(null);
+ expect(vehicleNotFoundAlert).toBeVisible();
+ expect(vehicleNotMatchedAlert).toEqual(null);
});
test('VehicleNotMatchedAlert is displayed on the screen', () => {
@@ -51,13 +51,11 @@ describe('license-plate-lookup-alerts.vue', () => {
// Act
const { queryByRole } = render(LicensePlateLookupAlertsComponent, mountOptions);
- const VehicleNotFoundAlert = queryByRole('alert', { name: 'vehicle-not-found-alert' });
- const VehicleNotMatchedAlert = queryByRole('alert', { name: 'vehicle-not-matched-alert'});
+ const vehicleNotFoundAlert = queryByRole('alert', { name: 'vehicle-not-found-alert' });
+ const vehicleNotMatchedAlert = queryByRole('alert', { name: 'vehicle-not-matched-alert'});
// Assert
- expect(VehicleNotMatchedAlert).toBeVisible();
- expect(VehicleNotFoundAlert).toEqual(null);
+ expect(vehicleNotMatchedAlert).toBeVisible();
+ expect(vehicleNotFoundAlert).toEqual(null);
});
-
-
})
\ No newline at end of file
diff --git a/src/layouts/license-plate-lookup/license-plate-lookup-alerts/license-plate-lookup-alerts.vue b/src/layouts/license-plate-lookup/license-plate-lookup-alerts/license-plate-lookup-alerts.vue
index 42056eb9..69f83b9e 100644
--- a/src/layouts/license-plate-lookup/license-plate-lookup-alerts/license-plate-lookup-alerts.vue
+++ b/src/layouts/license-plate-lookup/license-plate-lookup-alerts/license-plate-lookup-alerts.vue
@@ -13,8 +13,8 @@
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/src/layouts/license-plate-lookup/license-plate-lookup-alerts/vehicle-not-found-alert/vehicle-not-found-alert.vue b/src/layouts/license-plate-lookup/license-plate-lookup-alerts/vehicle-not-found-alert/vehicle-not-found-alert.vue
index 805983ab..1d258f06 100644
--- a/src/layouts/license-plate-lookup/license-plate-lookup-alerts/vehicle-not-found-alert/vehicle-not-found-alert.vue
+++ b/src/layouts/license-plate-lookup/license-plate-lookup-alerts/vehicle-not-found-alert/vehicle-not-found-alert.vue
@@ -1,7 +1,7 @@
diff --git a/src/layouts/license-plate-lookup/license-plate-lookup-alerts/vehicle-not-matched-alert/vehicle-not-matched-alert.vue b/src/layouts/license-plate-lookup/license-plate-lookup-alerts/vehicle-not-matched-alert/vehicle-not-matched-alert.vue
index 8b1d6878..9c837fbf 100644
--- a/src/layouts/license-plate-lookup/license-plate-lookup-alerts/vehicle-not-matched-alert/vehicle-not-matched-alert.vue
+++ b/src/layouts/license-plate-lookup/license-plate-lookup-alerts/vehicle-not-matched-alert/vehicle-not-matched-alert.vue
@@ -1,10 +1,10 @@
-
\ No newline at end of file
diff --git a/src/layouts/license-plate-lookup/zip-question/zip-question.vue b/src/layouts/license-plate-lookup/zip-question/zip-question.vue
deleted file mode 100644
index 4af9a5b2..00000000
--- a/src/layouts/license-plate-lookup/zip-question/zip-question.vue
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/src/layouts/welcome-page/welcome-page.vue b/src/layouts/welcome-page/welcome-page.vue
index 93f1c367..a727d734 100644
--- a/src/layouts/welcome-page/welcome-page.vue
+++ b/src/layouts/welcome-page/welcome-page.vue
@@ -91,7 +91,7 @@
inputId="phoneNumberField"
cmsWidgetName="PhoneNumberQuestion"
v-model="welcomePageModel.phoneNumber"
- validationRules="phone-number-required"
+ validationRules="phone-number-required|phone-number-format"
isRequired
mask="###-###-####"
disableAutoFill />
@@ -160,7 +160,7 @@
defineRule("phone-number-format",
regex(
- /\A[0-9]{3}-[0-9]{3}-[0-9]{4}\z/,
+ /^(\([0-9]{3}\)|[0-9]{3}) *[-.]? *[0-9]{3} *[-.]? *[0-9]{4}$/,
errorMessages.PHONE_NUMBER_FORMAT
)
);
diff --git a/src/store/index.js b/src/store/index.js
index 7827e58a..68861c05 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -253,6 +253,27 @@ export const useMainStore = defineStore({
});
},
+ async lookupVinByPlate(licensePlate) {
+ try {
+ const response = await globalMethods.callHttpClient({
+ method: endpoints.LookupVinByPlate.method,
+ endpoint: endpoints.LookupVinByPlate.url,
+ payload: {
+ licensePlate: licensePlate,
+ licenseState: "IL", // hard coded until Welcome Page is complete and license state can be pulled from store
+ },
+ });
+
+ return response;
+ } catch (responseError) {
+ return {
+ error: {
+ status: responseError.status,
+ },
+ };
+ }
+ },
+
// PartsOrQuestions API Actions
async getPartsOrQuestions() {
const vehicle = this.vehicle;