Merge pull request #2299 from Safelite/release/2025.02.13
Release/2025.02.13
This commit is contained in:
commit
182255821c
7 changed files with 127 additions and 6 deletions
|
|
@ -16,6 +16,13 @@
|
|||
v-model="parentAccountNumber"
|
||||
:originalList="originalList" />
|
||||
</div>
|
||||
<textLink
|
||||
id="payOnMyOwnBackButton"
|
||||
useLoadingModal
|
||||
linkType="text"
|
||||
:text="payWithCashButtonCopy"
|
||||
href="javascript:void(0)"
|
||||
@click-event="backButtonAction(foreceCashSelectionOnQuote = true)" />
|
||||
|
||||
<navbar
|
||||
cmsWidgetName="FunnelFooterWidget"
|
||||
|
|
@ -36,6 +43,7 @@ import navbar from "@/fmg-components/nav-bar/nav-bar";
|
|||
import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header";
|
||||
import loadingModal from "@/fmg-components/loading-modal/loading-modal.vue";
|
||||
import insuranceCompanyQuestion from "@/layouts/insurance-company/insurance-company-question";
|
||||
import textLink from "../../ux-components/text-link/text-link.vue";
|
||||
|
||||
// Supporting files
|
||||
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
||||
|
|
@ -92,6 +100,9 @@ export default {
|
|||
isParentAccountNumber() {
|
||||
return !!this.parentAccountNumber;
|
||||
},
|
||||
payWithCashButtonCopy() {
|
||||
return this.getCmsContent("PayWithCashWidget", "Text");
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
isCashParentAccountNumber() {
|
||||
|
|
@ -109,8 +120,13 @@ export default {
|
|||
arePagePrerequisitesValid() {
|
||||
return store.getters.order.payment.isInsurance === true;
|
||||
},
|
||||
backButtonAction() {
|
||||
backButtonAction(forceCashSelectionOnQuote) {
|
||||
// Go back to Quote page
|
||||
if (forceCashSelectionOnQuote) {
|
||||
this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route, {"isCashSelected": true});
|
||||
return;
|
||||
}
|
||||
|
||||
this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route);
|
||||
},
|
||||
async forwardButtonAction() {
|
||||
|
|
@ -157,6 +173,7 @@ export default {
|
|||
Form,
|
||||
loadingModal,
|
||||
insuranceCompanyQuestion,
|
||||
textLink,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -78,6 +78,20 @@ export default {
|
|||
);
|
||||
}
|
||||
|
||||
if (store.getters.externalParameterCustomer?.phoneNumber) {
|
||||
await baseMixin.methods.dispatchStoreAction(
|
||||
storeActions.SAVE_PHONE_NUMBER,
|
||||
store.getters.externalParameterCustomer.phoneNumber,
|
||||
false
|
||||
);
|
||||
|
||||
await baseMixin.methods.dispatchStoreAction(
|
||||
storeActions.SAVE_IS_SMS_OPT_IN,
|
||||
true,
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
baseMixin.methods.ResetExternalParamsAndHideModal();
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -79,6 +79,21 @@ export default {
|
|||
false
|
||||
);
|
||||
}
|
||||
|
||||
if (store.getters.externalParameterCustomer?.phoneNumber) {
|
||||
await baseMixin.methods.dispatchStoreAction(
|
||||
storeActions.SAVE_PHONE_NUMBER,
|
||||
store.getters.externalParameterCustomer.phoneNumber,
|
||||
false
|
||||
);
|
||||
|
||||
await baseMixin.methods.dispatchStoreAction(
|
||||
storeActions.SAVE_IS_SMS_OPT_IN,
|
||||
true,
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
baseMixin.methods.ResetExternalParamsAndHideModal();
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -577,6 +577,56 @@ describe("quote.vue", () => {
|
|||
//Assert
|
||||
expect(wrapper.vm.isInsuranceSelected).toBe(false);
|
||||
});
|
||||
test("should default to cash if isCashSelected is true, despite all other checks pointing to insurance selection", async () => {
|
||||
// Also needs no query parameter or previous selection in store to be present
|
||||
//Arrange
|
||||
|
||||
store.getters = {
|
||||
lineItems: {
|
||||
glassParts: ["item", "item2"],
|
||||
},
|
||||
applicationUser: {
|
||||
experiments: [],
|
||||
},
|
||||
order: {
|
||||
lineItems: {
|
||||
glassParts: ["item", "item2"],
|
||||
},
|
||||
payment: {
|
||||
isInsurance: true,
|
||||
},
|
||||
customer: {
|
||||
emailAddress: "test@test.com",
|
||||
},
|
||||
serviceLocation: {
|
||||
state: null,
|
||||
},
|
||||
},
|
||||
vehicle: {
|
||||
cardId: "123",
|
||||
},
|
||||
experimentSettings: {
|
||||
settingName: "SERVICE_PACKAGE_DISCOUNT",
|
||||
},
|
||||
};
|
||||
mockTierOnePrice = 505;
|
||||
const { wrapper } = setupMocks({});
|
||||
|
||||
|
||||
//Act
|
||||
await quote.beforeRouteEnter.call(
|
||||
wrapper.vm,
|
||||
{ query: { fmgPage: "quote",
|
||||
isInsuranceSelected: true,
|
||||
isCashSelected: true,
|
||||
} },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
);
|
||||
|
||||
//Assert
|
||||
expect(wrapper.vm.isInsuranceSelected).toBe(false);
|
||||
});
|
||||
test("should default to insurance if total economy package price is over $500", async () => {
|
||||
// Also needs no query parameter or previous selection in store to be present
|
||||
//Arrange
|
||||
|
|
|
|||
|
|
@ -328,6 +328,10 @@ export default {
|
|||
}
|
||||
|
||||
const getIsInsuranceSelectedValue = (availableLineItems, insuranceThreshold) => {
|
||||
// query param checked here is set on insurance-selection "Pay on my own" link click
|
||||
if (to.query?.isCashSelected || to.query?.iscashselected) {
|
||||
return false;
|
||||
}
|
||||
const serviceLocationState = store.getters.order.serviceLocation.state;
|
||||
|
||||
// usually true when returning from heritage but can be false when returning from heritage on a save quote
|
||||
|
|
|
|||
|
|
@ -202,11 +202,18 @@ export default {
|
|||
async forwardButtonAction() {
|
||||
const zipCodeData = await this.getZipCodeData(this.serviceZipCode);
|
||||
|
||||
if (vinPagesMixin.methods.isPhoneNumber(this.emailOrSms)) {
|
||||
const phone = this.emailOrSms.replace(/[()]/g, "");
|
||||
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, phone, false);
|
||||
} else {
|
||||
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.emailOrSms, false);
|
||||
// if no value due to field being optional, blank both phone and email address
|
||||
if (!this.emailOrSms) {
|
||||
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, "", false);
|
||||
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, "", false);
|
||||
}
|
||||
else {
|
||||
if (vinPagesMixin.methods.isPhoneNumber(this.emailOrSms)) {
|
||||
const phone = this.emailOrSms.replace(/[()]/g, "");
|
||||
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, phone, false);
|
||||
} else {
|
||||
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.emailOrSms, false);
|
||||
}
|
||||
}
|
||||
|
||||
await this.dispatchStoreAction(
|
||||
|
|
|
|||
|
|
@ -152,6 +152,20 @@ export default {
|
|||
if (isValid) {
|
||||
vm.forwardButtonAction();
|
||||
} else {
|
||||
if (store.getters.externalParameterCustomer?.phoneNumber) {
|
||||
await baseMixin.methods.dispatchStoreAction(
|
||||
storeActions.SAVE_PHONE_NUMBER,
|
||||
store.getters.externalParameterCustomer.phoneNumber,
|
||||
false
|
||||
);
|
||||
|
||||
await baseMixin.methods.dispatchStoreAction(
|
||||
storeActions.SAVE_IS_SMS_OPT_IN,
|
||||
true,
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
if (store.getters.externalParameterServiceZip.zipCode) {
|
||||
await baseMixin.methods.dispatchStoreAction(
|
||||
storeActions.SAVE_SERVICE_ZIP_CODE_INFO,
|
||||
|
|
|
|||
Loading…
Reference in a new issue