Merge pull request #1171 from Safelite/feature/humphries/INSR-8878.1
Fixes for events on welcome-page and contact-details
This commit is contained in:
commit
56ab1ce835
5 changed files with 18 additions and 9 deletions
6
src/constants/contact-details.js
Normal file
6
src/constants/contact-details.js
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
const vehicleProtectedAnswers = Object.freeze({
|
||||
YES: 'YesAnswer',
|
||||
NO: 'NoAnswer'
|
||||
});
|
||||
|
||||
export { vehicleProtectedAnswers };
|
||||
|
|
@ -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, 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,
|
||||
|
|
|
|||
|
|
@ -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 || vehicleProtectedAnswers.NO,
|
||||
provider
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -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: {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue