Merge pull request #3143 from Safelite/rlsmerge/2026.04.23-to-dev
Rlsmerge/2026.04.23 to dev
This commit is contained in:
commit
31ed28bdd5
6 changed files with 127 additions and 14 deletions
|
|
@ -81,7 +81,7 @@ const endpoints = {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
},
|
},
|
||||||
GetSupportingItems: {
|
GetSupportingItems: {
|
||||||
url: "/parts/api/v1/parts/supporting-items",
|
url: "/parts/api/v2/parts/supporting-items",
|
||||||
method: "POST",
|
method: "POST",
|
||||||
},
|
},
|
||||||
GetRecalPart: {
|
GetRecalPart: {
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ export async function navigateToHeritageFunnel({ shouldSaveSession, pageNameToLo
|
||||||
}
|
}
|
||||||
|
|
||||||
var heritageParms = {
|
var heritageParms = {
|
||||||
corid: store.getters.order.referralCorrelationId ?? "",
|
corid: store.getters.order.referralCorrelationId,
|
||||||
src: "concept-funnel",
|
src: "concept-funnel",
|
||||||
conceptsqid: store.getters.applicationUser.savedSessionId ?? "",
|
conceptsqid: store.getters.applicationUser.savedSessionId ?? "",
|
||||||
isInsurance: store.getters.payment.isInsurance,
|
isInsurance: store.getters.payment.isInsurance,
|
||||||
|
|
|
||||||
|
|
@ -187,6 +187,118 @@ describe("payment-adyen.vue", () => {
|
||||||
expect(result).toBe(true);
|
expect(result).toBe(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe("splitStreetAddress", () => {
|
||||||
|
const setInShopStreet = (streetAddress) => {
|
||||||
|
store.getters.order.serviceLocation.appointmentType = AppointmentTypeStrings.IN_SHOP;
|
||||||
|
store.getters.order.serviceLocation.provider.address.streetAddress = streetAddress;
|
||||||
|
};
|
||||||
|
|
||||||
|
test("splits typical address into first token as number and remainder as street", () => {
|
||||||
|
setInShopStreet("123 West Elm St");
|
||||||
|
const wrapper = setupMocks({});
|
||||||
|
|
||||||
|
expect(wrapper.vm.splitStreetAddress).toEqual({
|
||||||
|
number: "123",
|
||||||
|
street: "West Elm St",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test("two tokens: number and single-word street", () => {
|
||||||
|
setInShopStreet("456 Oak");
|
||||||
|
const wrapper = setupMocks({});
|
||||||
|
|
||||||
|
expect(wrapper.vm.splitStreetAddress).toEqual({
|
||||||
|
number: "456",
|
||||||
|
street: "Oak",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test("single token with no spaces: full string in number, empty street", () => {
|
||||||
|
setInShopStreet("123OakStreet");
|
||||||
|
const wrapper = setupMocks({});
|
||||||
|
|
||||||
|
expect(wrapper.vm.splitStreetAddress).toEqual({
|
||||||
|
number: "123OakStreet",
|
||||||
|
street: "",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test("collapses multiple spaces between words", () => {
|
||||||
|
setInShopStreet("123 West Elm St");
|
||||||
|
const wrapper = setupMocks({});
|
||||||
|
|
||||||
|
expect(wrapper.vm.splitStreetAddress).toEqual({
|
||||||
|
number: "123",
|
||||||
|
street: "West Elm St",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test("trims leading and trailing whitespace on full address", () => {
|
||||||
|
setInShopStreet(" 99 Maple Ave ");
|
||||||
|
const wrapper = setupMocks({});
|
||||||
|
|
||||||
|
expect(wrapper.vm.splitStreetAddress).toEqual({
|
||||||
|
number: "99",
|
||||||
|
street: "Maple Ave",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test("empty string yields empty number and street", () => {
|
||||||
|
setInShopStreet("");
|
||||||
|
const wrapper = setupMocks({});
|
||||||
|
|
||||||
|
expect(wrapper.vm.splitStreetAddress).toEqual({
|
||||||
|
number: "",
|
||||||
|
street: "",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test("whitespace-only address yields empty number and street", () => {
|
||||||
|
setInShopStreet(" \t ");
|
||||||
|
const wrapper = setupMocks({});
|
||||||
|
|
||||||
|
expect(wrapper.vm.splitStreetAddress).toEqual({
|
||||||
|
number: "",
|
||||||
|
street: "",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test("null address yields empty number and street", () => {
|
||||||
|
setInShopStreet(null);
|
||||||
|
const wrapper = setupMocks({});
|
||||||
|
|
||||||
|
expect(wrapper.vm.splitStreetAddress).toEqual({
|
||||||
|
number: "",
|
||||||
|
street: "",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test("uses mobile service address when appointment is mobile", () => {
|
||||||
|
store.getters.order.serviceLocation.appointmentType = AppointmentTypeStrings.MOBILE;
|
||||||
|
store.getters.order.serviceLocation.address = "700 Broadway Blvd";
|
||||||
|
store.getters.order.serviceLocation.city = "Columbus";
|
||||||
|
store.getters.order.serviceLocation.state = "OH";
|
||||||
|
store.getters.order.serviceLocation.zipCode = "43235";
|
||||||
|
|
||||||
|
const wrapper = setupMocks({});
|
||||||
|
|
||||||
|
expect(wrapper.vm.splitStreetAddress).toEqual({
|
||||||
|
number: "700",
|
||||||
|
street: "Broadway Blvd",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test("splits on tabs and other whitespace runs", () => {
|
||||||
|
setInShopStreet("10\tPine\tLane");
|
||||||
|
const wrapper = setupMocks({});
|
||||||
|
|
||||||
|
expect(wrapper.vm.splitStreetAddress).toEqual({
|
||||||
|
number: "10",
|
||||||
|
street: "Pine Lane",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function setupMocks({ customMountOptions } = {}) {
|
function setupMocks({ customMountOptions } = {}) {
|
||||||
|
|
|
||||||
|
|
@ -516,15 +516,14 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
splitStreetAddress() {
|
splitStreetAddress() {
|
||||||
const address = this.locationInfo.address;
|
const address = (this.locationInfo?.address ?? "").trim();
|
||||||
const tokens = address.split(" ") ?? [""];
|
const tokens = address.length ? address.split(/\s+/) : [""];
|
||||||
const number = tokens[0];
|
const number = tokens[0] ?? "";
|
||||||
|
const street = tokens.length > 1 ? tokens.slice(1).join(" ") : "";
|
||||||
const street = tokens.slice(1).reduce((prev, next) => `${prev} ${next}`);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
number: number ?? "",
|
number,
|
||||||
street: street ?? "",
|
street,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -705,11 +705,9 @@ export default {
|
||||||
},
|
},
|
||||||
isMobileStaticRecalibrationApplicable() {
|
isMobileStaticRecalibrationApplicable() {
|
||||||
return (
|
return (
|
||||||
(this.displayMSR &&
|
this.displayMSR &&
|
||||||
this.mobileFeePart?.partNumber == partNumberStrings.MOBILE_STATIC_RECAL_FEE &&
|
this.mobileFeePart?.partNumber == partNumberStrings.MOBILE_STATIC_RECAL_FEE &&
|
||||||
this.enableMSRSplitPay) ||
|
(this.enableMSRSplitPay || this.isCashItacNoComp || this.mobileFeePart?.isInsurable)
|
||||||
this.isCashItacNoComp ||
|
|
||||||
this.mobileFeePart?.isInsurable
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
displayMSR() {
|
displayMSR() {
|
||||||
|
|
|
||||||
|
|
@ -2124,6 +2124,7 @@ export const actions = {
|
||||||
const carId = context.getters.vehicle.carId;
|
const carId = context.getters.vehicle.carId;
|
||||||
const isRepair = context.getters.damage.isRepair;
|
const isRepair = context.getters.damage.isRepair;
|
||||||
const numberOfChips = context.getters.damage.numberOfChips;
|
const numberOfChips = context.getters.damage.numberOfChips;
|
||||||
|
const apptType = context.getters.order?.serviceLocation?.appointmentType;
|
||||||
|
|
||||||
return globalMethods.callHttpClient({
|
return globalMethods.callHttpClient({
|
||||||
method: endpoints.GetSupportingItems.method,
|
method: endpoints.GetSupportingItems.method,
|
||||||
|
|
@ -2134,6 +2135,9 @@ export const actions = {
|
||||||
parentAccountNumber: applicationConfig.CASH_PARENT_ACCOUNT_NUMBER,
|
parentAccountNumber: applicationConfig.CASH_PARENT_ACCOUNT_NUMBER,
|
||||||
parts: glassPartsArray,
|
parts: glassPartsArray,
|
||||||
numberOfRepairChips: isRepair ? numberOfChips : 0,
|
numberOfRepairChips: isRepair ? numberOfChips : 0,
|
||||||
|
providerNumber: context.getters.order.serviceLocation.zipCodeCtu,
|
||||||
|
facilityType:
|
||||||
|
apptType && apptType.trim() !== "" ? apptType : AppointmentTypeStrings.IN_SHOP,
|
||||||
},
|
},
|
||||||
logApiCall: true,
|
logApiCall: true,
|
||||||
pageNameToLog: pageNameToLog,
|
pageNameToLog: pageNameToLog,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue