diff --git a/jest.config.js b/jest.config.js
index 0749f4f71..839db4378 100644
--- a/jest.config.js
+++ b/jest.config.js
@@ -34,7 +34,7 @@ module.exports = {
testMatch: ["**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)"],
coverageThreshold: {
global: {
- statements: 85,
+ statements: 84,
// Got the go ahead from Mark to temporarily lower this. Taking out initialize component made the year,make,model and style coverage drop a bit. Once unit tests for license plate lookup, vin lookup and address lookup are in the coverage should go back up to 90
},
},
diff --git a/src/common-components/button-question/button-question.vue b/src/common-components/button-question/button-question.vue
index 20ad2b2f8..c2eb72971 100644
--- a/src/common-components/button-question/button-question.vue
+++ b/src/common-components/button-question/button-question.vue
@@ -40,7 +40,7 @@
-
@@ -134,7 +134,7 @@ export default {
return answer.Name ? answer.Name : answer;
},
handleCheckedChanged(val) {
-
+
this.pushEventToGA(this.$route.query[queryStrings.FMG_PAGE], this.GaActions.CLICKED, val.value, true);
if(this.isMultiSelect && this.selectedValues) {
diff --git a/src/common-components/loading-modal/loading-modal.vue b/src/common-components/loading-modal/loading-modal.vue
index a44347860..ed3a48ddf 100644
--- a/src/common-components/loading-modal/loading-modal.vue
+++ b/src/common-components/loading-modal/loading-modal.vue
@@ -8,7 +8,7 @@
-
+
@@ -99,4 +99,4 @@ const FMGAnimatedTransition = require("@/assets/img/FMGTransitionAnimation.svg")
width: 75px;
height: 75px;
}
-
\ No newline at end of file
+
diff --git a/src/common-components/textbox-question/textbox-question.vue b/src/common-components/textbox-question/textbox-question.vue
index 31437b8b9..673c1a263 100644
--- a/src/common-components/textbox-question/textbox-question.vue
+++ b/src/common-components/textbox-question/textbox-question.vue
@@ -19,6 +19,7 @@
:validationRules="validationRules"
@change="handleChange"
@blur="handleChange"
+ :maxlength="maxLength ? maxLength : '999'"
/>
{{ errorMessage }}
@@ -55,6 +56,7 @@ export default {
validationRules: String,
semiAggressiveValidation: Boolean,
cmsWidgetName: String,
+ maxLength: String,
},
setup(props) {
const propsClone = Object.assign({}, props);
diff --git a/src/constants/analytics.js b/src/constants/analytics.js
index f6f6ff82e..a3f057150 100644
--- a/src/constants/analytics.js
+++ b/src/constants/analytics.js
@@ -26,6 +26,7 @@ const GaLabels = {
ERROR: 'Error',
LICENSE_PLATE_LOOKUP: 'License_Plate_Look_Up',
VIN_LOOKUP: 'Vin_Look_Up',
+ ADDRESS_LOOKUP: 'Address_Look_up',
};
diff --git a/src/layouts/address-lookup/address-lookup.vue b/src/layouts/address-lookup/address-lookup.vue
index 445bddf16..f6e0d2b3d 100644
--- a/src/layouts/address-lookup/address-lookup.vue
+++ b/src/layouts/address-lookup/address-lookup.vue
@@ -150,6 +150,16 @@ export default {
this.$route
);
},
+ attachCustomEvents() {
+ this.prependActionToMethod(this, this.forwardButtonAction, () => {
+ this.pushEventToGA(
+ this.$route.query[this.queryStrings.FMG_PAGE],
+ this.GaActions.SUBMITTED,
+ this.GaLabels.ADDRESS_LOOKUP,
+ true
+ );
+ });
+ },
getRegistrationAddressFromStore() {
return store.getters.vehicle.registration.address;
},
@@ -356,6 +366,9 @@ export default {
}
}
},
+ mounted() {
+ this.attachCustomEvents();
+ },
computed: {
AlertNonServiceableZipHeader(){
const zipCode = this.serviceZipCode ? this.serviceZipCode : this.customerQuestions.addressQuestions.zipCode;
diff --git a/src/layouts/license-plate-lookup/license-plate-lookup.spec.js b/src/layouts/license-plate-lookup/license-plate-lookup.spec.js
index d3258c41b..8c32b2407 100644
--- a/src/layouts/license-plate-lookup/license-plate-lookup.spec.js
+++ b/src/layouts/license-plate-lookup/license-plate-lookup.spec.js
@@ -87,7 +87,6 @@ describe("license-plate-lookup.vue", () => {
//Assert
expect(wrapper.vm.$router.navigate).toHaveBeenCalled();
-
});
});
diff --git a/src/layouts/license-plate-lookup/license-plate-lookup.vue b/src/layouts/license-plate-lookup/license-plate-lookup.vue
index 3d65717cf..7ec79773b 100644
--- a/src/layouts/license-plate-lookup/license-plate-lookup.vue
+++ b/src/layouts/license-plate-lookup/license-plate-lookup.vue
@@ -24,7 +24,7 @@
v-model="registrationZip"
inputId="zip"
mask="#####"
- validationRules="zip-required"
+ validationRules="zip-required|zip-format"
/>
@@ -54,6 +54,7 @@
v-model="serviceZip"
inputId="serviceZip"
validationRules="zip-required|zip-format"
+ semiAggressiveValidation
/>
@@ -87,56 +88,25 @@ import alert from "@/ux-components/alert/alert";
import textboxQuestion from "@/common-components/textbox-question/textbox-question";
import loadingModal from '@/common-components/loading-modal/loading-modal.vue';
// Supporting files
-import {
- fetchCmsContentForPage
-} from "@/helpers/cms-content-helper";
-import {
- settleAllPromises
-} from "@/helpers/layout-helper";
+import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
+import { settleAllPromises } from "@/helpers/layout-helper";
import store from "@/store";
import baseMixin from "@/mixins/base-mixin.js";
-import {
- storeActions
-} from "@/constants/store-actions";
-import {
- storeMutations
-} from "@/constants/store-mutations";
-import {
- errorMessages
-} from "@/constants/error-messages";
-import {
- navigateAfterSaveToHeritageFunnel
-} from "@/helpers/heritage-integration/navigation-helper";
-import {
- getDamageString,
- isGlassAvailableForCarId,
-} from "@/helpers/damage-helper";
-import {
- required,
- regex,
-} from "@/helpers/validation-rules";
-import {
- Form,
- defineRule,
-} from "vee-validate";
+import { storeActions } from "@/constants/store-actions";
+import { storeMutations } from "@/constants/store-mutations";
+import { errorMessages } from "@/constants/error-messages";
+import { navigateAfterSaveToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
+import { getDamageString, isGlassAvailableForCarId, } from "@/helpers/damage-helper";
+import { required, regex, } from "@/helpers/validation-rules";
+import { Form, defineRule, } from "vee-validate";
// DEFINE VALIDATION RULES
-defineRule(
- "license-plate-required",
- required(errorMessages.LICENSE_PLATE_REQUIRED)
-);
+defineRule("license-plate-required", required(errorMessages.LICENSE_PLATE_REQUIRED));
defineRule("zip-required", required(errorMessages.REGISTRATION_ZIP_REQUIRED));
-defineRule(
- "email-address-required",
- required(errorMessages.EMAIL_ADDRESS_REQUIRED)
-);
-defineRule(
- "email-address-format",
- regex(
- /^([a-zA-Z0-9_\-.+]+)@([a-zA-Z0-9_\-.]+)\.([a-zA-Z]{2,})$/,
- errorMessages.EMAIL_ADDRESS_FORMAT
- )
-);
+defineRule("zip-format", regex(/(^\d{5}$)|(^\d{5}-\d{4}$)/, errorMessages.SERVICE_ZIP_FORMAT));
+defineRule("email-address-required", required(errorMessages.EMAIL_ADDRESS_REQUIRED));
+defineRule("email-address-format", regex(/^([a-zA-Z0-9_\-.+]+)@([a-zA-Z0-9_\-.]+)\.([a-zA-Z]{2,})$/, errorMessages.EMAIL_ADDRESS_FORMAT));
+
export default {
name: "license-plate-lookup",
async beforeRouteEnter(to, from, next) {
@@ -229,12 +199,12 @@ export default {
},
attachCustomEvents() {
this.prependActionToMethod(this, this.forwardButtonAction, () => {
- this.pushEventToGA(
+ this.pushEventToGA(
this.$route.query[this.queryStrings.FMG_PAGE],
this.GaActions.SUBMITTED,
this.GaLabels.LICENSE_PLATE_LOOKUP,
true
- );
+ );
});
},
getLicensePlateFromStore() {
diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue
index 56da4301d..1f4f6c9ce 100644
--- a/src/layouts/vin-lookup/vin-lookup.vue
+++ b/src/layouts/vin-lookup/vin-lookup.vue
@@ -24,6 +24,7 @@
disableAutoFill
validationRules="vin-required|vin-format"
:isDisabled="isVinFieldReadOnly"
+ maxLength="17"
/>
@@ -41,7 +42,7 @@
mask="#####"
isRequired
disableAutoFill
- validationRules="zip-required"
+ validationRules="zip-required|zip-format"
/>
@@ -141,29 +142,12 @@ import { Form, defineRule } from "vee-validate";
import { navigateAfterSaveToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
// DEFINE VALIDATION RULES
-defineRule(
- "zip-required",
- required(errorMessages.SERVICE_ZIP_REQUIRED)
-);
-defineRule(
- "email-address-required",
- required(errorMessages.EMAIL_ADDRESS_REQUIRED)
-);
-defineRule(
- "email-address-format",
- regex(
- /^([a-zA-Z0-9_\-.+]+)@([a-zA-Z0-9_\-.]+)\.([a-zA-Z]{2,})$/,
- errorMessages.EMAIL_ADDRESS_FORMAT
- )
-);
-defineRule(
- "vin-required",
- required(errorMessages.VIN_REQUIRED)
-);
-defineRule(
- "vin-format",
- regex(/^[A-HJ-NPR-Z0-9]{17}$/, errorMessages.VIN_FORMAT)
-);
+defineRule("zip-required", required(errorMessages.SERVICE_ZIP_REQUIRED));
+defineRule("zip-format", regex(/(^\d{5}$)|(^\d{5}-\d{4}$)/, errorMessages.SERVICE_ZIP_FORMAT));
+defineRule("email-address-required", required(errorMessages.EMAIL_ADDRESS_REQUIRED));
+defineRule("email-address-format", regex(/^([a-zA-Z0-9_\-.+]+)@([a-zA-Z0-9_\-.]+)\.([a-zA-Z]{2,})$/, errorMessages.EMAIL_ADDRESS_FORMAT));
+defineRule("vin-required", required(errorMessages.VIN_REQUIRED));
+defineRule("vin-format", regex(/^[A-HJ-NPR-Z0-9]{17}$/, errorMessages.VIN_FORMAT));
export default {
name: "vin-lookup",
@@ -200,6 +184,9 @@ export default {
vinPopulatedOnPageLoad: this.getVinFromStore()?.length > 0,
};
},
+ mounted() {
+ this.attachCustomEvents();
+ },
watch: {
vin() {
this.$refs.funnelFooter.updateButtonText(
@@ -272,12 +259,12 @@ export default {
getZipFromStore(){
return store.getters.order.serviceLocation.zipCode;
},
- attachCustomEvents() {
+ attachCustomEvents() {
this.prependActionToMethod(this, this.forwardButtonAction, () => {
this.pushEventToGA(
this.$route.query[this.queryStrings.FMG_PAGE],
this.GaActions.SUBMITTED,
- this.GaLabels.VINLOOKUP,
+ this.GaLabels.VIN_LOOKUP,
true
);
});
diff --git a/src/mixins/analytics-mixin.js b/src/mixins/analytics-mixin.js
index d13e1b222..133187797 100644
--- a/src/mixins/analytics-mixin.js
+++ b/src/mixins/analytics-mixin.js
@@ -97,8 +97,9 @@ export default {
},
prependActionToMethod(object, method, actionToPrepend) {
- const baseMethod = object[method.name];
- object[method.name] = function () {
+ const baseMethodName = method.name.startsWith('bound ') ? method.name.substring(6) : method.name ;
+ const baseMethod = object[baseMethodName];
+ object[baseMethodName] = function () {
actionToPrepend.apply(this, arguments);
return baseMethod.apply(object, arguments);
};
diff --git a/src/mixins/analytics-mixin.spec.js b/src/mixins/analytics-mixin.spec.js
index e63778466..8dd49045d 100644
--- a/src/mixins/analytics-mixin.spec.js
+++ b/src/mixins/analytics-mixin.spec.js
@@ -107,4 +107,17 @@ describe("analyticsMixin.js", () => {
}]);
});
+
+ test("Obj is not null after action prepended", () => {
+ //Arrange
+ const obj = {baseMethodName:"testMethodName", data:"testData"};
+ const method = {name:"testMethodName", data:"testData" }
+ const action = "testAction";
+
+ //Act
+ analyticsMixin.methods.prependActionToMethod(obj, method, action);
+
+ //Assert
+ expect(obj!=null);
+ });
});
\ No newline at end of file
diff --git a/src/styles/common-error-styles.scss b/src/styles/common-error-styles.scss
index 587900512..95985f7c4 100644
--- a/src/styles/common-error-styles.scss
+++ b/src/styles/common-error-styles.scss
@@ -88,12 +88,14 @@ html {
border: 1px solid $gray-500;
input:not(:focus) {
+ label {
+ border: none;
box-shadow: 0 0 0 1px $gray-500;
border-radius: .5rem;
}
}
input:checked:focus {
+ label {
+ border: none;
box-shadow: 0 0 0 2.5px $blue;
border-radius: .5rem;
}