From 049e1caa7c2a30d96968692c4f7bce4b0a046448 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Thu, 14 Jul 2022 09:34:54 -0400 Subject: [PATCH 1/3] Changed the number of visible end characters of VINs on address-vehicles from 4 to 6. Also fixed bug that was causing the damage data to be cleared. --- src/layouts/address-lookup/address-lookup.vue | 6 +----- src/layouts/address-vehicles/address-vehicles.vue | 4 ++-- src/layouts/license-plate-lookup/license-plate-lookup.vue | 2 +- src/layouts/vin-lookup/vin-lookup.vue | 2 +- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/layouts/address-lookup/address-lookup.vue b/src/layouts/address-lookup/address-lookup.vue index 394eb0cc8..cbbfe0323 100644 --- a/src/layouts/address-lookup/address-lookup.vue +++ b/src/layouts/address-lookup/address-lookup.vue @@ -127,7 +127,7 @@ export default { displayVinLookupByHomeAddressNotAllowedAlert: false, previouslyEnteredCarId: "", isCarIdDifferent: false, - isSelectedGlassAvailableForVehicle: false, + isSelectedGlassAvailableForVehicle: true, customAlertData: {}, displayInvalidZipAlert: false, showServiceZipField: this.getServiceZipFromStore(), @@ -230,9 +230,6 @@ export default { const carFound = carsFound[0].vehicle; this.isCarIdDifferent = carFound.carId !== this.$store.getters.vehicle.carId; -console.log(this.isCarIdDifferent); -console.log(carFound.carId); -console.log(this.$store.getters.vehicle.carId); if (this.isCarIdDifferent && carFound.carId !== this.previouslyEnteredCarId) { // Display Alert this.previouslyEnteredCarId = carFound.carId; @@ -261,7 +258,6 @@ console.log(this.$store.getters.vehicle.carId); } else { // No VINS found. - console.log("no vins"); this.displayVinNotFoundAlert = true; return this.$refs.funnelFooter.removeLoader(); diff --git a/src/layouts/address-vehicles/address-vehicles.vue b/src/layouts/address-vehicles/address-vehicles.vue index 38dea789d..b0669e720 100644 --- a/src/layouts/address-vehicles/address-vehicles.vue +++ b/src/layouts/address-vehicles/address-vehicles.vue @@ -125,8 +125,8 @@ export default { // Map API result data, to address-vehicles data structure const mappedData = this.VehiclesFromApi.map((v) => { const maskSymbol = "X"; - const vinStart = maskSymbol.repeat(v.vin.length-4); - const vinEnd = v.vin.substring(v.vin.length-4); + const vinStart = maskSymbol.repeat(v.vin.length - 6); + const vinEnd = v.vin.substring(v.vin.length - 6); return { vin: v.vin, vehicle: v.vehicle, diff --git a/src/layouts/license-plate-lookup/license-plate-lookup.vue b/src/layouts/license-plate-lookup/license-plate-lookup.vue index 0db677496..667bac7fc 100644 --- a/src/layouts/license-plate-lookup/license-plate-lookup.vue +++ b/src/layouts/license-plate-lookup/license-plate-lookup.vue @@ -163,7 +163,7 @@ export default { displayVinNotFoundAlert: false, displayMatchedDifferentVehicleAlert: false, previouslyEnteredCarId: "", - isSelectedGlassAvailableForVehicle: false, + isSelectedGlassAvailableForVehicle: true, isCarIdDifferent: false, customAlertData: {}, displayInvalidZipAlert: false, diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue index 5a7a2c560..4ba6a9fe9 100644 --- a/src/layouts/vin-lookup/vin-lookup.vue +++ b/src/layouts/vin-lookup/vin-lookup.vue @@ -178,7 +178,7 @@ export default { customAlertData: {}, previouslyEnteredCarId: '', vinPopulatedOnPageLoad: this.getVinFromStore()?.length > 0, - isSelectedGlassAvailableForVehicle: false, + isSelectedGlassAvailableForVehicle: true, displayInvalidZipAlert: false, displayNonServiceableZipAlert: false, displayVinNotFoundAlert: false, From bda71612488a971e8f83017644e971bdf7b5d185 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Thu, 14 Jul 2022 09:58:42 -0400 Subject: [PATCH 2/3] Fixed broken unit test --- .../address-lookup/address-lookup.spec.js | 37 +------------------ 1 file changed, 2 insertions(+), 35 deletions(-) diff --git a/src/layouts/address-lookup/address-lookup.spec.js b/src/layouts/address-lookup/address-lookup.spec.js index 77f154e45..73327eb1a 100644 --- a/src/layouts/address-lookup/address-lookup.spec.js +++ b/src/layouts/address-lookup/address-lookup.spec.js @@ -332,7 +332,7 @@ describe("address-lookup.vue", () => { }); - 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 () => { + test.only("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 const mockRegistrationAddress = { streetAddress: "1234 Main St", @@ -351,10 +351,9 @@ describe("address-lookup.vue", () => { addressQuestions: mockRegistrationAddress }, isCarIdDifferent: true, - isGlassAvailableForCarId: false, + isSelectedGlassAvailableForVehicle: false, }) - let carsFound = [{ vin: "TEST_VIN2", vehicle: { @@ -499,38 +498,6 @@ describe("address-lookup.vue", () => { expect(wrapper.findComponent({ ref: "alertNonServiceableZip" }).isVisible()).toBe(true); }); - // test.only("if registration address is provided user clicks continue => show service zip field on continue click", async () => { - // // Arrange - // const mockRegistrationAddress = { - // streetAddress: "1234 Main St", - // city: "Columbus", - // state: "OH", - // zipCode: "43215" - // } - - // const { wrapper } = setupMocks({ - // isZipServiceable: false - // } - // ); - - // expect(wrapper.vm.showServiceZipField).toBeFalsy(); - // expect(wrapper.findComponent({ ref: "serviceZip" }).exists()).toBe(false); - // store.commit(storeMutations.UPDATE_CAR_ID, "CARID"); - - // await wrapper.setData({ - // customerQuestions: { - // addressQuestions: mockRegistrationAddress - // } - // }) - - // // Act - // await wrapper.vm.forwardButtonAction(); - - // // Assert - // expect(wrapper.vm.showServiceZipField).toBe(true); - // expect(wrapper.findComponent({ ref: "serviceZip" }).isVisible()).toBe(true); - // }); - test("if registration address, service zip are provided, and user clicks continue => don't update service address", async () => { // Arrange const mockRegistrationAddress = { From ae53f4ab5016a01f3a8a862d66824733db9ef7c4 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Thu, 14 Jul 2022 10:04:53 -0400 Subject: [PATCH 3/3] Removed .only I accidentally let in --- src/layouts/address-lookup/address-lookup.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layouts/address-lookup/address-lookup.spec.js b/src/layouts/address-lookup/address-lookup.spec.js index 73327eb1a..506803c7d 100644 --- a/src/layouts/address-lookup/address-lookup.spec.js +++ b/src/layouts/address-lookup/address-lookup.spec.js @@ -332,7 +332,7 @@ describe("address-lookup.vue", () => { }); - test.only("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 () => { + 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 const mockRegistrationAddress = { streetAddress: "1234 Main St",