-
-
-
-
+
\ No newline at end of file
+
diff --git a/src/layouts/vehicle-damage/vehicle-damage.spec.js b/src/layouts/vehicle-damage/vehicle-damage.spec.js
index 9a9f7e6d7..b722fccbf 100644
--- a/src/layouts/vehicle-damage/vehicle-damage.spec.js
+++ b/src/layouts/vehicle-damage/vehicle-damage.spec.js
@@ -182,66 +182,6 @@ describe("vehicle-damage.vue", () => {
});
});
-describe("vehicle-damage.vue", () => {
- test("Windshield replace with single part on ForwardButtonAction triggers a router.navigate and saves selections to store", async () => {
- //Arrange
- const partsData = { partsOrQuestions: [
- {
- glassLocation: "Windshield",
- glassName: "Single",
- partQuestions: null,
- parts: [
- {
- color: "Green Tint, Green Shade",
- description: "rain sensor, solar",
- partNumber: "FW02728GGYN",
- requiresCapabilityQuestions: false,
- requiresRecalibration: false
- }
- ]}]};
-
- const { wrapper } = setupMocks({
- pageHeaderWidgetHeaderText: "",
- mountOptionsMockData: {
- router: { navigate: jest.fn(), },
- actionList: [{ actionName: storeActions.GET_PARTS_OR_QUESTIONS, data: partsData, },],
- store: {
- getters: {
- vehicle: {},
- payment: { insuranceCoverage: { isVerified: false } },
- },
- },
- },
- });
-
- wrapper.vm.selectedDamageLocations = ["Windshield"];
- wrapper.vm.selectedWindshieldOptions = {
- selectedWindshieldChipCount : null,
- selectedWindshieldReplaceOptions : ["Single"],
- selectedWindshieldDamageType: ["Replace"]
- };
-
- const expectedGlassToReplace = [{location: "Windshield", name: "Single"},];
-
- //Act
- vehicleDamage.beforeRouteEnter.call(
- wrapper.vm,
- { query: { fmgPage: "vehicle-damage" } },
- undefined,
- (c) => c(wrapper.vm)
- );
-
- await wrapper.vm.forwardButtonAction();
-
- //Assert
- expect(wrapper.vm.$router.navigate).toHaveBeenCalled();
- expect(wrapper.vm.selectedGlassToReplace()).toEqual(expectedGlassToReplace);
- expect(store.commit).toBeCalledWith(storeMutations.UPDATE_IS_REPAIR, false);
- expect(store.commit).toBeCalledWith(storeMutations.UPDATE_GLASS_TO_REPLACE, expectedGlassToReplace);
- expect(store.commit).toBeCalledWith(storeMutations.UPDATE_PARTS, partsData.partsOrQuestions[0].parts);
- });
-});
-
describe("vehicle-damage.vue", () => {
test("Windshield replace with multiple parts on ForwardButtonAction triggers a router.navigateAfterSave and saves selections to store", async () => {
//Arrange
@@ -332,48 +272,6 @@ describe("vehicle-damage.vue", () => {
});
});
-
-describe("vehicle-damage.vue", () => {
- test("Windshield repair on ForwardButtonAction triggers a router.navigate and saves selection to store", async () => {
- //Arrange
- const partsData = { partsOrQuestions: []};
- const { wrapper } = setupMocks({
- pageHeaderWidgetHeaderText: "",
- mountOptionsMockData: {
- router: { navigate: jest.fn(), },
- actionList: [{ actionName: storeActions.GET_PARTS_OR_QUESTIONS, data: partsData, },],
- store: {
- getters: {
- vehicle: {},
- payment: { insuranceCoverage: { isVerified: false } },
- },
- },
- },
- });
-
- wrapper.vm.selectedDamageLocations = ["Windshield"];
- wrapper.vm.selectedWindshieldOptions = {
- selectedWindshieldChipCount : [2],
- selectedWindshieldDamageType: ["Repair"]
- };
-
- //Act
- vehicleDamage.beforeRouteEnter.call(
- wrapper.vm,
- { query: { fmgPage: "vehicle-damage" } },
- undefined,
- (c) => c(wrapper.vm)
- );
-
- await wrapper.vm.forwardButtonAction();
-
- //Assert
- expect(wrapper.vm.$router.navigate).toHaveBeenCalled();
- expect(store.commit).toBeCalledWith(storeMutations.UPDATE_IS_REPAIR, true);
- expect(store.commit).toBeCalledWith(storeMutations.UPDATE_NUMBER_OF_CHIPS, 2);
- });
-});
-
describe("vehicle-damage.vue", () => {
test("isWindshieldDamageLocation is true when windshield is selected", async () => {
diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue
index a78e8a277..70ba3512f 100644
--- a/src/layouts/vehicle-damage/vehicle-damage.vue
+++ b/src/layouts/vehicle-damage/vehicle-damage.vue
@@ -132,6 +132,8 @@ export default {
vm.$refs.backGlassOptions.initializeComponent(
resultMap.damageOptions.backGlassOptions.availableReplacementOptions
);
+
+
});
},
data(){
@@ -147,10 +149,7 @@ export default {
}
},
mounted(){
- if(this.$store.getters.vehicle.imageVifNumber){
- this.pushEventToGA(this.GaCategories.EVOX, `${this.GaActions.VIF}_${this.$store.getters.vehicle.imageVifNumber}`,
- this.$store.getters.vehicle.carId, true);
- }
+ this.attachCustomEvents();
},
methods: {
arePagePrerequisitesValid() {
@@ -164,6 +163,13 @@ export default {
store.dispatch(storeActions.RESET_PARTS_STATE_AND_DEPENDENCIES);
},
+ attachCustomEvents(){
+ if(this.$store.getters.vehicle.imageVifNumber){
+ this.pushEventToGA(this.GaCategories.EVOX, `${this.GaActions.VIF}_${this.$store.getters.vehicle.imageVifNumber}`,
+ this.$store.getters.vehicle.carId, true);
+ }
+ },
+
backButtonAction() {
// route to move backwards
this.$router.navigate(
@@ -285,47 +291,20 @@ export default {
store.commit(this.storeMutations.UPDATE_GLASS_TO_REPLACE, this.selectedGlassToReplace());
- const partsData = await baseMixin.methods.dispatchStoreAction(this.storeActions.GET_PARTS_OR_QUESTIONS,
- { carId: store.getters.vehicle.carId, glassArray: this.selectedGlassToReplace()}, false);
-
- this.navigateForward(partsData);
+ this.navigateForward();
},
- navigateForward(partsData){
- // Temporary easter egg to navigate to address-lookup.
- if (store.getters.vehicle.year === 2014) {
- this.$router.navigateAfterSave(this.navigationScenarios.TEMPORARY_TO_ADDRESS_LOOKUP, this.$route, {}, {}, partsData.data);
- return;
- }
+ navigateForward(){
// If vin already exists, navigate directly to vin-lookup
- if(this.$store.getters.vehicle.vin){
- this.$router.navigate(this.navigationScenarios.CLICKED_FORWARD_WITH_VIN, this.$route);
+ if(store.getters.vehicle.vin) {
+ this.$router.navigateAfterSave(this.navigationScenarios.CLICKED_FORWARD_WITH_VIN, this.$route);
+ return;
+ }
+ else {
+ this.$router.navigateAfterSave(this.navigationScenarios.CLICKED_FORWARD_WITHOUT_VIN, this.$route);
return;
}
-
- //found problem questions
- if (partsData.data.partsOrQuestions.some(pq => pq.partQuestions != null && pq.partQuestions.length > 0)){
- this.$router.navigateAfterSave(this.navigationScenarios.SELECTED_DAMAGE_WITH_PART_QUESTIONS, this.$route, {}, {}, partsData.data);
- return;
- }
-
- //found multiple parts for a single glass location (Windshield, Driver, Passenger, Rear)
- if (partsData.data.partsOrQuestions){
- for (var i = 0; i < partsData.data.partsOrQuestions.length; i++){
- if (partsData.data.partsOrQuestions[i].parts != null && partsData.data.partsOrQuestions[i].parts.length > 1){
- this.$router.navigateAfterSave(this.navigationScenarios.SELECTED_DAMAGE_WITH_MULTIPLE_PARTS, this.$route, {}, {}, partsData.data);
- return;
- }
- }
- }
-
- //if not a repair then there should only be 1 part and no problem questions at this point so save the part to the store.
- if (!this.isWindshieldRepair){
- store.commit(this.storeMutations.UPDATE_PARTS, partsData.data.partsOrQuestions[0].parts);
- }
-
- this.$router.navigate(this.navigationScenarios.SELECTED_DAMAGE_WITH_SINGLE_PART, this.$route);
},
selectedGlassToReplace() {
diff --git a/src/layouts/vehicle-year/vehicle-year.vue b/src/layouts/vehicle-year/vehicle-year.vue
index cb6ff6fcb..c0eaa97be 100644
--- a/src/layouts/vehicle-year/vehicle-year.vue
+++ b/src/layouts/vehicle-year/vehicle-year.vue
@@ -24,7 +24,7 @@ import { settleAllPromises } from "@/helpers/layout-helper";
import { storeMutations } from "@/constants/store-mutations";
import { storeActions } from "@/constants/store-actions";
import { experimentUniverses } from "@/constants/experiments";
-import { getDeviceIdValue, getSessionIdValue, getSessionKeyValue } from "@/helpers/heritage-integration/cookie-helper";
+import { getDeviceIdValue, getSessionKeyValue } from "@/helpers/heritage-integration/cookie-helper";
import baseMixin from "@/mixins/base-mixin";
import store from "@/store";
@@ -96,7 +96,6 @@ export default {
return true;
},
resetDependentState() {
-
// Set
store.commit(storeMutations.UPDATE_MAKE, null);
store.commit(storeMutations.UPDATE_MODEL, null);
@@ -108,7 +107,7 @@ export default {
// Invokes
store.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES);
store.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES);
- }
+ },
},
components: {
yearQuestion,
diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue
index 5948e574b..4c43eb513 100644
--- a/src/layouts/vin-lookup/vin-lookup.vue
+++ b/src/layouts/vin-lookup/vin-lookup.vue
@@ -1,123 +1,115 @@
-