From 20c13695a2d2f72bf95ae4aa6ac30af645f9a5be Mon Sep 17 00:00:00 2001 From: Alex Humphries Date: Mon, 6 Apr 2026 09:58:24 -0400 Subject: [PATCH 1/3] Fixes for events on welcome-page and contact-details --- src/constants/contact-details.js | 6 ++++++ src/layouts/contact-details/contact-details.spec.js | 7 ++++--- src/layouts/contact-details/contact-details.vue | 5 +++-- src/layouts/payment-page/payment-page.spec.js | 3 ++- src/layouts/welcome-page/welcome-page.vue | 6 +++--- 5 files changed, 18 insertions(+), 9 deletions(-) create mode 100644 src/constants/contact-details.js diff --git a/src/constants/contact-details.js b/src/constants/contact-details.js new file mode 100644 index 00000000..e67fa086 --- /dev/null +++ b/src/constants/contact-details.js @@ -0,0 +1,6 @@ +const vehicleProtectedAnswers = Object.freeze({ + YES: 'YesAnswer', + NO: 'NoAnswer' +}); + +export { vehicleProtectedAnswers }; \ No newline at end of file diff --git a/src/layouts/contact-details/contact-details.spec.js b/src/layouts/contact-details/contact-details.spec.js index 6d1be304..f62fa211 100644 --- a/src/layouts/contact-details/contact-details.spec.js +++ b/src/layouts/contact-details/contact-details.spec.js @@ -6,9 +6,10 @@ import contactDetails from '@/layouts/contact-details/contact-details.vue'; // Supporting Files import baseMixin from '@/mixins/base-mixin'; import { getMountOptions } from '@/helpers/unit-test-helper.js'; -import { getRandomString, getRandomInt, getRandomBoolean } from '@/helpers/data-generation.js'; +import { getRandomString, getRandomInt, getRandomBoolean, getRandomStringFromList, getRandomEnum } from '@/helpers/data-generation.js'; import navigationScenarios from '@/router/router-constants/navigation-scenarios.js'; import { useMainStore } from '@/store/index.js'; +import { vehicleProtectedAnswers } from '@/constants/contact-details'; /** @ignore */ function setupMocks({ @@ -284,7 +285,7 @@ describe('contactDetails.vue', () => { const state = getRandomString(2, 2); const zipCode = getRandomInt(10000, 99999).toString(); const notesForTechnician = getRandomString(1, 100); - const isVehicleProtected = getRandomBoolean(); + const isVehicleProtected = getRandomEnum(vehicleProtectedAnswers); const storeData = { order: { serviceLocation: { @@ -372,7 +373,7 @@ describe('contactDetails.vue', () => { const city = getRandomString(4, 20); const state = getRandomString(2, 2); const zipCode = getRandomInt(10000, 99999).toString(); - const isVehicleProtected = getRandomBoolean().toString(); + const isVehicleProtected = getRandomEnum(vehicleProtectedAnswers); wrapper.setData({ address, address2, diff --git a/src/layouts/contact-details/contact-details.vue b/src/layouts/contact-details/contact-details.vue index a5c0c646..088b7997 100644 --- a/src/layouts/contact-details/contact-details.vue +++ b/src/layouts/contact-details/contact-details.vue @@ -134,6 +134,7 @@ import { required } from '@/helpers/validation-rules'; import widgetFields from '@/constants/cms-widget-fields'; import states from '@/constants/states'; import applicationConfig from '@/constants/application-config'; +import { vehicleProtectedAnswers } from '@/constants/contact-details'; // DEFINE VALIDATION RULES defineRule('street-address-required', required(errorMessages.SERVICE_ADDRESS_REQUIRED)); @@ -238,7 +239,7 @@ export default { } }, isVehicleProtected(newValue) { - this.pushEventToGA("mobile_location", "is_vehicle_protected", newValue, true); + this.pushEventToGA("mobile_location", "covered_location", newValue === vehicleProtectedAnswers.YES ? "Yes" : "No", true); } }, methods: { @@ -259,7 +260,7 @@ export default { address: this.address, address2: this.address2, city: this.city, - isVehicleProtected: this.isVehicleProtected || 'false', + isVehicleProtected: this.isVehicleProtected, provider }); diff --git a/src/layouts/payment-page/payment-page.spec.js b/src/layouts/payment-page/payment-page.spec.js index 89293dd4..0b5b20ef 100644 --- a/src/layouts/payment-page/payment-page.spec.js +++ b/src/layouts/payment-page/payment-page.spec.js @@ -11,6 +11,7 @@ import { createTestingPinia } from '@pinia/testing'; import settleAllPromises from '@/helpers/layout-helper'; import { fetchCmsContentForPage } from '@/helpers/cms-content-helper'; import baseMixin from '@/mixins/base-mixin'; +import { vehicleProtectedAnswers } from '@/constants/contact-details'; // Constants const parts = { @@ -169,7 +170,7 @@ const defaultOrder = { zipCode: 'zip', zipCodeCtu: 'zipCtu', appointmentType: 'IN_SHOP', - isVehicleProtected: true, + isVehicleProtected: vehicleProtectedAnswers.YES, provider: { providerNumber: 2, address: { diff --git a/src/layouts/welcome-page/welcome-page.vue b/src/layouts/welcome-page/welcome-page.vue index 2b80ca23..1bb70de7 100644 --- a/src/layouts/welcome-page/welcome-page.vue +++ b/src/layouts/welcome-page/welcome-page.vue @@ -256,10 +256,10 @@ export default { mounted() { if (this.mainStore.applicationUser.firstHit) { const isInfoPrefilled = !!(this.mainStore.order.policy.policyNumber - && this.mainStore.order.policy.dateOfLoss - && this.mainStore.order.policy.policyZipCode); + || this.mainStore.order.policy.dateOfLoss + || this.mainStore.order.policy.policyZipCode); - this.pushEventToGA("policy_info", "info_prefilled", isInfoPrefilled.toString(), true); + this.pushEventToGA("policy_info", "info_prefilled", isInfoPrefilled ? "Yes" : "No", true); this.$nextTick(() => { const formRoot = this.$el; From 67174e2914eac73a387eb97aa36e30ecca59a0f3 Mon Sep 17 00:00:00 2001 From: Alex Humphries Date: Mon, 6 Apr 2026 09:59:51 -0400 Subject: [PATCH 2/3] Remove outdated import in contact-details.spec.js --- src/layouts/contact-details/contact-details.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layouts/contact-details/contact-details.spec.js b/src/layouts/contact-details/contact-details.spec.js index f62fa211..1774acc3 100644 --- a/src/layouts/contact-details/contact-details.spec.js +++ b/src/layouts/contact-details/contact-details.spec.js @@ -6,7 +6,7 @@ import contactDetails from '@/layouts/contact-details/contact-details.vue'; // Supporting Files import baseMixin from '@/mixins/base-mixin'; import { getMountOptions } from '@/helpers/unit-test-helper.js'; -import { getRandomString, getRandomInt, getRandomBoolean, getRandomStringFromList, getRandomEnum } from '@/helpers/data-generation.js'; +import { getRandomString, getRandomInt, getRandomEnum } from '@/helpers/data-generation.js'; import navigationScenarios from '@/router/router-constants/navigation-scenarios.js'; import { useMainStore } from '@/store/index.js'; import { vehicleProtectedAnswers } from '@/constants/contact-details'; From 74f5f50326bcf434aa0f76b4801443f43caa14da Mon Sep 17 00:00:00 2001 From: Alex Humphries Date: Mon, 6 Apr 2026 10:11:23 -0400 Subject: [PATCH 3/3] Re-add default for vehicle protected question --- src/layouts/contact-details/contact-details.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layouts/contact-details/contact-details.vue b/src/layouts/contact-details/contact-details.vue index 088b7997..2af0960d 100644 --- a/src/layouts/contact-details/contact-details.vue +++ b/src/layouts/contact-details/contact-details.vue @@ -260,7 +260,7 @@ export default { address: this.address, address2: this.address2, city: this.city, - isVehicleProtected: this.isVehicleProtected, + isVehicleProtected: this.isVehicleProtected || vehicleProtectedAnswers.NO, provider });