Merge branch 'feature/CSR-2185' of github.com:Safelite/DigitalConsumer.FixMyGlass into feature/CSR-2185

This commit is contained in:
Matt Sykes 2024-08-27 16:20:09 -04:00
commit 44049fdc33
138 changed files with 1244 additions and 1247 deletions

View file

@ -1,5 +1,6 @@
{ {
"tabWidth": 4, "tabWidth": 4,
"bracketSameLine": true, "bracketSameLine": true,
"printWidth": 100 "printWidth": 100,
"trailingComma" : "es5"
} }

View file

@ -89,7 +89,7 @@ export function getTintImage(glassLocation, colorString) {
} }
const tintImageSource = tintMap[glassLocation.toLowerCase()].find( const tintImageSource = tintMap[glassLocation.toLowerCase()].find(
(item) => item.name.toLowerCase() == colorString.toLowerCase(), (item) => item.name.toLowerCase() == colorString.toLowerCase()
); );
return tintImageSource; return tintImageSource;

View file

@ -524,7 +524,7 @@ describe("baseInputButton.vue", () => {
// Assert // Assert
expect(wrapper.vm.handleChange).toHaveBeenCalledWith(resultingValueToEmit); expect(wrapper.vm.handleChange).toHaveBeenCalledWith(resultingValueToEmit);
}, }
); );
describe("checkbox", () => { describe("checkbox", () => {
@ -644,7 +644,7 @@ describe("baseInputButton.vue", () => {
// Assert // Assert
expect(wrapper.vm.valueToEmit).toEqual(["Hello", "Mello"]); expect(wrapper.vm.valueToEmit).toEqual(["Hello", "Mello"]);
expect(wrapper.vm.handleChange).toHaveBeenCalledWith(["Hello", "Mello"]); expect(wrapper.vm.handleChange).toHaveBeenCalledWith(["Hello", "Mello"]);
}, }
); );
}); });
@ -672,7 +672,7 @@ describe("baseInputButton.vue", () => {
// Assert // Assert
expect(wrapper.vm.valueToEmit).toEqual("Bello"); expect(wrapper.vm.valueToEmit).toEqual("Bello");
expect(wrapper.vm.handleChange).toHaveBeenCalledWith("Bello"); expect(wrapper.vm.handleChange).toHaveBeenCalledWith("Bello");
}, }
); );
}); });
}); });
@ -721,7 +721,7 @@ describe("baseInputButton.vue", () => {
// Assert // Assert
expect(wrapper.emitted()["update:modelValue"][0][0]).toEqual("HELLO WORLD"); expect(wrapper.emitted()["update:modelValue"][0][0]).toEqual("HELLO WORLD");
}, }
); );
}); });
@ -957,7 +957,7 @@ describe("baseInputButton.vue", () => {
"Clicked", "Clicked",
"Bello", "Bello",
true, true,
undefined, undefined
); );
expect(wrapper.vm.setLastValuePushedToGa).toHaveBeenCalledWith("Bello"); expect(wrapper.vm.setLastValuePushedToGa).toHaveBeenCalledWith("Bello");
}); });
@ -1020,7 +1020,7 @@ describe("baseInputButton.vue", () => {
const inputElement = wrapper.find("input"); const inputElement = wrapper.find("input");
expect(wrapper.vm.isChecked).toEqual(false); expect(wrapper.vm.isChecked).toEqual(false);
expect(inputElement.element.checked).toBe(false); expect(inputElement.element.checked).toBe(false);
}, }
); );
test("modelValue doesn't contain this button's value => checkbox isn't checked", async () => { test("modelValue doesn't contain this button's value => checkbox isn't checked", async () => {
@ -1082,7 +1082,7 @@ describe("baseInputButton.vue", () => {
const inputElement = wrapper.find("input"); const inputElement = wrapper.find("input");
expect(wrapper.vm.isChecked).toEqual(false); expect(wrapper.vm.isChecked).toEqual(false);
expect(inputElement.element.checked).toBe(false); expect(inputElement.element.checked).toBe(false);
}, }
); );
test("modelValue equals this button's value => radio button is checked", () => { test("modelValue equals this button's value => radio button is checked", () => {

View file

@ -134,7 +134,7 @@ export default {
this.GaActions.CLICKED, this.GaActions.CLICKED,
value?.toString() ?? this.value?.toString(), value?.toString() ?? this.value?.toString(),
true, true,
this.valueToLogType, this.valueToLogType
); );
this.setLastValuePushedToGa(value ?? this.value); this.setLastValuePushedToGa(value ?? this.value);
@ -182,7 +182,7 @@ export default {
const { handleChange, meta, errors } = useField( const { handleChange, meta, errors } = useField(
toRef(props, "groupName"), toRef(props, "groupName"),
toRef(props, "validationRules"), toRef(props, "validationRules"),
fieldOptions, fieldOptions
); );
return { return {

View file

@ -69,7 +69,7 @@ describe("buttonQuestion.vue", () => {
// Arrange // Arrange
const wrapper = shallowMount( const wrapper = shallowMount(
buttonQuestion, buttonQuestion,
setupMocks({ propsData: { groupName: "group-name" } }), setupMocks({ propsData: { groupName: "group-name" } })
); );
await wrapper.setProps({ await wrapper.setProps({
answers: ["2022", "2021", "2020"], answers: ["2022", "2021", "2020"],
@ -87,7 +87,7 @@ describe("buttonQuestion.vue", () => {
test("is checkbox => should emit captured value", async () => { test("is checkbox => should emit captured value", async () => {
const wrapper = shallowMount( const wrapper = shallowMount(
buttonQuestion, buttonQuestion,
setupMocks({ propsData: { groupName: "group-name" } }), setupMocks({ propsData: { groupName: "group-name" } })
); );
await wrapper.setProps({ await wrapper.setProps({
answers: ["2022", "2021", "2020"], answers: ["2022", "2021", "2020"],
@ -125,7 +125,7 @@ describe("buttonQuestion.vue", () => {
buttonTypeString: "mockComponent", buttonTypeString: "mockComponent",
buttonTypeObject: mockComponent, buttonTypeObject: mockComponent,
}, },
}), })
); );
// Act // Act
@ -158,7 +158,7 @@ describe("buttonQuestion.vue", () => {
}, },
], ],
}, },
}), })
); );
// Act // Act
@ -184,7 +184,7 @@ describe("buttonQuestion.vue", () => {
}, },
], ],
}, },
}), })
); );
// Act // Act
@ -212,7 +212,7 @@ describe("buttonQuestion.vue", () => {
}, },
], ],
}, },
}), })
); );
// Act // Act
@ -231,7 +231,7 @@ describe("buttonQuestion.vue", () => {
propsData: { propsData: {
answers: ["answer 1", "answer 2"], answers: ["answer 1", "answer 2"],
}, },
}), })
); );
// Act // Act
@ -259,7 +259,7 @@ describe("buttonQuestion.vue", () => {
}, },
], ],
}, },
}), })
); );
// Act // Act
@ -285,7 +285,7 @@ describe("buttonQuestion.vue", () => {
}, },
], ],
}, },
}), })
); );
// Act // Act
@ -313,7 +313,7 @@ describe("buttonQuestion.vue", () => {
}, },
], ],
}, },
}), })
); );
// Act // Act
@ -332,7 +332,7 @@ describe("buttonQuestion.vue", () => {
propsData: { propsData: {
answers: ["answer 1", "answer 2"], answers: ["answer 1", "answer 2"],
}, },
}), })
); );
// Act // Act
@ -360,7 +360,7 @@ describe("buttonQuestion.vue", () => {
}, },
], ],
}, },
}), })
); );
// Act // Act
@ -386,7 +386,7 @@ describe("buttonQuestion.vue", () => {
}, },
], ],
}, },
}), })
); );
// Act // Act
@ -414,7 +414,7 @@ describe("buttonQuestion.vue", () => {
}, },
], ],
}, },
}), })
); );
// Act // Act
@ -433,7 +433,7 @@ describe("buttonQuestion.vue", () => {
propsData: { propsData: {
answers: ["answer 1", "answer 2"], answers: ["answer 1", "answer 2"],
}, },
}), })
); );
// Act // Act
@ -461,7 +461,7 @@ describe("buttonQuestion.vue", () => {
}, },
], ],
}, },
}), })
); );
// Act // Act
@ -487,7 +487,7 @@ describe("buttonQuestion.vue", () => {
}, },
], ],
}, },
}), })
); );
// Act // Act
@ -515,7 +515,7 @@ describe("buttonQuestion.vue", () => {
}, },
], ],
}, },
}), })
); );
// Act // Act
@ -534,7 +534,7 @@ describe("buttonQuestion.vue", () => {
propsData: { propsData: {
answers: ["answer 1", "answer 2"], answers: ["answer 1", "answer 2"],
}, },
}), })
); );
// Act // Act
@ -562,7 +562,7 @@ describe("buttonQuestion.vue", () => {
}, },
], ],
}, },
}), })
); );
// Act // Act
@ -588,7 +588,7 @@ describe("buttonQuestion.vue", () => {
}, },
], ],
}, },
}), })
); );
// Act // Act
@ -616,7 +616,7 @@ describe("buttonQuestion.vue", () => {
}, },
], ],
}, },
}), })
); );
// Act // Act
@ -635,7 +635,7 @@ describe("buttonQuestion.vue", () => {
propsData: { propsData: {
answers: ["answer 1", "answer 2"], answers: ["answer 1", "answer 2"],
}, },
}), })
); );
// Act // Act
@ -660,7 +660,7 @@ describe("buttonQuestion.vue", () => {
answers: answerGroup, answers: answerGroup,
groupName: "this is my group name", groupName: "this is my group name",
}, },
}), })
); );
// Act // Act
@ -669,7 +669,7 @@ describe("buttonQuestion.vue", () => {
// Assert // Assert
expect(buttonsInfo[0].groupName).toEqual("this-is-my-group-name"); expect(buttonsInfo[0].groupName).toEqual("this-is-my-group-name");
expect(buttonsInfo[1].groupName).toEqual("this-is-my-group-name"); expect(buttonsInfo[1].groupName).toEqual("this-is-my-group-name");
}, }
); );
test.each(answers)( test.each(answers)(
@ -683,7 +683,7 @@ describe("buttonQuestion.vue", () => {
answers: answerGroup, answers: answerGroup,
groupName: "this-is-my-group-name", groupName: "this-is-my-group-name",
}, },
}), })
); );
// Act // Act
@ -692,7 +692,7 @@ describe("buttonQuestion.vue", () => {
// Assert // Assert
expect(buttonsInfo[0].groupName).toEqual("this-is-my-group-name"); expect(buttonsInfo[0].groupName).toEqual("this-is-my-group-name");
expect(buttonsInfo[1].groupName).toEqual("this-is-my-group-name"); expect(buttonsInfo[1].groupName).toEqual("this-is-my-group-name");
}, }
); );
}); });
@ -714,7 +714,7 @@ describe("buttonQuestion.vue", () => {
}, },
], ],
}, },
}), })
); );
// Act // Act
@ -741,7 +741,7 @@ describe("buttonQuestion.vue", () => {
}, },
], ],
}, },
}), })
); );
// Act // Act
@ -768,7 +768,7 @@ describe("buttonQuestion.vue", () => {
}, },
], ],
}, },
}), })
); );
// Act // Act
@ -797,7 +797,7 @@ describe("buttonQuestion.vue", () => {
}, },
], ],
}, },
}), })
); );
// Act // Act
@ -826,7 +826,7 @@ describe("buttonQuestion.vue", () => {
}, },
], ],
}, },
}), })
); );
// Act // Act
@ -855,7 +855,7 @@ describe("buttonQuestion.vue", () => {
}, },
], ],
}, },
}), })
); );
// Act // Act
@ -886,7 +886,7 @@ describe("buttonQuestion.vue", () => {
}, },
], ],
}, },
}), })
); );
// Act // Act
@ -906,7 +906,7 @@ describe("buttonQuestion.vue", () => {
useTextForValue: true, useTextForValue: true,
answers: ["answer 1", "answer 2"], answers: ["answer 1", "answer 2"],
}, },
}), })
); );
// Act // Act
@ -935,7 +935,7 @@ describe("buttonQuestion.vue", () => {
}, },
], ],
}, },
}), })
); );
// Act // Act
@ -962,7 +962,7 @@ describe("buttonQuestion.vue", () => {
}, },
], ],
}, },
}), })
); );
// Act // Act
@ -989,7 +989,7 @@ describe("buttonQuestion.vue", () => {
}, },
], ],
}, },
}), })
); );
// Act // Act
@ -1018,7 +1018,7 @@ describe("buttonQuestion.vue", () => {
}, },
], ],
}, },
}), })
); );
// Act // Act
@ -1047,7 +1047,7 @@ describe("buttonQuestion.vue", () => {
}, },
], ],
}, },
}), })
); );
// Act // Act
@ -1076,7 +1076,7 @@ describe("buttonQuestion.vue", () => {
}, },
], ],
}, },
}), })
); );
// Act // Act
@ -1107,7 +1107,7 @@ describe("buttonQuestion.vue", () => {
}, },
], ],
}, },
}), })
); );
// Act // Act
@ -1127,7 +1127,7 @@ describe("buttonQuestion.vue", () => {
useTextForValue: false, useTextForValue: false,
answers: ["answer 1", "answer 2"], answers: ["answer 1", "answer 2"],
}, },
}), })
); );
// Act // Act
@ -1145,7 +1145,7 @@ describe("buttonQuestion.vue", () => {
function setupMocks(mountOptionsMockData = {}) { function setupMocks(mountOptionsMockData = {}) {
const defaultMountOptions = { route: { query: { fmgPage: "page-name" } } }; const defaultMountOptions = { route: { query: { fmgPage: "page-name" } } };
const baseMountOptions = getMountOptions( const baseMountOptions = getMountOptions(
Object.assign(defaultMountOptions, mountOptionsMockData), Object.assign(defaultMountOptions, mountOptionsMockData)
); );
const allMountOptions = Object.assign(defaultMountOptions, baseMountOptions); const allMountOptions = Object.assign(defaultMountOptions, baseMountOptions);

View file

@ -309,7 +309,7 @@ export default {
this.$route.query[queryStrings.FMG_PAGE], this.$route.query[queryStrings.FMG_PAGE],
this.GaActions.DISPLAYED, this.GaActions.DISPLAYED,
eventLabel, eventLabel,
true, true
); );
} }
}, },

View file

@ -442,7 +442,7 @@ describe("date-picker.vue", () => {
"2023-07-24", "2023-07-24",
"2023-08-19", "2023-08-19",
"Inshop", "Inshop",
"006747", "006747"
); );
// Assert // Assert
@ -903,7 +903,7 @@ describe("date-picker.vue", () => {
// Assert // Assert
expect( expect(
testResult[0].weekStartDate <= todayString && testResult[0].weekStartDate <= todayString &&
todayString <= testResult[0].weekEndDate, todayString <= testResult[0].weekEndDate
).toBe(true); ).toBe(true);
wrapper.unmount(); wrapper.unmount();
@ -938,7 +938,7 @@ describe("date-picker.vue", () => {
const testResult = wrapper.vm.getInitialViewWeeks( const testResult = wrapper.vm.getInitialViewWeeks(
"2023-07-31", "2023-07-31",
5, 5,
mockPreSelectedDate, mockPreSelectedDate
); );
// Assert // Assert
@ -956,7 +956,7 @@ describe("date-picker.vue", () => {
const testResult = wrapper.vm.getInitialViewWeeks( const testResult = wrapper.vm.getInitialViewWeeks(
"2023-07-31", "2023-07-31",
5, 5,
mockPreSelectedDate, mockPreSelectedDate
); );
// Assert // Assert
@ -1028,7 +1028,7 @@ describe("date-picker.vue", () => {
// Assert // Assert
expect(wrapper.vm.updateSelectableDates).toHaveBeenCalledWith( expect(wrapper.vm.updateSelectableDates).toHaveBeenCalledWith(
"2023-12-31", "2023-12-31",
"2023-12-31", "2023-12-31"
); );
expect(wrapper.vm.scrollToElement).toHaveBeenCalledWith("December-2023"); expect(wrapper.vm.scrollToElement).toHaveBeenCalledWith("December-2023");
@ -1054,7 +1054,7 @@ describe("date-picker.vue", () => {
// Assert // Assert
expect(wrapper.vm.updateSelectableDates).toHaveBeenCalledWith( expect(wrapper.vm.updateSelectableDates).toHaveBeenCalledWith(
"2024-01-01", "2024-01-01",
"2024-01-31", "2024-01-31"
); );
expect(wrapper.vm.scrollToElement).toHaveBeenCalledWith("January-2024"); expect(wrapper.vm.scrollToElement).toHaveBeenCalledWith("January-2024");
@ -1083,7 +1083,7 @@ describe("date-picker.vue", () => {
// Assert // Assert
expect(wrapper.vm.updateSelectableDates).toHaveBeenCalledWith( expect(wrapper.vm.updateSelectableDates).toHaveBeenCalledWith(
"2024-01-01", "2024-01-01",
"2024-01-31", "2024-01-31"
); );
expect(wrapper.vm.scrollToElement).toHaveBeenCalledWith("January-2024"); expect(wrapper.vm.scrollToElement).toHaveBeenCalledWith("January-2024");
@ -1339,7 +1339,7 @@ function setupMocks(mountOptionsMockData = {}) {
}, },
}; };
const mountOptions = getMountOptions( const mountOptions = getMountOptions(
Object.assign(initialMountOptionsMockData, mountOptionsMockData), Object.assign(initialMountOptionsMockData, mountOptionsMockData)
); );
const wrapper = shallowMount(datePicker, mountOptions); const wrapper = shallowMount(datePicker, mountOptions);

View file

@ -288,7 +288,7 @@ export default {
for (let j = 0; j < 7; j++) { for (let j = 0; j < 7; j++) {
const newDate = convertDateStringToDate( const newDate = convertDateStringToDate(
weeks[splitWeekIndex].weekStartDate, weeks[splitWeekIndex].weekStartDate
); );
newDate.setDate(newDate.getDate() + j); newDate.setDate(newDate.getDate() + j);
if (newDate.getDate() === 1) switchToWeek2 = true; if (newDate.getDate() === 1) switchToWeek2 = true;
@ -349,7 +349,7 @@ export default {
const initialViewWeeks = this.getInitialViewWeeks( const initialViewWeeks = this.getInitialViewWeeks(
todayDateString, todayDateString,
config.initialViewRowsToShow, config.initialViewRowsToShow,
config.preSelectedDate, config.preSelectedDate
); );
const initialViewStartDate = todayDateString; const initialViewStartDate = todayDateString;
const initialViewEndDate = initialViewWeeks[initialViewWeeks.length - 1].weekEndDate; const initialViewEndDate = initialViewWeeks[initialViewWeeks.length - 1].weekEndDate;
@ -379,7 +379,7 @@ export default {
initialViewStartDate, initialViewStartDate,
initialViewEndDate, initialViewEndDate,
store.getters.order.serviceLocation.appointmentType, store.getters.order.serviceLocation.appointmentType,
store.getters.order.serviceLocation.provider.providerNumber, store.getters.order.serviceLocation.provider.providerNumber
); );
resolve(response); resolve(response);
}); });
@ -442,7 +442,7 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
//Advance to month //Advance to month
const monthToShow = this.months.find((month) => const monthToShow = this.months.find((month) =>
month.monthClass.includes("month-preselected"), month.monthClass.includes("month-preselected")
); );
if ( if (
monthToShow.monthClass.includes("month-preselected") && monthToShow.monthClass.includes("month-preselected") &&
@ -604,7 +604,7 @@ export default {
if (this.hideSomeDaysForInitialView) { if (this.hideSomeDaysForInitialView) {
monthToShow = this.months.find( monthToShow = this.months.find(
({ isMonthThatHidesSomeDaysForInitialView }) => ({ isMonthThatHidesSomeDaysForInitialView }) =>
isMonthThatHidesSomeDaysForInitialView, isMonthThatHidesSomeDaysForInitialView
); );
// find the first day-hidden to become the next api call start date // find the first day-hidden to become the next api call start date
monthStartDateNum = monthStartDateNum =
@ -613,13 +613,13 @@ export default {
} else { } else {
if (this.calendarViewDirection === "future") { if (this.calendarViewDirection === "future") {
monthToShow = this.months.find((month) => monthToShow = this.months.find((month) =>
month.monthClass.includes("month-hidden"), month.monthClass.includes("month-hidden")
); );
} }
if (this.calendarViewDirection === "past") { if (this.calendarViewDirection === "past") {
// TODO: UPDATE THIS WITH CORRECT PAST LOOKING LOGIC // TODO: UPDATE THIS WITH CORRECT PAST LOOKING LOGIC
monthToShow = this.months.find((month) => monthToShow = this.months.find((month) =>
month.monthClass.includes("month-hidden"), month.monthClass.includes("month-hidden")
); );
} }
} }
@ -627,7 +627,7 @@ export default {
// make new API call with this month's start and end dates // make new API call with this month's start and end dates
await this.updateSelectableDates( await this.updateSelectableDates(
monthToShow.dates[monthStartDateNum].inputValue, monthToShow.dates[monthStartDateNum].inputValue,
monthToShow.dates[monthToShow.dates.length - 1].inputValue, monthToShow.dates[monthToShow.dates.length - 1].inputValue
); );
this.isLoading = false; this.isLoading = false;
this.hideSomeDaysForInitialView = false; // if hid days on initial partial view, this will reveal those days this.hideSomeDaysForInitialView = false; // if hid days on initial partial view, this will reveal those days
@ -643,12 +643,12 @@ export default {
monthStart, monthStart,
monthEnd, monthEnd,
this.$store.getters.order.serviceLocation.appointmentType, this.$store.getters.order.serviceLocation.appointmentType,
this.$store.getters.order.serviceLocation.provider.providerNumber, this.$store.getters.order.serviceLocation.provider.providerNumber
); );
moreSelectableDates.days.forEach((selectableDate) => { moreSelectableDates.days.forEach((selectableDate) => {
const index = this.selectableDatesData.findIndex( const index = this.selectableDatesData.findIndex(
(dateObj) => dateObj.date === selectableDate.date, (dateObj) => dateObj.date === selectableDate.date
); );
if (index === -1) this.selectableDatesData.push(selectableDate); if (index === -1) this.selectableDatesData.push(selectableDate);
this.months.forEach((month) => { this.months.forEach((month) => {

View file

@ -88,7 +88,7 @@ export default {
const { errorMessage, handleBlur, handleChange, meta, errors } = useField( const { errorMessage, handleBlur, handleChange, meta, errors } = useField(
dropdownId, dropdownId,
props.validationRules, props.validationRules,
fieldOptions, fieldOptions
); );
return { return {

View file

@ -12,7 +12,7 @@ describe("modal-button-main.vue", () => {
propsData: { propsData: {
isPrimary: true, isPrimary: true,
}, },
}), })
); );
const button = wrapper.find("button"); const button = wrapper.find("button");
@ -28,7 +28,7 @@ describe("modal-button-main.vue", () => {
propsData: { propsData: {
isDisabled: true, isDisabled: true,
}, },
}), })
); );
const button = wrapper.find("button"); const button = wrapper.find("button");
@ -45,7 +45,7 @@ describe("modal-button-main.vue", () => {
loaderColor: "blue", loaderColor: "blue",
loaderEnabled: true, loaderEnabled: true,
}, },
}), })
); );
// Act // Act
@ -66,7 +66,7 @@ describe("modal-button-main.vue", () => {
loaderPosition: "right", loaderPosition: "right",
loaderEnabled: true, loaderEnabled: true,
}, },
}), })
); );
// Act // Act
@ -87,7 +87,7 @@ describe("modal-button-main.vue", () => {
loaderPosition: "right", loaderPosition: "right",
loaderEnabled: true, loaderEnabled: true,
}, },
}), })
); );
wrapper.setData({ wrapper.setData({
@ -112,7 +112,7 @@ describe("modal-button-main.vue", () => {
loaderPosition: "right", loaderPosition: "right",
loaderEnabled: true, loaderEnabled: true,
}, },
}), })
); );
wrapper.setData({ wrapper.setData({
@ -137,7 +137,7 @@ describe("modal-button-main.vue", () => {
loaderEnabled: true, loaderEnabled: true,
isDisabled: false, isDisabled: false,
}, },
}), })
); );
const buttonElement = wrapper.find("button"); const buttonElement = wrapper.find("button");
@ -161,7 +161,7 @@ describe("modal-button-main.vue", () => {
loaderEnabled: true, loaderEnabled: true,
isDisabled: true, isDisabled: true,
}, },
}), })
); );
const buttonElement = wrapper.find("button"); const buttonElement = wrapper.find("button");
@ -179,7 +179,7 @@ describe("modal-button-main.vue", () => {
function setupMocks(mountOptionsMockData = {}) { function setupMocks(mountOptionsMockData = {}) {
const defaultMountOptions = { route: { query: { fmgPage: "page-name" } } }; const defaultMountOptions = { route: { query: { fmgPage: "page-name" } } };
const baseMountOptions = getMountOptions( const baseMountOptions = getMountOptions(
Object.assign(defaultMountOptions, mountOptionsMockData), Object.assign(defaultMountOptions, mountOptionsMockData)
); );
const allMountOptions = Object.assign(defaultMountOptions, baseMountOptions); const allMountOptions = Object.assign(defaultMountOptions, baseMountOptions);

View file

@ -45,7 +45,7 @@ export default {
this.$route.query[this.queryStrings.FMG_PAGE], this.$route.query[this.queryStrings.FMG_PAGE],
this.GaActions.CLICKED, this.GaActions.CLICKED,
this.buttonText, this.buttonText,
true, true
); );
if (!this.isDisabled) { if (!this.isDisabled) {
this.isLoaderDisplayed = true; this.isLoaderDisplayed = true;

View file

@ -58,7 +58,7 @@ describe("phone-number-question.vue", () => {
// Assert // Assert
expect(wrapper.vm.validationRulesForTextBoxQuestion).toEqual( expect(wrapper.vm.validationRulesForTextBoxQuestion).toEqual(
"outsideValidation|phone-number-format", "outsideValidation|phone-number-format"
); );
}); });
}); });

View file

@ -23,7 +23,7 @@ import { defineRule } from "vee-validate";
// Validation // Validation
defineRule( defineRule(
"phone-number-format", "phone-number-format",
regex(/^(?=(?:.*\d){10})(?=(?:.*-){2})[\d-]{12}$/, errorMessages.PHONE_FORMAT), regex(/^(?=(?:.*\d){10})(?=(?:.*-){2})[\d-]{12}$/, errorMessages.PHONE_FORMAT)
); );
export default { export default {

View file

@ -8,7 +8,7 @@ jest.mock(
() => { () => {
return {}; return {};
}, },
{ virtual: true }, { virtual: true }
); );
describe("Question Chain component", () => { describe("Question Chain component", () => {

View file

@ -200,7 +200,7 @@ describe("textboxQuestion.vue", () => {
resolve({ resolve({
data: [responseValue], data: [responseValue],
}); });
}), })
); );
const wrapper = shallowMount(textboxQuestion, { const wrapper = shallowMount(textboxQuestion, {
@ -248,7 +248,7 @@ describe("textboxQuestion.vue", () => {
resolve({ resolve({
data: [responseValue], data: [responseValue],
}); });
}), })
); );
const wrapper = shallowMount(textboxQuestion, { const wrapper = shallowMount(textboxQuestion, {
@ -292,7 +292,7 @@ describe("textboxQuestion.vue", () => {
() => () =>
new Promise((resolve, reject) => { new Promise((resolve, reject) => {
reject({}); reject({});
}), })
); );
const wrapper = shallowMount(textboxQuestion, { const wrapper = shallowMount(textboxQuestion, {

View file

@ -160,7 +160,7 @@ export default {
const { errorMessage, handleBlur, handleChange, meta, validate, errors } = useField( const { errorMessage, handleBlur, handleChange, meta, validate, errors } = useField(
inputId, inputId,
props.validationRules, props.validationRules,
fieldOptions, fieldOptions
); );
return { return {

View file

@ -283,7 +283,7 @@ describe("address-questions.vue", () => {
// Act // Act
autocompleteElement.dispatchEvent( autocompleteElement.dispatchEvent(
new CustomEvent("place_changed", { detail: selectedPlace }), new CustomEvent("place_changed", { detail: selectedPlace })
); );
// Assert // Assert

View file

@ -221,7 +221,7 @@ export default {
// Load the Google Places Autocomplete script // Load the Google Places Autocomplete script
const apiKey = applicationConfig.GOOGLE_PLACES_API_KEY; const apiKey = applicationConfig.GOOGLE_PLACES_API_KEY;
this.$loadScript( this.$loadScript(
`https://maps.googleapis.com/maps/api/js?key=${apiKey}&libraries=places&callback=Function.prototype`, `https://maps.googleapis.com/maps/api/js?key=${apiKey}&libraries=places&callback=Function.prototype`
).then(() => { ).then(() => {
// When loaded, trigger the setup // When loaded, trigger the setup
this.initializeAutocomplete(); this.initializeAutocomplete();
@ -240,7 +240,7 @@ export default {
this.autocompleteListener = window.google.maps.event.addListener( this.autocompleteListener = window.google.maps.event.addListener(
this.autocomplete, this.autocomplete,
"place_changed", "place_changed",
this.fillInAddress, this.fillInAddress
); );
// When the Street Address textbox receives input for the first time, // When the Street Address textbox receives input for the first time,
@ -258,7 +258,7 @@ export default {
streetAddressField.appendChild(autocompleteResultsContainer); streetAddressField.appendChild(autocompleteResultsContainer);
} }
}, },
{ once: true }, { once: true }
); );
this.addressField1.addEventListener("keydown", (e) => { this.addressField1.addEventListener("keydown", (e) => {
@ -274,7 +274,7 @@ export default {
}); });
const addressFields = document.querySelectorAll( const addressFields = document.querySelectorAll(
".address-questions input, .address-questions select", ".address-questions input, .address-questions select"
); );
for (let addressField of addressFields) { for (let addressField of addressFields) {
@ -303,7 +303,7 @@ export default {
}, },
findAddressComponentByType(place, componentName, componentLength) { findAddressComponentByType(place, componentName, componentLength) {
const component = place.address_components.find((component) => const component = place.address_components.find((component) =>
component.types.find((type) => type == componentName), component.types.find((type) => type == componentName)
); );
if (component) { if (component) {
return component[componentLength] ?? ""; return component[componentLength] ?? "";
@ -332,7 +332,7 @@ export default {
const streetNumber = this.findAddressComponentByType( const streetNumber = this.findAddressComponentByType(
place, place,
"street_number", "street_number",
"long_name", "long_name"
); );
const route = this.findAddressComponentByType(place, "route", "short_name"); const route = this.findAddressComponentByType(place, "route", "short_name");
const city = this.findAddressComponentByType(place, "locality", "long_name"); const city = this.findAddressComponentByType(place, "locality", "long_name");
@ -345,7 +345,7 @@ export default {
state = this.findAddressComponentByType( state = this.findAddressComponentByType(
place, place,
"administrative_area_level_1", "administrative_area_level_1",
"short_name", "short_name"
); );
} }
@ -354,7 +354,7 @@ export default {
zipCode = this.findAddressComponentByType( zipCode = this.findAddressComponentByType(
place, place,
"postal_code", "postal_code",
"long_name", "long_name"
); );
} }
@ -399,7 +399,7 @@ export default {
self.displayVerificationWarning = true; self.displayVerificationWarning = true;
self.fillInAddress(results[0]); self.fillInAddress(results[0]);
} }
}, }
); );
} else { } else {
this.matchFound = false; this.matchFound = false;
@ -475,7 +475,7 @@ export default {
this.matchFound = null; this.matchFound = null;
this.$nextTick(); this.$nextTick();
}, },
{ deep: true, flush: "post" }, { deep: true, flush: "post" }
); );
} }
}, },

View file

@ -61,7 +61,7 @@ describe("cart.vue", () => {
const found = const found =
wrapper.vm.cartItems.findIndex( wrapper.vm.cartItems.findIndex(
(cartItem) => cartItem == wrapper.vm.frontWipersCartItem, (cartItem) => cartItem == wrapper.vm.frontWipersCartItem
) >= 0; ) >= 0;
expect(found).toBe(true); expect(found).toBe(true);
}); });
@ -113,7 +113,7 @@ describe("cart.vue", () => {
const found = const found =
wrapper.vm.cartItems.findIndex( wrapper.vm.cartItems.findIndex(
(cartItem) => cartItem == wrapper.vm.rearWipersCartItem, (cartItem) => cartItem == wrapper.vm.rearWipersCartItem
) >= 0; ) >= 0;
expect(found).toBe(true); expect(found).toBe(true);
}); });
@ -156,7 +156,7 @@ describe("cart.vue", () => {
const found = const found =
wrapper.vm.cartItems.findIndex( wrapper.vm.cartItems.findIndex(
(cartItem) => cartItem == wrapper.vm.rainDefenseCartItem, (cartItem) => cartItem == wrapper.vm.rainDefenseCartItem
) >= 0; ) >= 0;
expect(found).toBe(true); expect(found).toBe(true);
}); });
@ -258,7 +258,7 @@ describe("cart.vue", () => {
const found = const found =
wrapper.vm.cartItems.findIndex( wrapper.vm.cartItems.findIndex(
(cartItem) => cartItem == wrapper.vm.recycleFeeCartItem, (cartItem) => cartItem == wrapper.vm.recycleFeeCartItem
) >= 0; ) >= 0;
expect(found).toBe(true); expect(found).toBe(true);
}); });
@ -301,7 +301,7 @@ describe("cart.vue", () => {
const found = const found =
wrapper.vm.cartItems.findIndex( wrapper.vm.cartItems.findIndex(
(cartItem) => cartItem == wrapper.vm.mobileFeeCartItem, (cartItem) => cartItem == wrapper.vm.mobileFeeCartItem
) >= 0; ) >= 0;
expect(found).toBe(true); expect(found).toBe(true);
}); });
@ -344,7 +344,7 @@ describe("cart.vue", () => {
const found = const found =
wrapper.vm.cartItems.findIndex( wrapper.vm.cartItems.findIndex(
(cartItem) => cartItem == wrapper.vm.servicePackageDiscountCartItem, (cartItem) => cartItem == wrapper.vm.servicePackageDiscountCartItem
) >= 0; ) >= 0;
expect(found).toBe(true); expect(found).toBe(true);
}); });
@ -389,7 +389,7 @@ describe("cart.vue", () => {
const found = const found =
wrapper.vm.cartItems.findIndex( wrapper.vm.cartItems.findIndex(
(cartItem) => cartItem == wrapper.vm.otherSupportingItemsCartItem, (cartItem) => cartItem == wrapper.vm.otherSupportingItemsCartItem
) >= 0; ) >= 0;
expect(found).toBe(true); expect(found).toBe(true);
}); });

View file

@ -25,7 +25,7 @@
{{ {{
getLineItemAmount( getLineItemAmount(
deductibleLineItem.subTotal, deductibleLineItem.subTotal,
showCoverageAsPending, showCoverageAsPending
) )
}} }}
</span> </span>
@ -238,7 +238,7 @@ export default {
this.glassToReplace, this.glassToReplace,
this.availableLineItems, this.availableLineItems,
this.isRepair, this.isRepair,
packageName, packageName
); );
let vapsCartItemsForSelectedPackage = []; let vapsCartItemsForSelectedPackage = [];
@ -280,7 +280,7 @@ export default {
removeItem(cartItemType, category) { removeItem(cartItemType, category) {
this.lineItems[category] = this.lineItems[category].filter( this.lineItems[category] = this.lineItems[category].filter(
(lineItemsToKeep) => lineItemsToKeep.cartItemType != cartItemType, (lineItemsToKeep) => lineItemsToKeep.cartItemType != cartItemType
); );
}, },
getPromoCodeList() { getPromoCodeList() {
@ -401,7 +401,7 @@ export default {
servicePackageTitleWidget() { servicePackageTitleWidget() {
const servicePackageNames = this.getCmsContent( const servicePackageNames = this.getCmsContent(
this.servicePackageOptionsCmsName, this.servicePackageOptionsCmsName,
"Answers", "Answers"
); );
if (!servicePackageNames) { if (!servicePackageNames) {
@ -409,7 +409,7 @@ export default {
} }
const currentPackage = servicePackageNames.find( const currentPackage = servicePackageNames.find(
(entry) => entry.Name === this.packageLevel, (entry) => entry.Name === this.packageLevel
); );
return currentPackage.SubWidgetName; return currentPackage.SubWidgetName;
@ -419,7 +419,7 @@ export default {
this.glassToReplace, this.glassToReplace,
this.availableLineItems, this.availableLineItems,
this.isRepair, this.isRepair,
this.vaps, this.vaps
); );
return tier; return tier;
@ -429,7 +429,7 @@ export default {
if (!this.showCoverageAsVerified && !this.showCoverageAsPending) { if (!this.showCoverageAsVerified && !this.showCoverageAsPending) {
packagePrice = baseMixin.methods.getTierOnePackagePrice( packagePrice = baseMixin.methods.getTierOnePackagePrice(
baseMixin.methods.filterOutFees(this.availableLineItems), baseMixin.methods.filterOutFees(this.availableLineItems)
); );
} }
@ -518,7 +518,7 @@ export default {
let cartItem = null; let cartItem = null;
const frontWiperLineItems = this.vaps.filter( const frontWiperLineItems = this.vaps.filter(
(vapsLineItem) => vapsLineItem.partType == partTypeStrings.FRONT_WIPER, (vapsLineItem) => vapsLineItem.partType == partTypeStrings.FRONT_WIPER
); );
if (frontWiperLineItems.length > 0) { if (frontWiperLineItems.length > 0) {
@ -532,7 +532,7 @@ export default {
salesTax: 0, salesTax: 0,
lineItems: [], lineItems: [],
isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes( isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes(
cartItemTypes.FRONT_WIPERS, cartItemTypes.FRONT_WIPERS
), ),
}; };
@ -558,7 +558,7 @@ export default {
let cartItem = null; let cartItem = null;
const rearWiperLineItems = this.vaps.filter( const rearWiperLineItems = this.vaps.filter(
(vapsLineItem) => vapsLineItem.partType == partTypeStrings.REAR_WIPER, (vapsLineItem) => vapsLineItem.partType == partTypeStrings.REAR_WIPER
); );
if (rearWiperLineItems.length > 0) { if (rearWiperLineItems.length > 0) {
@ -572,7 +572,7 @@ export default {
salesTax: 0, salesTax: 0,
lineItems: [], lineItems: [],
isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes( isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes(
cartItemTypes.REAR_WIPERS, cartItemTypes.REAR_WIPERS
), ),
}; };
@ -598,7 +598,7 @@ export default {
let cartItem = null; let cartItem = null;
const rainDefenseLineItem = this.vaps.find( const rainDefenseLineItem = this.vaps.find(
(vapsLineItem) => vapsLineItem.partType == partTypeStrings.RAIN_DEFENSE, (vapsLineItem) => vapsLineItem.partType == partTypeStrings.RAIN_DEFENSE
); );
if (rainDefenseLineItem) { if (rainDefenseLineItem) {
@ -612,7 +612,7 @@ export default {
salesTax: 0, salesTax: 0,
lineItems: [], lineItems: [],
isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes( isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes(
cartItemTypes.RAIN_DEFENSE, cartItemTypes.RAIN_DEFENSE
), ),
}; };
@ -647,7 +647,7 @@ export default {
salesTax: lineItem.salesTax ?? 0, salesTax: lineItem.salesTax ?? 0,
lineItems: [], lineItems: [],
isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes( isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes(
cartItemTypes.GLASS_PARTS, cartItemTypes.GLASS_PARTS
), ),
}; };
@ -678,7 +678,7 @@ export default {
let cartItem = null; let cartItem = null;
let recycleFeeLineItem = this.supportingItems.find( let recycleFeeLineItem = this.supportingItems.find(
(supportingItem) => supportingItem.partType == partTypeStrings.REPLACE_FEE, (supportingItem) => supportingItem.partType == partTypeStrings.REPLACE_FEE
); );
if (!recycleFeeLineItem && this.requiresRecycleFeeCartItem) { if (!recycleFeeLineItem && this.requiresRecycleFeeCartItem) {
@ -703,7 +703,7 @@ export default {
salesTax: 0, salesTax: 0,
lineItems: [], lineItems: [],
isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes( isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes(
cartItemTypes.REPLACE_FEE, cartItemTypes.REPLACE_FEE
), ),
}; };
@ -729,7 +729,7 @@ export default {
const suppliesRepairLineItem = this.supportingItems.find( const suppliesRepairLineItem = this.supportingItems.find(
(supportingItem) => (supportingItem) =>
supportingItem.partType == partTypeStrings.REPAIR_FEE && supportingItem.partType == partTypeStrings.REPAIR_FEE &&
supportingItem.partNumber != "WSREPAIR", supportingItem.partNumber != "WSREPAIR"
); );
if (suppliesRepairLineItem) { if (suppliesRepairLineItem) {
@ -743,7 +743,7 @@ export default {
salesTax: 0, salesTax: 0,
lineItems: [], lineItems: [],
isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes( isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes(
cartItemTypes.SUPPLIES_REPAIR, cartItemTypes.SUPPLIES_REPAIR
), ),
}; };
@ -766,7 +766,7 @@ export default {
mobileFeeCartItem() { mobileFeeCartItem() {
let cartItem = null; let cartItem = null;
const mobileFeeLineItem = this.supportingItems.find( const mobileFeeLineItem = this.supportingItems.find(
(lineItem) => lineItem.partType == partTypeStrings.MOBILE_FEE, (lineItem) => lineItem.partType == partTypeStrings.MOBILE_FEE
); );
if (mobileFeeLineItem) { if (mobileFeeLineItem) {
@ -780,7 +780,7 @@ export default {
salesTax: 0, salesTax: 0,
lineItems: [], lineItems: [],
isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes( isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes(
cartItemTypes.MOBILE_FEE, cartItemTypes.MOBILE_FEE
), ),
}; };
mobileFeeLineItem.cartItemType = cartItem.cartItemType; mobileFeeLineItem.cartItemType = cartItem.cartItemType;
@ -800,7 +800,7 @@ export default {
let cartItem = null; let cartItem = null;
const servicePackageDiscountLineItem = this.supportingItems.find( const servicePackageDiscountLineItem = this.supportingItems.find(
(lineItem) => lineItem.partType == partTypeStrings.SERVICE_PACKAGE_DISCOUNT, (lineItem) => lineItem.partType == partTypeStrings.SERVICE_PACKAGE_DISCOUNT
); );
if (servicePackageDiscountLineItem) { if (servicePackageDiscountLineItem) {
@ -808,7 +808,7 @@ export default {
name: name:
this.servicePackageDiscountCartItemName + this.servicePackageDiscountCartItemName +
Math.abs( Math.abs(
baseMixin.methods.getTotalLineItemPrice(servicePackageDiscountLineItem), baseMixin.methods.getTotalLineItemPrice(servicePackageDiscountLineItem)
), ),
category: cartItemCategories.SERVICE_PACKAGE_DISCOUNT, category: cartItemCategories.SERVICE_PACKAGE_DISCOUNT,
cartItemType: cartItemTypes.SERVICE_PACKAGE_DISCOUNT, cartItemType: cartItemTypes.SERVICE_PACKAGE_DISCOUNT,
@ -854,7 +854,7 @@ export default {
salesTax: 0, salesTax: 0,
lineItems: [], lineItems: [],
isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes( isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes(
cartItemTypes.SUPPORTING_ITEMS, cartItemTypes.SUPPORTING_ITEMS
), ),
}; };
@ -880,7 +880,7 @@ export default {
let cartItem = null; let cartItem = null;
const premiumAppointmentDiscountLineItem = this.supportingItems.find( const premiumAppointmentDiscountLineItem = this.supportingItems.find(
(lineItem) => lineItem.partType == partTypeStrings.EARLY_BIRD, (lineItem) => lineItem.partType == partTypeStrings.EARLY_BIRD
); );
if (premiumAppointmentDiscountLineItem) { if (premiumAppointmentDiscountLineItem) {
@ -894,7 +894,7 @@ export default {
salesTax: 0, salesTax: 0,
lineItems: [], lineItems: [],
isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes( isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes(
cartItemTypes.EARLY_BIRD, cartItemTypes.EARLY_BIRD
), ),
}; };
@ -919,16 +919,14 @@ export default {
// get unique promo codes // get unique promo codes
const uniquePromoCodes = [ const uniquePromoCodes = [
...new Set( ...new Set(
this.promos.map((promo) => this.promos.map((promo) => getPromoCodeWithoutBundleIdentifier(promo.promoCode))
getPromoCodeWithoutBundleIdentifier(promo.promoCode),
),
), ),
]; ];
uniquePromoCodes.forEach((promoCode) => { uniquePromoCodes.forEach((promoCode) => {
// get the codes with the prefix from the promo array // get the codes with the prefix from the promo array
const promoLineItems = this.promos.filter( const promoLineItems = this.promos.filter(
(promo) => getPromoCodeWithoutBundleIdentifier(promo.promoCode) == promoCode, (promo) => getPromoCodeWithoutBundleIdentifier(promo.promoCode) == promoCode
); );
// Create a cart item for each promo // Create a cart item for each promo

View file

@ -65,7 +65,7 @@ export default {
// Check if alert event is on the bus // Check if alert event is on the bus
const alertEvent = eventBus.readAndPopEventFromBus( const alertEvent = eventBus.readAndPopEventFromBus(
globalEvents.Categories.GLOBAL_ALERT, globalEvents.Categories.GLOBAL_ALERT,
globalEvents.SubCategories.PAGE_NOT_FOUND, globalEvents.SubCategories.PAGE_NOT_FOUND
); );
// If alert event is on the bus, then display the alert // If alert event is on the bus, then display the alert
if (alertEvent !== undefined) { if (alertEvent !== undefined) {
@ -76,7 +76,7 @@ export default {
//Uknown alerts most likely were added by a failed api call in global-methods //Uknown alerts most likely were added by a failed api call in global-methods
const unknownAlertEvent = eventBus.readAndPopEventFromBus( const unknownAlertEvent = eventBus.readAndPopEventFromBus(
globalEvents.Categories.GLOBAL_ALERT, globalEvents.Categories.GLOBAL_ALERT,
globalEvents.SubCategories.UNKNOWN_ERROR, globalEvents.SubCategories.UNKNOWN_ERROR
); );
if (unknownAlertEvent !== undefined) { if (unknownAlertEvent !== undefined) {

View file

@ -8,7 +8,7 @@ jest.mock(
() => { () => {
return {}; return {};
}, },
{ virtual: true }, { virtual: true }
); );
jest.mock("@/assets/img/loader.gif", () => "loader.gif"); jest.mock("@/assets/img/loader.gif", () => "loader.gif");

View file

@ -17,7 +17,7 @@ jest.mock("@/mixins/base-mixin", () => ({
dispatchStoreActionWithLogging: jest.fn( dispatchStoreActionWithLogging: jest.fn(
(action, { promoCode, addableVaps }, pageNameToLog, someBool) => { (action, { promoCode, addableVaps }, pageNameToLog, someBool) => {
return mockReturnsForStoreActions[action]; return mockReturnsForStoreActions[action];
}, }
), ),
}, },
})); }));
@ -171,7 +171,7 @@ describe("promo-modal-question.vue", () => {
addableVaps, addableVaps,
}, },
pageNameToLog, pageNameToLog,
false, false
); );
// Assert // Assert
@ -221,7 +221,7 @@ describe("promo-modal-question.vue", () => {
"payment-method", "payment-method",
false, false
); );
// Assert // Assert
@ -284,7 +284,7 @@ describe("promo-modal-question.vue", () => {
cartItemCategories.PROMOS cartItemCategories.PROMOS
].filter( ].filter(
(lineItemsToKeep) => (lineItemsToKeep) =>
getPromoCodeWithoutBundleIdentifier(lineItemsToKeep.promoCode) != promo, getPromoCodeWithoutBundleIdentifier(lineItemsToKeep.promoCode) != promo
)); ));
//Assert //Assert

View file

@ -156,7 +156,7 @@ export default {
}, },
getPromoCodeList() { getPromoCodeList() {
const promosToDisplay = getPromoCodesFromPromoObjectsWithoutDuplicates( const promosToDisplay = getPromoCodesFromPromoObjectsWithoutDuplicates(
this.lineItems.promos, this.lineItems.promos
); );
return promosToDisplay; return promosToDisplay;
}, },
@ -198,7 +198,7 @@ export default {
lineItems, lineItems,
addableVaps, addableVaps,
useDefaultCashParentAccount, useDefaultCashParentAccount,
pageNameToLog = null, pageNameToLog = null
) { ) {
const pageName = pageNameToLog ?? this.$options?.name; const pageName = pageNameToLog ?? this.$options?.name;
const promoValidationResponse = await baseMixin.methods.dispatchStoreActionWithLogging( const promoValidationResponse = await baseMixin.methods.dispatchStoreActionWithLogging(
@ -210,7 +210,7 @@ export default {
useDefaultCashParentAccount: useDefaultCashParentAccount, useDefaultCashParentAccount: useDefaultCashParentAccount,
}, },
pageName, pageName,
false, false
); );
return { return {
@ -225,7 +225,7 @@ export default {
cartItemCategories.PROMOS cartItemCategories.PROMOS
].filter( ].filter(
(lineItemsToKeep) => (lineItemsToKeep) =>
getPromoCodeWithoutBundleIdentifier(lineItemsToKeep.promoCode) != promo, getPromoCodeWithoutBundleIdentifier(lineItemsToKeep.promoCode) != promo
); );
}, },
getErrorMessage(error, additionalInfo) { getErrorMessage(error, additionalInfo) {
@ -240,27 +240,27 @@ export default {
(match, group) => (match, group) =>
group === "NEW" group === "NEW"
? this.promoCode.toUpperCase() ? this.promoCode.toUpperCase()
: this.getConflictingPromoCode(additionalInfo), : this.getConflictingPromoCode(additionalInfo)
)), )),
(this.displayStackingPromoAlert = true)); (this.displayStackingPromoAlert = true));
case promoErrorCodes.INVALID_PROMO_ON_ORDER: case promoErrorCodes.INVALID_PROMO_ON_ORDER:
if (additionalInfo.some((x) => x.toUpperCase() === "APPOINTMENT_TYPE")) { if (additionalInfo.some((x) => x.toUpperCase() === "APPOINTMENT_TYPE")) {
this.errorMessage = this.InShopPromoText?.replaceAll( this.errorMessage = this.InShopPromoText?.replaceAll(
"{custom:INSHOPPROMOCODE}", "{custom:INSHOPPROMOCODE}",
this.promoCode.toUpperCase(), this.promoCode.toUpperCase()
); );
return (this.displayInShopPromoAlert = true); return (this.displayInShopPromoAlert = true);
} else { } else {
this.errorMessage = this.PromoText?.replaceAll( this.errorMessage = this.PromoText?.replaceAll(
"{custom:PROMOCODE}", "{custom:PROMOCODE}",
this.promoCode.toUpperCase(), this.promoCode.toUpperCase()
); );
return (this.displayInvalidPromoAlert = true); return (this.displayInvalidPromoAlert = true);
} }
default: default:
this.errorMessage = this.PromoText?.replaceAll( this.errorMessage = this.PromoText?.replaceAll(
"{custom:PROMOCODE}", "{custom:PROMOCODE}",
this.promoCode.toUpperCase(), this.promoCode.toUpperCase()
); );
return (this.displayInvalidPromoAlert = true); return (this.displayInvalidPromoAlert = true);
} }
@ -274,7 +274,7 @@ export default {
this.lineItems, this.lineItems,
this.addableVaps, this.addableVaps,
this.useDefaultCashParentAccount, this.useDefaultCashParentAccount,
this.pageName, this.pageName
); );
if (promoCodeData.isValid) { if (promoCodeData.isValid) {
if (this.taxPromos) { if (this.taxPromos) {
@ -297,24 +297,24 @@ export default {
pricedLineItems: pricedLineItemsToTax, pricedLineItems: pricedLineItemsToTax,
}, },
"payment-method", "payment-method",
false, false
); );
// Match all line items to the line items as they are in the store // Match all line items to the line items as they are in the store
// and rebuild the original structure. // and rebuild the original structure.
this.lineItems = mapTaxedLineItemsToStoreFormat( this.lineItems = mapTaxedLineItemsToStoreFormat(
taxedLineItems, taxedLineItems,
this.lineItems, this.lineItems
); );
const taxedVaps = mapTaxedLineItemsToStoreFormat( const taxedVaps = mapTaxedLineItemsToStoreFormat(
taxedLineItems, taxedLineItems,
this.addableVaps, this.addableVaps
); );
const getVaps = getVapsThatNeedToBeAddedToSatisfyPromos( const getVaps = getVapsThatNeedToBeAddedToSatisfyPromos(
promoCodeData.promoCode, promoCodeData.promoCode,
taxedVaps, taxedVaps,
this.lineItems, this.lineItems
); );
this.lineItems.vaps?.push(...getVaps); this.lineItems.vaps?.push(...getVaps);

View file

@ -9,7 +9,7 @@ jest.mock(
() => { () => {
return {}; return {};
}, },
{ virtual: true }, { virtual: true }
); );
describe("vehicleBanner", () => { describe("vehicleBanner", () => {
@ -84,7 +84,7 @@ describe("vehicleBanner", () => {
expect(store.getters.vehicle.category).toEqual(category); expect(store.getters.vehicle.category).toEqual(category);
expect(wrapper.find("img").attributes("class")).toContain("vehicle-image"); expect(wrapper.find("img").attributes("class")).toContain("vehicle-image");
wrapper.unmount(); wrapper.unmount();
}, }
); );
}); });

View file

@ -43,7 +43,7 @@ axios.interceptors.response.use(
} }
return Promise.reject(rejectionError); return Promise.reject(rejectionError);
}, }
); );
export default { export default {
@ -82,7 +82,7 @@ export default {
GaCategories.API_RESPONSE, GaCategories.API_RESPONSE,
`${pageNameToLog}_${endpointWithoutParams}`, `${pageNameToLog}_${endpointWithoutParams}`,
`${GaLabels.SUCCESS}${additionalEventData}`, `${GaLabels.SUCCESS}${additionalEventData}`,
true, true
); );
} }
@ -94,7 +94,7 @@ export default {
GaCategories.API_RESPONSE, GaCategories.API_RESPONSE,
GaActions.RESULT, GaActions.RESULT,
`${GaLabels.ERROR}_${endpoint}`, `${GaLabels.ERROR}_${endpoint}`,
true, true
); );
} }
@ -106,12 +106,12 @@ export default {
// when a service doesn't return an object // when a service doesn't return an object
global.$logger.logError( global.$logger.logError(
`${method}: ${endpoint}: ${error.message}`, `${method}: ${endpoint}: ${error.message}`,
error.response, error.response
); );
} }
return reject(error.response); return reject(error.response);
}, }
); );
}); });
}, },
@ -138,7 +138,7 @@ export default {
}, },
(error) => { (error) => {
return reject(error.response); return reject(error.response);
}, }
); );
}); });
}, },

View file

@ -47,7 +47,7 @@ export function getCalendarFile(calFile) {
'<P DIR=LTR><SPAN LANG="en-us">' + '<P DIR=LTR><SPAN LANG="en-us">' +
"</SPAN>" + "</SPAN>" +
ToCalendarFileString(calFile.Body) + ToCalendarFileString(calFile.Body) +
"</BODY></HTML>", "</BODY></HTML>"
); );
} else { } else {
calEvent.push("DESCRIPTION:" + ToCalendarFileString(calFile.Body)); calEvent.push("DESCRIPTION:" + ToCalendarFileString(calFile.Body));

View file

@ -33,7 +33,7 @@ test("download function", () => {
expect(mockElement.setAttribute).toHaveBeenCalledTimes(2); expect(mockElement.setAttribute).toHaveBeenCalledTimes(2);
expect(mockElement.setAttribute).toHaveBeenCalledWith( expect(mockElement.setAttribute).toHaveBeenCalledWith(
"href", "href",
"data:text/plain;charset=utf-8," + encodeURIComponent("Hello world"), "data:text/plain;charset=utf-8," + encodeURIComponent("Hello world")
); );
expect(mockElement.setAttribute).toHaveBeenCalledWith("download", "test.txt"); expect(mockElement.setAttribute).toHaveBeenCalledWith("download", "test.txt");
expect(mockElement.style.display).toBe("none"); expect(mockElement.style.display).toBe("none");

View file

@ -83,7 +83,7 @@ function processWidgetItemForReplacement(widgetModel, key) {
widgetModel[key] = processIfStatements( widgetModel[key] = processIfStatements(
widgetModel[key], widgetModel[key],
dynamicStrings.GLOBAL_STATE, dynamicStrings.GLOBAL_STATE,
getStoreValueFromString, getStoreValueFromString
); );
if (widgetModel[key].includes(dynamicStrings.GLOBAL_STATE)) { if (widgetModel[key].includes(dynamicStrings.GLOBAL_STATE)) {
widgetModel[key] = mapStringToState(widgetModel[key]); widgetModel[key] = mapStringToState(widgetModel[key]);
@ -129,7 +129,7 @@ function getStoreValueFromString(str) {
*/ */
export function processIfStatements(str, ifConditionKeyword, replacePlaceholderCallback) { export function processIfStatements(str, ifConditionKeyword, replacePlaceholderCallback) {
const containsRelevantIfStatement = new RegExp("{if:" + ifConditionKeyword + ":.+?}", "g").test( const containsRelevantIfStatement = new RegExp("{if:" + ifConditionKeyword + ":.+?}", "g").test(
str, str
); );
if (!containsRelevantIfStatement) { if (!containsRelevantIfStatement) {
return str; return str;
@ -138,17 +138,17 @@ export function processIfStatements(str, ifConditionKeyword, replacePlaceholderC
const ifStatementRegexMatches = [...str.matchAll(ifStatementRegexExpression)]; const ifStatementRegexMatches = [...str.matchAll(ifStatementRegexExpression)];
const completeIfStatementArray = getAndFlagFirstNonNestedIfStatementWithKeyword( const completeIfStatementArray = getAndFlagFirstNonNestedIfStatementWithKeyword(
ifStatementRegexMatches, ifStatementRegexMatches,
ifConditionKeyword, ifConditionKeyword
); );
executeIfStatementAndSetProcessedStrings( executeIfStatementAndSetProcessedStrings(
completeIfStatementArray, completeIfStatementArray,
replacePlaceholderCallback, replacePlaceholderCallback
); );
const reconstructedPostProcessedString = joinProcessedRegexArray(ifStatementRegexMatches); const reconstructedPostProcessedString = joinProcessedRegexArray(ifStatementRegexMatches);
return processIfStatements( return processIfStatements(
reconstructedPostProcessedString, reconstructedPostProcessedString,
ifConditionKeyword, ifConditionKeyword,
replacePlaceholderCallback, replacePlaceholderCallback
); );
} }
} }
@ -275,7 +275,7 @@ function getIfStatementRegexExpression() {
matchElseOperator + matchElseOperator +
"|" + "|" +
matchEndOperator, matchEndOperator,
"g", "g"
); );
} }

View file

@ -49,7 +49,7 @@ export function getIsWindshieldOnly() {
export function includesWindshieldReplacement() { export function includesWindshieldReplacement() {
const windshieldMatches = const windshieldMatches =
store.getters.order.damage.glassToReplace?.filter( store.getters.order.damage.glassToReplace?.filter(
(glassToReplace) => glassToReplace.glassLocation === glassLocations.WINDSHIELD, (glassToReplace) => glassToReplace.glassLocation === glassLocations.WINDSHIELD
) ?? []; ) ?? [];
return windshieldMatches.length > 0; return windshieldMatches.length > 0;
} }
@ -58,7 +58,7 @@ export async function isGlassAvailableForCarId(carId, pageNameToLog) {
const newGlassOptions = await baseMixin.methods.dispatchStoreActionWithLogging( const newGlassOptions = await baseMixin.methods.dispatchStoreActionWithLogging(
storeActions.GET_DAMAGE_OPTIONS, storeActions.GET_DAMAGE_OPTIONS,
{ carId: carId }, { carId: carId },
pageNameToLog, pageNameToLog
); );
const currentGlassOptions = store.getters.damage.glassToReplace; const currentGlassOptions = store.getters.damage.glassToReplace;

View file

@ -15,15 +15,15 @@ describe("event-bus.js", () => {
eventBus.addEventToBus( eventBus.addEventToBus(
globalEvents.Categories.GLOBAL_ALERT, globalEvents.Categories.GLOBAL_ALERT,
globalEvents.SubCategories.PAGE_NOT_FOUND, globalEvents.SubCategories.PAGE_NOT_FOUND,
event, event
); );
// Assert // Assert
expect( expect(
store.getters.eventBusItem( store.getters.eventBusItem(
globalEvents.Categories.GLOBAL_ALERT, globalEvents.Categories.GLOBAL_ALERT,
globalEvents.SubCategories.PAGE_NOT_FOUND, globalEvents.SubCategories.PAGE_NOT_FOUND
), )
).toEqual(event); ).toEqual(event);
expect(store.state.applicationUser.eventBus.length).toEqual(1); expect(store.state.applicationUser.eventBus.length).toEqual(1);
@ -31,7 +31,7 @@ describe("event-bus.js", () => {
// Arrange / Act // Arrange / Act
const eventValue = eventBus.readAndPopEventFromBus( const eventValue = eventBus.readAndPopEventFromBus(
globalEvents.Categories.GLOBAL_ALERT, globalEvents.Categories.GLOBAL_ALERT,
globalEvents.SubCategories.PAGE_NOT_FOUND, globalEvents.SubCategories.PAGE_NOT_FOUND
); );
// Assert // Assert
@ -45,15 +45,15 @@ describe("event-bus.js", () => {
eventBus.addEventToBus( eventBus.addEventToBus(
globalEvents.Categories.GLOBAL_ALERT, globalEvents.Categories.GLOBAL_ALERT,
globalEvents.SubCategories.PAGE_NOT_FOUND, globalEvents.SubCategories.PAGE_NOT_FOUND,
event, event
); );
// Assert // Assert
expect( expect(
eventBus.readEventFromBus( eventBus.readEventFromBus(
globalEvents.Categories.GLOBAL_ALERT, globalEvents.Categories.GLOBAL_ALERT,
globalEvents.SubCategories.PAGE_NOT_FOUND, globalEvents.SubCategories.PAGE_NOT_FOUND
), )
).toEqual(event); ).toEqual(event);
}); });
}); });

View file

@ -84,7 +84,7 @@ export function regenerateDeviceId() {
{ {
[cookieNames.DXDEV]: `did=${crypto.randomUUID()}`, [cookieNames.DXDEV]: `did=${crypto.randomUUID()}`,
}, },
{ maxAge: cookieExpirations.DXDEV }, { maxAge: cookieExpirations.DXDEV }
); );
} }
} }
@ -105,7 +105,7 @@ export function regenerateUserId() {
{ {
[cookieNames.FUNNEL_USER_ID]: crypto.randomUUID(), [cookieNames.FUNNEL_USER_ID]: crypto.randomUUID(),
}, },
{ maxAge: cookieExpirations.FUNNEL_USER_ID }, { maxAge: cookieExpirations.FUNNEL_USER_ID }
); );
} }
} }
@ -129,7 +129,7 @@ export function setSessionKeyIfUnset(value) {
{ {
[cookieNames.FUNNEL_SESSION_KEY]: value, [cookieNames.FUNNEL_SESSION_KEY]: value,
}, },
{ maxAge: cookieExpirations.FUNNEL_SESSION_KEY }, { maxAge: cookieExpirations.FUNNEL_SESSION_KEY }
); );
} }
} }
@ -153,7 +153,7 @@ export function setSessionIdIfUnset(value) {
{ {
[cookieNames.SESSION_ID]: value, [cookieNames.SESSION_ID]: value,
}, },
{ maxAge: cookieExpirations.SESSION_ID }, { maxAge: cookieExpirations.SESSION_ID }
); );
} }
} }
@ -169,7 +169,7 @@ export function updateSessionIdCookie() {
export function setCookieProperties( export function setCookieProperties(
properties, properties,
{ useDefaultFunnelCookieAttributes = true, maxAge, isSecure }, { useDefaultFunnelCookieAttributes = true, maxAge, isSecure }
) { ) {
if (typeof properties == "object") { if (typeof properties == "object") {
Object.keys(properties).forEach((key) => { Object.keys(properties).forEach((key) => {
@ -253,7 +253,7 @@ function setFunnelCookieProperties(properties) {
function createOrUpdateCookie( function createOrUpdateCookie(
key, key,
value = "", value = "",
{ useDefaultFunnelCookieAttributes = true, maxAge, isSecure = true }, { useDefaultFunnelCookieAttributes = true, maxAge, isSecure = true }
) { ) {
let cookieToAdd = `${key}=${value}; `; let cookieToAdd = `${key}=${value}; `;

View file

@ -185,7 +185,7 @@ describe("cookies", () => {
[cookieNames.DXDEV]: [cookieNames.DXDEV]:
"did=f4a1a9e8-b3f3-4936-8c30-2f06a98644af&tz=-300&tzd=1", "did=f4a1a9e8-b3f3-4936-8c30-2f06a98644af&tz=-300&tzd=1",
}, },
{}, {}
); );
//Act //Act
@ -403,7 +403,7 @@ describe("cookies", () => {
{ {
[cookieNames.SESSION_ID]: "test", [cookieNames.SESSION_ID]: "test",
}, },
{ maxAge: 0 }, { maxAge: 0 }
); );
const result = isCookieSet(cookieNames.SESSION_ID); const result = isCookieSet(cookieNames.SESSION_ID);

View file

@ -69,7 +69,7 @@ export async function getImplicitNavigation(toRoute) {
const vehiclePartsComponent = await getLazyLoadedComponent(fmgPageValues.VEHICLE_PARTS); const vehiclePartsComponent = await getLazyLoadedComponent(fmgPageValues.VEHICLE_PARTS);
const moldingQuestionsComponent = await getLazyLoadedComponent(fmgPageValues.MOLDING_QUESTIONS); const moldingQuestionsComponent = await getLazyLoadedComponent(fmgPageValues.MOLDING_QUESTIONS);
const capabilityQuestionsComponent = await getLazyLoadedComponent( const capabilityQuestionsComponent = await getLazyLoadedComponent(
fmgPageValues.CAPABILITY_QUESTIONS, fmgPageValues.CAPABILITY_QUESTIONS
); );
const quoteComponent = await getLazyLoadedComponent(fmgPageValues.QUOTE); const quoteComponent = await getLazyLoadedComponent(fmgPageValues.QUOTE);

View file

@ -545,7 +545,7 @@ describe("navigateToHeritageFunnel", () => {
mockReferralDate, mockReferralDate,
mockParentAccountNumber, mockParentAccountNumber,
mockSavedSessionId, mockSavedSessionId,
mockCrmCustomerId, mockCrmCustomerId
); );
const mockData = { const mockData = {
@ -590,7 +590,7 @@ describe("navigateToHeritageFunnel", () => {
mockReferralDate, mockReferralDate,
mockParentAccountNumber, mockParentAccountNumber,
mockSavedSessionId, mockSavedSessionId,
mockCrmCustomerId, mockCrmCustomerId
); );
const mockData = { const mockData = {
@ -617,7 +617,7 @@ describe("navigateToHeritageFunnel", () => {
externalUrls.HERITAGE_FUNNEL, externalUrls.HERITAGE_FUNNEL,
expect.objectContaining({ expect.objectContaining({
corid: mockCorrelationId, corid: mockCorrelationId,
}), })
); );
}); });
@ -630,7 +630,7 @@ describe("navigateToHeritageFunnel", () => {
const mockOrderInfo = getMockOrderInfo( const mockOrderInfo = getMockOrderInfo(
mockReferralNumber, mockReferralNumber,
mockCorrelationId, mockCorrelationId,
mockReferralDate, mockReferralDate
); );
const mockData = { const mockData = {

View file

@ -43,7 +43,7 @@ export async function loadSessionIfPresent(isConceptInsurance, pageNameToLog) {
funnelCookie.ReferralParentAccountNumber, funnelCookie.ReferralParentAccountNumber,
funnelCookie.ReferralCorrelationId, funnelCookie.ReferralCorrelationId,
isConceptInsurance, isConceptInsurance,
pageNameToLog, pageNameToLog
) )
)?.data; )?.data;
} }
@ -67,7 +67,7 @@ export async function saveSession({
return saveSessionHelper( return saveSessionHelper(
pageNameToLog, pageNameToLog,
submitAfterSave, submitAfterSave,
createDeleteStatusWorkOrderForPia, createDeleteStatusWorkOrderForPia
); );
}); });
} else { } else {
@ -75,7 +75,7 @@ export async function saveSession({
saveSessionPromise = saveSessionHelper( saveSessionPromise = saveSessionHelper(
pageNameToLog, pageNameToLog,
submitAfterSave, submitAfterSave,
createDeleteStatusWorkOrderForPia, createDeleteStatusWorkOrderForPia
); );
} }
store.commit(storeMutations.UPDATE_SAVE_SESSION_PROMISE, saveSessionPromise); store.commit(storeMutations.UPDATE_SAVE_SESSION_PROMISE, saveSessionPromise);
@ -111,7 +111,7 @@ async function loadSession(
parentAccountNumber, parentAccountNumber,
referralCorrelationId, referralCorrelationId,
isConceptInsurance, isConceptInsurance,
pageNameToLog, pageNameToLog
) { ) {
// await the saveSessionPromise in the store to make sure we're loading up to date information // await the saveSessionPromise in the store to make sure we're loading up to date information
await store.getters.applicationUser.saveSessionPromise; await store.getters.applicationUser.saveSessionPromise;
@ -127,7 +127,7 @@ async function loadSession(
isConceptInsurance, isConceptInsurance,
}, },
pageNameToLog, pageNameToLog,
false, false
); );
return response; return response;
@ -139,7 +139,7 @@ async function loadSession(
async function saveSessionHelper( async function saveSessionHelper(
pageNameToLog, pageNameToLog,
submitAfterSave = false, submitAfterSave = false,
createDeleteStatusWorkOrderForPia = false, createDeleteStatusWorkOrderForPia = false
) { ) {
const savedSessionInfo = await baseMixin.methods.dispatchStoreActionWithLogging( const savedSessionInfo = await baseMixin.methods.dispatchStoreActionWithLogging(
storeActions.SAVE_SESSION, storeActions.SAVE_SESSION,
@ -147,7 +147,7 @@ async function saveSessionHelper(
submitAfterSave: submitAfterSave, submitAfterSave: submitAfterSave,
createDeleteStatusWorkOrderForPia: createDeleteStatusWorkOrderForPia, createDeleteStatusWorkOrderForPia: createDeleteStatusWorkOrderForPia,
}, },
pageNameToLog, pageNameToLog
); );
// Update the store with information received from the saveSession response // Update the store with information received from the saveSession response
await baseMixin.methods.dispatchStoreAction( await baseMixin.methods.dispatchStoreAction(
@ -168,7 +168,7 @@ async function saveSessionHelper(
settledTenderAmount: savedSessionInfo.data.settledTenderAmount, settledTenderAmount: savedSessionInfo.data.settledTenderAmount,
billToAccountNumber: savedSessionInfo.data.billToAccountNumber, billToAccountNumber: savedSessionInfo.data.billToAccountNumber,
}, },
false, false
); );
// Update the cookie with the referral information when saved. // Update the cookie with the referral information when saved.

View file

@ -32,7 +32,7 @@ describe("loadSessionIfPresent", () => {
}; };
document.cookie = `${cookieNames.FUNNEL_SESSION_INFO}=${JSON.stringify( document.cookie = `${cookieNames.FUNNEL_SESSION_INFO}=${JSON.stringify(
testCookieValue, testCookieValue
)}; path=/; ${cookieHelper.getCookieDomainValue()}`; )}; path=/; ${cookieHelper.getCookieDomainValue()}`;
// Act // Act
@ -70,7 +70,7 @@ describe("loadSessionIfPresent", () => {
// Assert // Assert
expect(cookieHelper.getFunnelCookie).toHaveBeenCalled(); expect(cookieHelper.getFunnelCookie).toHaveBeenCalled();
expect(mocks.baseMixin.methods.dispatchStoreAction).toHaveBeenCalledWith( expect(mocks.baseMixin.methods.dispatchStoreAction).toHaveBeenCalledWith(
storeActions.RESET_STATE, storeActions.RESET_STATE
); );
}); });
@ -96,7 +96,7 @@ describe("loadSessionIfPresent", () => {
// Assert // Assert
expect(cookieHelper.getFunnelCookie).toHaveBeenCalled(); expect(cookieHelper.getFunnelCookie).toHaveBeenCalled();
expect(mocks.baseMixin.methods.dispatchStoreAction).not.toHaveBeenCalledWith( expect(mocks.baseMixin.methods.dispatchStoreAction).not.toHaveBeenCalledWith(
storeActions.RESET_STATE, storeActions.RESET_STATE
); );
}); });
@ -129,7 +129,7 @@ describe("loadSessionIfPresent", () => {
// Assert // Assert
expect(cookieHelper.getFunnelCookie).toHaveBeenCalled(); expect(cookieHelper.getFunnelCookie).toHaveBeenCalled();
expect(mocks.baseMixin.methods.dispatchStoreAction).not.toHaveBeenCalledWith( expect(mocks.baseMixin.methods.dispatchStoreAction).not.toHaveBeenCalledWith(
storeActions.LOAD_SESSION, storeActions.LOAD_SESSION
); );
expect(result.ReferralNumber).toBe(123456); expect(result.ReferralNumber).toBe(123456);
expect(result.vehicle.year).toBe(2010); expect(result.vehicle.year).toBe(2010);
@ -156,7 +156,7 @@ describe("saveSession", () => {
mockReferralDate, mockReferralDate,
mockParentAccountNumber, mockParentAccountNumber,
mockSavedSessionId, mockSavedSessionId,
mockCrmCustomerId, mockCrmCustomerId
); );
const mockData = { const mockData = {
@ -180,7 +180,7 @@ describe("saveSession", () => {
expect(mocks.baseMixin.methods.dispatchStoreActionWithLogging).toHaveBeenCalledWith( expect(mocks.baseMixin.methods.dispatchStoreActionWithLogging).toHaveBeenCalledWith(
storeActions.SAVE_SESSION, storeActions.SAVE_SESSION,
{ createDeleteStatusWorkOrderForPia: false, submitAfterSave: false }, { createDeleteStatusWorkOrderForPia: false, submitAfterSave: false },
"test", "test"
); );
expect(mocks.baseMixin.methods.dispatchStoreAction).toHaveBeenCalledWith( expect(mocks.baseMixin.methods.dispatchStoreAction).toHaveBeenCalledWith(
storeActions.UPDATE_STORE_WITH_SAVE_SESSION_RESPONSE, storeActions.UPDATE_STORE_WITH_SAVE_SESSION_RESPONSE,
@ -192,7 +192,7 @@ describe("saveSession", () => {
savedSessionId: mockSavedSessionId, savedSessionId: mockSavedSessionId,
crmCustomerId: mockCrmCustomerId, crmCustomerId: mockCrmCustomerId,
}, },
false, false
); );
}); });
@ -211,7 +211,7 @@ describe("saveSession", () => {
mockReferralDate, mockReferralDate,
mockParentAccountNumber, mockParentAccountNumber,
mockSavedSessionId, mockSavedSessionId,
mockCrmCustomerId, mockCrmCustomerId
); );
const mockData = { const mockData = {
@ -264,7 +264,7 @@ describe("submitWorkOrder", () => {
mockReferralDate, mockReferralDate,
mockParentAccountNumber, mockParentAccountNumber,
mockSavedSessionId, mockSavedSessionId,
mockCrmCustomerId, mockCrmCustomerId
); );
const mockData = { const mockData = {
@ -288,7 +288,7 @@ describe("submitWorkOrder", () => {
expect(mocks.baseMixin.methods.dispatchStoreActionWithLogging).toHaveBeenCalledWith( expect(mocks.baseMixin.methods.dispatchStoreActionWithLogging).toHaveBeenCalledWith(
storeActions.SAVE_SESSION, storeActions.SAVE_SESSION,
{ createDeleteStatusWorkOrderForPia: false, submitAfterSave: true }, { createDeleteStatusWorkOrderForPia: false, submitAfterSave: true },
"test", "test"
); );
expect(mocks.baseMixin.methods.dispatchStoreAction).toHaveBeenCalledWith( expect(mocks.baseMixin.methods.dispatchStoreAction).toHaveBeenCalledWith(
storeActions.UPDATE_STORE_WITH_SAVE_SESSION_RESPONSE, storeActions.UPDATE_STORE_WITH_SAVE_SESSION_RESPONSE,
@ -300,7 +300,7 @@ describe("submitWorkOrder", () => {
savedSessionId: mockSavedSessionId, savedSessionId: mockSavedSessionId,
crmCustomerId: mockCrmCustomerId, crmCustomerId: mockCrmCustomerId,
}, },
false, false
); );
}); });
@ -319,7 +319,7 @@ describe("submitWorkOrder", () => {
mockReferralDate, mockReferralDate,
mockParentAccountNumber, mockParentAccountNumber,
mockSavedSessionId, mockSavedSessionId,
mockCrmCustomerId, mockCrmCustomerId
); );
const mockData = { const mockData = {

View file

@ -22,6 +22,6 @@ export function settleAllPromises(promiseResultMap) {
} }
return resultMap; return resultMap;
}, }
); );
} }

View file

@ -9,14 +9,14 @@ export class Logger {
logInformation(message, details) { logInformation(message, details) {
this.writeLogEntry( this.writeLogEntry(
loggingEndpointMethods.LOG_INFORMATION, loggingEndpointMethods.LOG_INFORMATION,
this.formatLogEntry(message, details), this.formatLogEntry(message, details)
); );
} }
logWarning(message, details) { logWarning(message, details) {
this.writeLogEntry( this.writeLogEntry(
loggingEndpointMethods.LOG_WARNING, loggingEndpointMethods.LOG_WARNING,
this.formatLogEntry(message, details), this.formatLogEntry(message, details)
); );
} }
@ -27,7 +27,7 @@ export class Logger {
logCritical(message, details) { logCritical(message, details) {
this.writeLogEntry( this.writeLogEntry(
loggingEndpointMethods.LOG_CRITICAL, loggingEndpointMethods.LOG_CRITICAL,
this.formatLogEntry(message, details), this.formatLogEntry(message, details)
); );
} }
@ -82,7 +82,7 @@ export class Logger {
}, },
(error) => { (error) => {
return reject(error); return reject(error);
}, }
); );
}); });
} }

View file

@ -15,7 +15,7 @@ export function deepClone(object) {
let clone = Object.assign({}, object); let clone = Object.assign({}, object);
Object.keys(clone).forEach( Object.keys(clone).forEach(
(key) => (key) =>
(clone[key] = typeof object[key] === "object" ? deepClone(object[key]) : object[key]), (clone[key] = typeof object[key] === "object" ? deepClone(object[key]) : object[key])
); );
if (Array.isArray(object)) { if (Array.isArray(object)) {

View file

@ -63,7 +63,7 @@ export function getLineItemsThatMatchPromos(promos, availableLineItems) {
} }
promo.discountedLineItemIds.forEach((discountedLineItemId) => { promo.discountedLineItemIds.forEach((discountedLineItemId) => {
matchingLineItems.push( matchingLineItems.push(
...availableLineItems.filter((lineItem) => lineItem.id === discountedLineItemId), ...availableLineItems.filter((lineItem) => lineItem.id === discountedLineItemId)
); );
}); });
}); });
@ -76,7 +76,7 @@ export function getAddableVapsFromAvailableLineItems(availableLineItems) {
const addableVaps = []; const addableVaps = [];
addableVaps.push(...findLineItemsWithPartType(partTypeStrings.FRONT_WIPER, availableLineItems)); addableVaps.push(...findLineItemsWithPartType(partTypeStrings.FRONT_WIPER, availableLineItems));
addableVaps.push( addableVaps.push(
...findLineItemsWithPartType(partTypeStrings.RAIN_DEFENSE, availableLineItems), ...findLineItemsWithPartType(partTypeStrings.RAIN_DEFENSE, availableLineItems)
); );
return addableVaps; return addableVaps;
} }
@ -99,7 +99,7 @@ export async function revalidatePromosAndValidateQueryStringPromo(
newPromo, newPromo,
pricedLineItems, pricedLineItems,
pageNameToLog, pageNameToLog,
useDefaultCashParentAccount = false, useDefaultCashParentAccount = false
) { ) {
const hasActivePromos = store.getters.order.lineItems.promos; const hasActivePromos = store.getters.order.lineItems.promos;
const hasInactivePromos = store.getters.payment.inactivePromos; const hasInactivePromos = store.getters.payment.inactivePromos;
@ -117,7 +117,7 @@ export async function revalidatePromosAndValidateQueryStringPromo(
storeActions.REVALIDATE_ORDER_PROMOS_AND_SAVE_SERVER_DATA, storeActions.REVALIDATE_ORDER_PROMOS_AND_SAVE_SERVER_DATA,
{ useDefaultCashParentAccount }, { useDefaultCashParentAccount },
pageNameToLog, pageNameToLog,
false, false
); );
const revalidationErrorPromoCodes = revalidatePromoResponse.errors.map((x) => x.promoCode); const revalidationErrorPromoCodes = revalidatePromoResponse.errors.map((x) => x.promoCode);
@ -127,7 +127,7 @@ export async function revalidatePromosAndValidateQueryStringPromo(
activePromos: revalidatePromoResponse.promoLineItems, activePromos: revalidatePromoResponse.promoLineItems,
inactivePromos: revalidationErrorPromoCodes, inactivePromos: revalidationErrorPromoCodes,
}, },
false, false
); );
} }
@ -139,7 +139,7 @@ export async function revalidatePromosAndValidateQueryStringPromo(
addableVaps: addableVaps, addableVaps: addableVaps,
}, },
pageNameToLog, pageNameToLog,
false, false
); );
if (validatePromoResponse.errorCode == null) { if (validatePromoResponse.errorCode == null) {
@ -151,7 +151,7 @@ export async function revalidatePromosAndValidateQueryStringPromo(
{ {
activePromos: activePromos, activePromos: activePromos,
}, },
false, false
); );
} else if (!excludeFromInactivePromoErrorCodes.includes(validatePromoResponse.errorCode)) { } else if (!excludeFromInactivePromoErrorCodes.includes(validatePromoResponse.errorCode)) {
// Save any valid query string promoCode (not applied) to inactivePromos // Save any valid query string promoCode (not applied) to inactivePromos
@ -161,7 +161,7 @@ export async function revalidatePromosAndValidateQueryStringPromo(
return promoObject.promoCode.toUpperCase(); return promoObject.promoCode.toUpperCase();
}) ?? []; }) ?? [];
const isErrorPromoAlreadyOnOrder = activePromoCodes.includes( const isErrorPromoAlreadyOnOrder = activePromoCodes.includes(
validatePromoResponse.promoCode.toUpperCase(), validatePromoResponse.promoCode.toUpperCase()
); );
// Do not save an inactivePromo if it is already active on the order // Do not save an inactivePromo if it is already active on the order
if (!isErrorPromoAlreadyOnOrder) { if (!isErrorPromoAlreadyOnOrder) {
@ -173,7 +173,7 @@ export async function revalidatePromosAndValidateQueryStringPromo(
{ {
inactivePromos: inactivePromoCodes, inactivePromos: inactivePromoCodes,
}, },
false, false
); );
} }
} }
@ -185,7 +185,7 @@ export async function revalidatePromosAndValidateQueryStringPromo(
export function buildToastMessagesFromRevalidateOrValidatePromoResponse( export function buildToastMessagesFromRevalidateOrValidatePromoResponse(
promoResponse, promoResponse,
oldActivePromos = [], oldActivePromos = [],
oldInactivePromos = [], oldInactivePromos = []
) { ) {
if (promoResponse == null) { if (promoResponse == null) {
return []; return [];
@ -194,13 +194,13 @@ export function buildToastMessagesFromRevalidateOrValidatePromoResponse(
// Revalidate always has an "errors" array // Revalidate always has an "errors" array
if (promoResponse.errors) { if (promoResponse.errors) {
const oldPromoCodes = oldActivePromos.map((promo) => const oldPromoCodes = oldActivePromos.map((promo) =>
getPromoCodeWithoutBundleIdentifier(promo.promoCode), getPromoCodeWithoutBundleIdentifier(promo.promoCode)
); );
const activePromoCodesFromResponse = getPromoCodesFromPromoObjectsWithoutDuplicates( const activePromoCodesFromResponse = getPromoCodesFromPromoObjectsWithoutDuplicates(
promoResponse.promoLineItems, promoResponse.promoLineItems
); );
const newlyActivatedPromoCodes = activePromoCodesFromResponse.filter( const newlyActivatedPromoCodes = activePromoCodesFromResponse.filter(
(newPromoCode) => !oldPromoCodes.includes(newPromoCode), (newPromoCode) => !oldPromoCodes.includes(newPromoCode)
); );
newlyActivatedPromoCodes.forEach((newlyActivatedPromoCode) => { newlyActivatedPromoCodes.forEach((newlyActivatedPromoCode) => {
@ -209,7 +209,7 @@ export function buildToastMessagesFromRevalidateOrValidatePromoResponse(
const newlyInactivatedPromos = getNewlyInactivatedPromos( const newlyInactivatedPromos = getNewlyInactivatedPromos(
oldInactivePromos, oldInactivePromos,
promoResponse.errors, promoResponse.errors
); );
newlyInactivatedPromos.forEach((newlyInactivatedPromo) => { newlyInactivatedPromos.forEach((newlyInactivatedPromo) => {
alerts.push(createPromoErrorAlert(newlyInactivatedPromo)); alerts.push(createPromoErrorAlert(newlyInactivatedPromo));
@ -219,7 +219,7 @@ export function buildToastMessagesFromRevalidateOrValidatePromoResponse(
else { else {
if (promoResponse.orderPromos) { if (promoResponse.orderPromos) {
const promoCodeToDisplay = getPromoCodeWithoutBundleIdentifier( const promoCodeToDisplay = getPromoCodeWithoutBundleIdentifier(
promoResponse.orderPromos[0].promoCode, promoResponse.orderPromos[0].promoCode
); );
alerts.push(createPromoSuccessAlert(promoCodeToDisplay)); alerts.push(createPromoSuccessAlert(promoCodeToDisplay));
} else { } else {
@ -228,8 +228,8 @@ export function buildToastMessagesFromRevalidateOrValidatePromoResponse(
createPromoErrorAlert( createPromoErrorAlert(
promoResponse.promoCode, promoResponse.promoCode,
promoResponse.errorCode, promoResponse.errorCode,
promoResponse.additionalInfo, promoResponse.additionalInfo
), )
); );
} }
} }
@ -279,19 +279,19 @@ export function getPromosThatMatchLineItemsOnOrder(promos, lineItemsOnOrder) {
export function getVapsThatNeedToBeAddedToSatisfyPromos( export function getVapsThatNeedToBeAddedToSatisfyPromos(
promos, promos,
availableLineItems, availableLineItems,
lineItemsOnOrder, lineItemsOnOrder
) { ) {
const clonedVaps = deepClone(lineItemsOnOrder?.vaps ?? []); const clonedVaps = deepClone(lineItemsOnOrder?.vaps ?? []);
const promosWithAddableVaps = getPromosWithAddableVaps(promos); const promosWithAddableVaps = getPromosWithAddableVaps(promos);
if (promosWithAddableVaps.length) { if (promosWithAddableVaps.length) {
const matchingLineItems = getLineItemsThatMatchPromos( const matchingLineItems = getLineItemsThatMatchPromos(
promosWithAddableVaps, promosWithAddableVaps,
availableLineItems, availableLineItems
); );
// Check if matching items are already in the order // Check if matching items are already in the order
const idsOfVapsAlreadyInOrder = clonedVaps.map((lineItem) => lineItem.id); const idsOfVapsAlreadyInOrder = clonedVaps.map((lineItem) => lineItem.id);
const vapsToAddToCart = matchingLineItems.filter( const vapsToAddToCart = matchingLineItems.filter(
(lineItem) => !idsOfVapsAlreadyInOrder.includes(lineItem.id), (lineItem) => !idsOfVapsAlreadyInOrder.includes(lineItem.id)
); );
return vapsToAddToCart; return vapsToAddToCart;
} else { } else {
@ -301,12 +301,12 @@ export function getVapsThatNeedToBeAddedToSatisfyPromos(
export function removeCurrentlyActivePromoCodesFromInactivePromos( export function removeCurrentlyActivePromoCodesFromInactivePromos(
activePromoObjects, activePromoObjects,
inactivePromos, inactivePromos
) { ) {
activePromoObjects = activePromoObjects ?? []; activePromoObjects = activePromoObjects ?? [];
inactivePromos = inactivePromos ?? []; inactivePromos = inactivePromos ?? [];
const activePromoCodes = activePromoObjects.map((promoObject) => const activePromoCodes = activePromoObjects.map((promoObject) =>
getPromoCodeWithoutBundleIdentifier(promoObject.promoCode).toUpperCase(), getPromoCodeWithoutBundleIdentifier(promoObject.promoCode).toUpperCase()
); );
return inactivePromos.filter((inactivePromo) => { return inactivePromos.filter((inactivePromo) => {
return !activePromoCodes.includes(inactivePromo.toUpperCase()); return !activePromoCodes.includes(inactivePromo.toUpperCase());
@ -326,7 +326,7 @@ export function getNewlyInactivatedPromos(oldInactivePromos, newInactivePromos)
const inactivePromoCodesFromResponse = const inactivePromoCodesFromResponse =
getPromoCodesFromPromoObjectsWithoutDuplicates(newInactivePromos); getPromoCodesFromPromoObjectsWithoutDuplicates(newInactivePromos);
return inactivePromoCodesFromResponse.filter( return inactivePromoCodesFromResponse.filter(
(errorPromoCode) => !oldInactivePromos?.includes(errorPromoCode), (errorPromoCode) => !oldInactivePromos?.includes(errorPromoCode)
); );
} }
@ -334,7 +334,7 @@ export function createPromoSuccessAlert(promoCode) {
return { return {
messageHeadline: "Promo code applied!", messageHeadline: "Promo code applied!",
messageCopy: `Promo code ${getPromoCodeWithoutBundleIdentifier( messageCopy: `Promo code ${getPromoCodeWithoutBundleIdentifier(
promoCode.toUpperCase(), promoCode.toUpperCase()
)} was successfully applied to your cart.`, )} was successfully applied to your cart.`,
type: "alert-success", type: "alert-success",
isDismissible: true, isDismissible: true,
@ -351,11 +351,11 @@ export function createPromoErrorAlert(promoCode, errorCode = null, additionalInf
}; };
if (stackingPromoErrorCodes.includes(errorCode)) { if (stackingPromoErrorCodes.includes(errorCode)) {
alert.messageCopy = `Sorry, promo code ${getPromoCodeWithoutBundleIdentifier( alert.messageCopy = `Sorry, promo code ${getPromoCodeWithoutBundleIdentifier(
promoCode.toUpperCase(), promoCode.toUpperCase()
)} cannot be combined with ${additionalInfo[0].toUpperCase()}`; )} cannot be combined with ${additionalInfo[0].toUpperCase()}`;
} else { } else {
alert.messageCopy = `Sorry, promo code ${getPromoCodeWithoutBundleIdentifier( alert.messageCopy = `Sorry, promo code ${getPromoCodeWithoutBundleIdentifier(
promoCode.toUpperCase(), promoCode.toUpperCase()
)} is not valid`; )} is not valid`;
} }
return alert; return alert;
@ -382,7 +382,7 @@ export function getPromoCodesFromPromoObjectsWithoutDuplicates(promos) {
function findLineItemsWithPartType(typeToFind, itemsToSearch) { function findLineItemsWithPartType(typeToFind, itemsToSearch) {
const partTypeMatches = const partTypeMatches =
itemsToSearch?.filter( itemsToSearch?.filter(
(lineItem) => lineItem.partType.toUpperCase() === typeToFind.toUpperCase(), (lineItem) => lineItem.partType.toUpperCase() === typeToFind.toUpperCase()
) ?? []; ) ?? [];
return partTypeMatches; return partTypeMatches;
} }

View file

@ -13,7 +13,7 @@ jest.mock("@/mixins/base-mixin", () => ({
dispatchStoreActionWithLogging: jest.fn( dispatchStoreActionWithLogging: jest.fn(
(action, { promoCode, addableVaps }, pageNameToLog, someBool) => { (action, { promoCode, addableVaps }, pageNameToLog, someBool) => {
return mockReturnsForStoreActions[action]; return mockReturnsForStoreActions[action];
}, }
), ),
}, },
})); }));
@ -76,7 +76,7 @@ describe("promotions-helper.js", () => {
// Assert // Assert
expect(promoListWithAddableVapsPromoReturn[0].promoIdentifier).toEqual( expect(promoListWithAddableVapsPromoReturn[0].promoIdentifier).toEqual(
promoIdentifier, promoIdentifier
); );
}); });
}); });
@ -101,29 +101,29 @@ describe("promotions-helper.js", () => {
// Null or Empty <promos> scenarios // Null or Empty <promos> scenarios
const nullPromosReturn = promotionsHelper.getLineItemsThatMatchPromos( const nullPromosReturn = promotionsHelper.getLineItemsThatMatchPromos(
nullPromos, nullPromos,
validAvailableLineItemsWithOneItem, validAvailableLineItemsWithOneItem
); );
const emptyPromosReturn = promotionsHelper.getLineItemsThatMatchPromos( const emptyPromosReturn = promotionsHelper.getLineItemsThatMatchPromos(
emptyPromos, emptyPromos,
validAvailableLineItemsWithOneItem, validAvailableLineItemsWithOneItem
); );
const nullDiscountedLineItemsReturn = promotionsHelper.getLineItemsThatMatchPromos( const nullDiscountedLineItemsReturn = promotionsHelper.getLineItemsThatMatchPromos(
promosWithNullDiscountedLineItemIds, promosWithNullDiscountedLineItemIds,
validAvailableLineItemsWithOneItem, validAvailableLineItemsWithOneItem
); );
const emptyDiscountedLineItemsReturn = promotionsHelper.getLineItemsThatMatchPromos( const emptyDiscountedLineItemsReturn = promotionsHelper.getLineItemsThatMatchPromos(
promosWithEmptyDiscountedLineItemIds, promosWithEmptyDiscountedLineItemIds,
validAvailableLineItemsWithOneItem, validAvailableLineItemsWithOneItem
); );
// Null or Empty <availableLineItems> scenarios // Null or Empty <availableLineItems> scenarios
const nullAvailableLineItemsReturn = promotionsHelper.getLineItemsThatMatchPromos( const nullAvailableLineItemsReturn = promotionsHelper.getLineItemsThatMatchPromos(
validPromosWithOnePromo, validPromosWithOnePromo,
nullAvailableLineItems, nullAvailableLineItems
); );
const emptyAvailableLineItemsReturn = promotionsHelper.getLineItemsThatMatchPromos( const emptyAvailableLineItemsReturn = promotionsHelper.getLineItemsThatMatchPromos(
validPromosWithOnePromo, validPromosWithOnePromo,
emptyAvailableLineItems, emptyAvailableLineItems
); );
// Assert // Assert
@ -168,7 +168,7 @@ describe("promotions-helper.js", () => {
}, },
]; ];
expect( expect(
promotionsHelper.getLineItemsThatMatchPromos(promos, availableLineItems), promotionsHelper.getLineItemsThatMatchPromos(promos, availableLineItems)
).toEqual(expected); ).toEqual(expected);
}); });
}); });
@ -202,15 +202,15 @@ describe("promotions-helper.js", () => {
// Act // Act
const addableVapsFromAvailableLineItems = const addableVapsFromAvailableLineItems =
promotionsHelper.getAddableVapsFromAvailableLineItems( promotionsHelper.getAddableVapsFromAvailableLineItems(
availableLineItemsWithFrontWipersAndRainDefense, availableLineItemsWithFrontWipersAndRainDefense
); );
// Assert // Assert
const frontWiperParts = addableVapsFromAvailableLineItems.filter( const frontWiperParts = addableVapsFromAvailableLineItems.filter(
(lineItem) => lineItem.partType == partTypeStrings.FRONT_WIPER, (lineItem) => lineItem.partType == partTypeStrings.FRONT_WIPER
); );
const rainDefenseParts = addableVapsFromAvailableLineItems.filter( const rainDefenseParts = addableVapsFromAvailableLineItems.filter(
(lineItem) => lineItem.partType == partTypeStrings.RAIN_DEFENSE, (lineItem) => lineItem.partType == partTypeStrings.RAIN_DEFENSE
); );
expect(addableVapsFromAvailableLineItems.length).toEqual(2); expect(addableVapsFromAvailableLineItems.length).toEqual(2);
expect(frontWiperParts.length).toEqual(1); expect(frontWiperParts.length).toEqual(1);
@ -264,7 +264,7 @@ describe("promotions-helper.js", () => {
const glassPromoArray = promosWithoutVapsPromos.filter( const glassPromoArray = promosWithoutVapsPromos.filter(
(promo) => (promo) =>
promo.partNumber == promo.partNumber ==
promotionsHelper.promoPartNumberStrings.GLASS_DISCOUNT_PART_NUMBER, promotionsHelper.promoPartNumberStrings.GLASS_DISCOUNT_PART_NUMBER
); );
expect(promosWithoutVapsPromos.length).toEqual(1); expect(promosWithoutVapsPromos.length).toEqual(1);
expect(glassPromoArray.length).toEqual(1); expect(glassPromoArray.length).toEqual(1);
@ -284,7 +284,7 @@ describe("promotions-helper.js", () => {
await promotionsHelper.revalidatePromosAndValidateQueryStringPromo( await promotionsHelper.revalidatePromosAndValidateQueryStringPromo(
newPromo, newPromo,
pricedLineItems, pricedLineItems,
pageNameToLog, pageNameToLog
); );
// Assert // Assert
@ -304,7 +304,7 @@ describe("promotions-helper.js", () => {
await promotionsHelper.revalidatePromosAndValidateQueryStringPromo( await promotionsHelper.revalidatePromosAndValidateQueryStringPromo(
newPromo, newPromo,
pricedLineItems, pricedLineItems,
pageNameToLog, pageNameToLog
); );
// Assert // Assert
@ -328,7 +328,7 @@ describe("promotions-helper.js", () => {
await promotionsHelper.revalidatePromosAndValidateQueryStringPromo( await promotionsHelper.revalidatePromosAndValidateQueryStringPromo(
newPromo, newPromo,
pricedLineItems, pricedLineItems,
pageNameToLog, pageNameToLog
); );
// Assert // Assert
@ -352,7 +352,7 @@ describe("promotions-helper.js", () => {
await promotionsHelper.revalidatePromosAndValidateQueryStringPromo( await promotionsHelper.revalidatePromosAndValidateQueryStringPromo(
newPromo, newPromo,
pricedLineItems, pricedLineItems,
pageNameToLog, pageNameToLog
); );
// Assert // Assert
@ -373,7 +373,7 @@ describe("promotions-helper.js", () => {
await promotionsHelper.revalidatePromosAndValidateQueryStringPromo( await promotionsHelper.revalidatePromosAndValidateQueryStringPromo(
newPromo, newPromo,
pricedLineItems, pricedLineItems,
pageNameToLog, pageNameToLog
); );
// Assert // Assert
@ -400,7 +400,7 @@ describe("promotions-helper.js", () => {
await promotionsHelper.revalidatePromosAndValidateQueryStringPromo( await promotionsHelper.revalidatePromosAndValidateQueryStringPromo(
newPromo, newPromo,
pricedLineItems, pricedLineItems,
pageNameToLog, pageNameToLog
); );
// Assert // Assert
@ -417,11 +417,11 @@ describe("promotions-helper.js", () => {
// Act // Act
const nullPromoResponseReturn = const nullPromoResponseReturn =
promotionsHelper.buildToastMessagesFromRevalidateOrValidatePromoResponse( promotionsHelper.buildToastMessagesFromRevalidateOrValidatePromoResponse(
nullPromoResponse, nullPromoResponse
); );
const unexpectedPromoResponseReturn = const unexpectedPromoResponseReturn =
promotionsHelper.buildToastMessagesFromRevalidateOrValidatePromoResponse( promotionsHelper.buildToastMessagesFromRevalidateOrValidatePromoResponse(
unexpectedPromoResponse, unexpectedPromoResponse
); );
// Assert // Assert
@ -437,11 +437,11 @@ describe("promotions-helper.js", () => {
// Act // Act
const successPromoResponseReturn = const successPromoResponseReturn =
promotionsHelper.buildToastMessagesFromRevalidateOrValidatePromoResponse( promotionsHelper.buildToastMessagesFromRevalidateOrValidatePromoResponse(
successPromoResponse, successPromoResponse
); );
const errorPromoResponseReturn = const errorPromoResponseReturn =
promotionsHelper.buildToastMessagesFromRevalidateOrValidatePromoResponse( promotionsHelper.buildToastMessagesFromRevalidateOrValidatePromoResponse(
errorPromoResponse, errorPromoResponse
); );
// Assert // Assert
@ -461,7 +461,7 @@ describe("promotions-helper.js", () => {
// Act // Act
const bundlePromoResponseReturn = const bundlePromoResponseReturn =
promotionsHelper.buildToastMessagesFromRevalidateOrValidatePromoResponse( promotionsHelper.buildToastMessagesFromRevalidateOrValidatePromoResponse(
bundlePromoResponse, bundlePromoResponse
); );
// Assert // Assert
@ -481,18 +481,18 @@ describe("promotions-helper.js", () => {
// Act // Act
const successAndErrorPromoResponseReturn = const successAndErrorPromoResponseReturn =
promotionsHelper.buildToastMessagesFromRevalidateOrValidatePromoResponse( promotionsHelper.buildToastMessagesFromRevalidateOrValidatePromoResponse(
successAndErrorPromoResponse, successAndErrorPromoResponse
); );
// Assert // Assert
// This depends on "createPromoSuccessAlert" implementation, which is bad practice // This depends on "createPromoSuccessAlert" implementation, which is bad practice
// but jest has trouble mocking same file dependencies // but jest has trouble mocking same file dependencies
const successAlert = successAndErrorPromoResponseReturn.filter((alert) => const successAlert = successAndErrorPromoResponseReturn.filter((alert) =>
alert.messageCopy.toLowerCase().includes("successpromo"), alert.messageCopy.toLowerCase().includes("successpromo")
); );
expect(successAlert[0]).toHaveProperty("type", "alert-success"); expect(successAlert[0]).toHaveProperty("type", "alert-success");
const errorAlert = successAndErrorPromoResponseReturn.filter((alert) => const errorAlert = successAndErrorPromoResponseReturn.filter((alert) =>
alert.messageCopy.toLowerCase().includes("errorpromo"), alert.messageCopy.toLowerCase().includes("errorpromo")
); );
expect(errorAlert[0]).toHaveProperty("type", "alert-danger"); expect(errorAlert[0]).toHaveProperty("type", "alert-danger");
}); });
@ -515,18 +515,18 @@ describe("promotions-helper.js", () => {
promotionsHelper.buildToastMessagesFromRevalidateOrValidatePromoResponse( promotionsHelper.buildToastMessagesFromRevalidateOrValidatePromoResponse(
successAndErrorPromoResponse, successAndErrorPromoResponse,
oldActivePromos, oldActivePromos,
oldInactivePromos, oldInactivePromos
); );
// Assert // Assert
// This depends on "createPromoSuccessAlert" implementation, which is bad practice // This depends on "createPromoSuccessAlert" implementation, which is bad practice
// but jest has trouble mocking same file dependencies // but jest has trouble mocking same file dependencies
const successAlert = successAndErrorPromoResponseReturn.filter((alert) => const successAlert = successAndErrorPromoResponseReturn.filter((alert) =>
alert.messageCopy.toLowerCase().includes("successpromo"), alert.messageCopy.toLowerCase().includes("successpromo")
); );
expect(successAlert[0]).toHaveProperty("type", "alert-success"); expect(successAlert[0]).toHaveProperty("type", "alert-success");
const errorAlert = successAndErrorPromoResponseReturn.filter((alert) => const errorAlert = successAndErrorPromoResponseReturn.filter((alert) =>
alert.messageCopy.toLowerCase().includes("errorpromo"), alert.messageCopy.toLowerCase().includes("errorpromo")
); );
expect(errorAlert[0]).toHaveProperty("type", "alert-danger"); expect(errorAlert[0]).toHaveProperty("type", "alert-danger");
}); });
@ -547,33 +547,33 @@ describe("promotions-helper.js", () => {
// Bad promos // Bad promos
const nullPromosReturn = promotionsHelper.getPromosThatMatchLineItemsOnOrder( const nullPromosReturn = promotionsHelper.getPromosThatMatchLineItemsOnOrder(
nullPromos, nullPromos,
validLineItemsOnOrder, validLineItemsOnOrder
); );
const emptyPromosReturn = promotionsHelper.getPromosThatMatchLineItemsOnOrder( const emptyPromosReturn = promotionsHelper.getPromosThatMatchLineItemsOnOrder(
emptyPromos, emptyPromos,
validLineItemsOnOrder, validLineItemsOnOrder
); );
// Bad lineItemsOnOrder // Bad lineItemsOnOrder
const nullLineItemsOnOrderReturn = const nullLineItemsOnOrderReturn =
promotionsHelper.getPromosThatMatchLineItemsOnOrder( promotionsHelper.getPromosThatMatchLineItemsOnOrder(
validPromos, validPromos,
nullLineItemsOnOrder, nullLineItemsOnOrder
); );
const emptyLineItemsOnOrderReturn = const emptyLineItemsOnOrderReturn =
promotionsHelper.getPromosThatMatchLineItemsOnOrder( promotionsHelper.getPromosThatMatchLineItemsOnOrder(
validPromos, validPromos,
emptyLineItemsOnOrder, emptyLineItemsOnOrder
); );
// Bad both // Bad both
const nullBothReturn = promotionsHelper.getPromosThatMatchLineItemsOnOrder( const nullBothReturn = promotionsHelper.getPromosThatMatchLineItemsOnOrder(
nullPromos, nullPromos,
nullLineItemsOnOrder, nullLineItemsOnOrder
); );
const emptyBothReturn = promotionsHelper.getPromosThatMatchLineItemsOnOrder( const emptyBothReturn = promotionsHelper.getPromosThatMatchLineItemsOnOrder(
emptyPromos, emptyPromos,
emptyLineItemsOnOrder, emptyLineItemsOnOrder
); );
// Assert // Assert
@ -599,7 +599,7 @@ describe("promotions-helper.js", () => {
// Act // Act
const returnedItems = promotionsHelper.getPromosThatMatchLineItemsOnOrder( const returnedItems = promotionsHelper.getPromosThatMatchLineItemsOnOrder(
promos, promos,
lineItemsOnOrder, lineItemsOnOrder
); );
// Assert // Assert
@ -632,7 +632,7 @@ describe("promotions-helper.js", () => {
// Act // Act
const returnedItems = promotionsHelper.getPromosThatMatchLineItemsOnOrder( const returnedItems = promotionsHelper.getPromosThatMatchLineItemsOnOrder(
promos, promos,
lineItemsOnOrder, lineItemsOnOrder
); );
// Assert // Assert
@ -665,12 +665,12 @@ describe("promotions-helper.js", () => {
const nullPromosReturn = promotionsHelper.getVapsThatNeedToBeAddedToSatisfyPromos( const nullPromosReturn = promotionsHelper.getVapsThatNeedToBeAddedToSatisfyPromos(
nullPromos, nullPromos,
validAvailableLineItems, validAvailableLineItems,
validLineItemsOnOrder, validLineItemsOnOrder
); );
const emptyPromosReturn = promotionsHelper.getVapsThatNeedToBeAddedToSatisfyPromos( const emptyPromosReturn = promotionsHelper.getVapsThatNeedToBeAddedToSatisfyPromos(
emptyPromos, emptyPromos,
validAvailableLineItems, validAvailableLineItems,
validLineItemsOnOrder, validLineItemsOnOrder
); );
// Bad availableLineItems // Bad availableLineItems
@ -678,25 +678,25 @@ describe("promotions-helper.js", () => {
promotionsHelper.getVapsThatNeedToBeAddedToSatisfyPromos( promotionsHelper.getVapsThatNeedToBeAddedToSatisfyPromos(
validPromos, validPromos,
nullAvailableLineItems, nullAvailableLineItems,
validLineItemsOnOrder, validLineItemsOnOrder
); );
const emptyAvailableLineItemsReturn = const emptyAvailableLineItemsReturn =
promotionsHelper.getVapsThatNeedToBeAddedToSatisfyPromos( promotionsHelper.getVapsThatNeedToBeAddedToSatisfyPromos(
validPromos, validPromos,
emptyAvailableLineItems, emptyAvailableLineItems,
validLineItemsOnOrder, validLineItemsOnOrder
); );
// Bad all // Bad all
const nullAllReturn = promotionsHelper.getVapsThatNeedToBeAddedToSatisfyPromos( const nullAllReturn = promotionsHelper.getVapsThatNeedToBeAddedToSatisfyPromos(
nullPromos, nullPromos,
nullAvailableLineItems, nullAvailableLineItems,
nullLineItemsOnOrder, nullLineItemsOnOrder
); );
const emptyAllReturn = promotionsHelper.getVapsThatNeedToBeAddedToSatisfyPromos( const emptyAllReturn = promotionsHelper.getVapsThatNeedToBeAddedToSatisfyPromos(
emptyPromos, emptyPromos,
emptyAvailableLineItems, emptyAvailableLineItems,
emptyLineItemsOnOrder, emptyLineItemsOnOrder
); );
// Assert // Assert
@ -730,7 +730,7 @@ describe("promotions-helper.js", () => {
const actualReturn = promotionsHelper.getVapsThatNeedToBeAddedToSatisfyPromos( const actualReturn = promotionsHelper.getVapsThatNeedToBeAddedToSatisfyPromos(
promos, promos,
availableLineItems, availableLineItems,
lineItemsOnOrder, lineItemsOnOrder
); );
// Assert // Assert
@ -759,7 +759,7 @@ describe("promotions-helper.js", () => {
const actualReturn = promotionsHelper.getVapsThatNeedToBeAddedToSatisfyPromos( const actualReturn = promotionsHelper.getVapsThatNeedToBeAddedToSatisfyPromos(
promos, promos,
availableLineItems, availableLineItems,
lineItemsOnOrder, lineItemsOnOrder
); );
// Assert // Assert
@ -779,23 +779,23 @@ describe("promotions-helper.js", () => {
const nullInactivePromosReturn = const nullInactivePromosReturn =
promotionsHelper.removeCurrentlyActivePromoCodesFromInactivePromos( promotionsHelper.removeCurrentlyActivePromoCodesFromInactivePromos(
validActivePromoObjects, validActivePromoObjects,
nullInactivePromos, nullInactivePromos
); );
const emptyInactivePromosReturn = const emptyInactivePromosReturn =
promotionsHelper.removeCurrentlyActivePromoCodesFromInactivePromos( promotionsHelper.removeCurrentlyActivePromoCodesFromInactivePromos(
validActivePromoObjects, validActivePromoObjects,
emptyInactivePromos, emptyInactivePromos
); );
const allNullReturn = const allNullReturn =
promotionsHelper.removeCurrentlyActivePromoCodesFromInactivePromos( promotionsHelper.removeCurrentlyActivePromoCodesFromInactivePromos(
nullActivePromoObjects, nullActivePromoObjects,
nullInactivePromos, nullInactivePromos
); );
const allEmptyReturn = const allEmptyReturn =
promotionsHelper.removeCurrentlyActivePromoCodesFromInactivePromos( promotionsHelper.removeCurrentlyActivePromoCodesFromInactivePromos(
emptyActivePromoObjects, emptyActivePromoObjects,
emptyInactivePromos, emptyInactivePromos
); );
// Assert // Assert
@ -815,7 +815,7 @@ describe("promotions-helper.js", () => {
const actualReturn = const actualReturn =
promotionsHelper.removeCurrentlyActivePromoCodesFromInactivePromos( promotionsHelper.removeCurrentlyActivePromoCodesFromInactivePromos(
activePromoObjects, activePromoObjects,
inactivePromos, inactivePromos
); );
// Assert // Assert
@ -835,7 +835,7 @@ describe("promotions-helper.js", () => {
const actualReturn = const actualReturn =
promotionsHelper.removeCurrentlyActivePromoCodesFromInactivePromos( promotionsHelper.removeCurrentlyActivePromoCodesFromInactivePromos(
activePromoObjects, activePromoObjects,
inactivePromos, inactivePromos
); );
// Assert // Assert
@ -850,7 +850,7 @@ describe("promotions-helper.js", () => {
const actualReturn = const actualReturn =
promotionsHelper.removeCurrentlyActivePromoCodesFromInactivePromos( promotionsHelper.removeCurrentlyActivePromoCodesFromInactivePromos(
activePromoObjects, activePromoObjects,
inactivePromos, inactivePromos
); );
// Assert // Assert
@ -894,21 +894,21 @@ describe("promotions-helper.js", () => {
// Act // Act
const nullNewInactivePromosReturn = promotionsHelper.getNewlyInactivatedPromos( const nullNewInactivePromosReturn = promotionsHelper.getNewlyInactivatedPromos(
validOldInactivePromos, validOldInactivePromos,
nullNewInactivePromos, nullNewInactivePromos
); );
const emptyNewInactivePromosReturn = promotionsHelper.getNewlyInactivatedPromos( const emptyNewInactivePromosReturn = promotionsHelper.getNewlyInactivatedPromos(
validOldInactivePromos, validOldInactivePromos,
emptyNewInactivePromos, emptyNewInactivePromos
); );
const nullOldInactivePromosReturn = promotionsHelper.getNewlyInactivatedPromos( const nullOldInactivePromosReturn = promotionsHelper.getNewlyInactivatedPromos(
nullOldInactivePromos, nullOldInactivePromos,
validNewInactivePromos, validNewInactivePromos
); );
const allNullReturn = promotionsHelper.getNewlyInactivatedPromos( const allNullReturn = promotionsHelper.getNewlyInactivatedPromos(
nullOldInactivePromos, nullOldInactivePromos,
nullNewInactivePromos, nullNewInactivePromos
); );
// Assert // Assert
@ -931,7 +931,7 @@ describe("promotions-helper.js", () => {
// Act // Act
const actualReturn = promotionsHelper.getNewlyInactivatedPromos( const actualReturn = promotionsHelper.getNewlyInactivatedPromos(
oldInactivePromos, oldInactivePromos,
newInactivePromos, newInactivePromos
); );
// Assert // Assert
@ -950,7 +950,7 @@ describe("promotions-helper.js", () => {
// Act // Act
const actualReturn = promotionsHelper.getNewlyInactivatedPromos( const actualReturn = promotionsHelper.getNewlyInactivatedPromos(
oldInactivePromos, oldInactivePromos,
newInactivePromos, newInactivePromos
); );
// Assert // Assert
@ -971,12 +971,12 @@ describe("promotions-helper.js", () => {
const stackingReturn = promotionsHelper.createPromoErrorAlert( const stackingReturn = promotionsHelper.createPromoErrorAlert(
promoCode, promoCode,
stackingErrorCode, stackingErrorCode,
additionalInfo, additionalInfo
); );
const nonStackingReturn = promotionsHelper.createPromoErrorAlert( const nonStackingReturn = promotionsHelper.createPromoErrorAlert(
promoCode, promoCode,
nonStackingErrorCode, nonStackingErrorCode,
additionalInfo, additionalInfo
); );
// Assert // Assert
@ -1040,14 +1040,14 @@ describe("promotions-helper.js", () => {
await promotionsHelper.revalidatePromosAndValidateQueryStringPromo( await promotionsHelper.revalidatePromosAndValidateQueryStringPromo(
newPromo, newPromo,
pricedLineItems, pricedLineItems,
pageNameToLog, pageNameToLog
); );
// Assert // Assert
expect(baseMixin.methods.dispatchStoreAction).toBeCalledWith( expect(baseMixin.methods.dispatchStoreAction).toBeCalledWith(
storeActions.SAVE_ACTIVE_AND_OR_INACTIVE_PROMOS, storeActions.SAVE_ACTIVE_AND_OR_INACTIVE_PROMOS,
expect.anything(), expect.anything(),
expect.anything(), expect.anything()
); );
expect(baseMixin.methods.dispatchStoreAction).toBeCalledTimes(2); expect(baseMixin.methods.dispatchStoreAction).toBeCalledTimes(2);
}); });
@ -1072,14 +1072,14 @@ describe("promotions-helper.js", () => {
await promotionsHelper.revalidatePromosAndValidateQueryStringPromo( await promotionsHelper.revalidatePromosAndValidateQueryStringPromo(
newPromo, newPromo,
pricedLineItems, pricedLineItems,
pageNameToLog, pageNameToLog
); );
// Assert // Assert
expect(baseMixin.methods.dispatchStoreAction).toBeCalledWith( expect(baseMixin.methods.dispatchStoreAction).toBeCalledWith(
storeActions.SAVE_ACTIVE_AND_OR_INACTIVE_PROMOS, storeActions.SAVE_ACTIVE_AND_OR_INACTIVE_PROMOS,
{ inactivePromos: ["testPromo"] }, { inactivePromos: ["testPromo"] },
expect.anything(), expect.anything()
); );
}); });
it("should not save an inactive promo if the promo is already an active promo (read comment below)", async () => { it("should not save an inactive promo if the promo is already an active promo (read comment below)", async () => {
@ -1109,14 +1109,14 @@ describe("promotions-helper.js", () => {
await promotionsHelper.revalidatePromosAndValidateQueryStringPromo( await promotionsHelper.revalidatePromosAndValidateQueryStringPromo(
newPromo, newPromo,
pricedLineItems, pricedLineItems,
pageNameToLog, pageNameToLog
); );
// Assert // Assert
expect(baseMixin.methods.dispatchStoreAction).not.toBeCalledWith( expect(baseMixin.methods.dispatchStoreAction).not.toBeCalledWith(
storeActions.SAVE_ACTIVE_AND_OR_INACTIVE_PROMOS, storeActions.SAVE_ACTIVE_AND_OR_INACTIVE_PROMOS,
{ inactivePromos: ["testPromo"] }, { inactivePromos: ["testPromo"] },
expect.anything(), expect.anything()
); );
}); });
it("should not save an inactive promo if the promo is on the 'excludeFromInactivePromoErrorCodes' list", async () => { it("should not save an inactive promo if the promo is on the 'excludeFromInactivePromoErrorCodes' list", async () => {
@ -1139,14 +1139,14 @@ describe("promotions-helper.js", () => {
await promotionsHelper.revalidatePromosAndValidateQueryStringPromo( await promotionsHelper.revalidatePromosAndValidateQueryStringPromo(
newPromo, newPromo,
pricedLineItems, pricedLineItems,
pageNameToLog, pageNameToLog
); );
// Assert // Assert
expect(baseMixin.methods.dispatchStoreAction).not.toBeCalledWith( expect(baseMixin.methods.dispatchStoreAction).not.toBeCalledWith(
storeActions.SAVE_ACTIVE_AND_OR_INACTIVE_PROMOS, storeActions.SAVE_ACTIVE_AND_OR_INACTIVE_PROMOS,
expect.anything(), expect.anything(),
expect.anything(), expect.anything()
); );
}); });
it("should not save an inactive promo if the promo is already in the store as inactive", async () => { it("should not save an inactive promo if the promo is already in the store as inactive", async () => {
@ -1168,14 +1168,14 @@ describe("promotions-helper.js", () => {
await promotionsHelper.revalidatePromosAndValidateQueryStringPromo( await promotionsHelper.revalidatePromosAndValidateQueryStringPromo(
newPromo, newPromo,
pricedLineItems, pricedLineItems,
pageNameToLog, pageNameToLog
); );
// Assert // Assert
expect(baseMixin.methods.dispatchStoreAction).not.toBeCalledWith( expect(baseMixin.methods.dispatchStoreAction).not.toBeCalledWith(
storeActions.SAVE_ACTIVE_AND_OR_INACTIVE_PROMOS, storeActions.SAVE_ACTIVE_AND_OR_INACTIVE_PROMOS,
{ inactivePromos: [newPromo] }, { inactivePromos: [newPromo] },
expect.anything(), expect.anything()
); );
}); });
it("should call SAVE_INACTIVE_AND_OR_ACTIVE_PROMOS with a list of strings for the inactivePromos parameter", async () => { it("should call SAVE_INACTIVE_AND_OR_ACTIVE_PROMOS with a list of strings for the inactivePromos parameter", async () => {
@ -1197,7 +1197,7 @@ describe("promotions-helper.js", () => {
await promotionsHelper.revalidatePromosAndValidateQueryStringPromo( await promotionsHelper.revalidatePromosAndValidateQueryStringPromo(
null, null,
null, null,
null, null
); );
// Assert // Assert
@ -1207,7 +1207,7 @@ describe("promotions-helper.js", () => {
activePromos: expect.anything(), activePromos: expect.anything(),
inactivePromos: ["testPromo1", "testPromo2"], inactivePromos: ["testPromo1", "testPromo2"],
}, },
false, false
); );
}); });
}); });

View file

@ -9,7 +9,7 @@ export function containsLineItemWithPartType(typeToFind, itemsToSearch) {
export function findLineItemsWithPartType(typeToFind, itemsToSearch) { export function findLineItemsWithPartType(typeToFind, itemsToSearch) {
const partTypeMatches = itemsToSearch?.filter( const partTypeMatches = itemsToSearch?.filter(
(lineItem) => lineItem.partType.toUpperCase() === typeToFind.toUpperCase(), (lineItem) => lineItem.partType.toUpperCase() === typeToFind.toUpperCase()
); );
return partTypeMatches; return partTypeMatches;
} }
@ -26,7 +26,7 @@ export function getVapsLineItems(availableLineItems, vapTypes) {
export function containsGlassPieceWithLocation(locationToFind, glassPiecesToSearch) { export function containsGlassPieceWithLocation(locationToFind, glassPiecesToSearch) {
const glassLocationMatches = glassPiecesToSearch?.filter( const glassLocationMatches = glassPiecesToSearch?.filter(
(glassPiece) => glassPiece.glassLocation.toUpperCase() === locationToFind.toUpperCase(), (glassPiece) => glassPiece.glassLocation.toUpperCase() === locationToFind.toUpperCase()
); );
return !!glassLocationMatches?.length; return !!glassLocationMatches?.length;
@ -37,21 +37,21 @@ export function getAvailablePackages(glassToReplace, availableLineItems, isRepai
glassToReplace, glassToReplace,
availableLineItems, availableLineItems,
isRepair, isRepair,
packageNames.TIER_ONE, packageNames.TIER_ONE
); );
let tierTwoVaps = getPackageContents( let tierTwoVaps = getPackageContents(
glassToReplace, glassToReplace,
availableLineItems, availableLineItems,
isRepair, isRepair,
packageNames.TIER_TWO, packageNames.TIER_TWO
); );
let tierThreeVaps = getPackageContents( let tierThreeVaps = getPackageContents(
glassToReplace, glassToReplace,
availableLineItems, availableLineItems,
isRepair, isRepair,
packageNames.TIER_THREE, packageNames.TIER_THREE
); );
if (tierTwoVaps.length === 0) { if (tierTwoVaps.length === 0) {
@ -105,11 +105,11 @@ export function shouldFrontWipersBeAvailable(
glassToReplace, glassToReplace,
availableLineItems, availableLineItems,
isRepair, isRepair,
targetTier, targetTier
) { ) {
const frontWiperIsAvailable = containsLineItemWithPartType( const frontWiperIsAvailable = containsLineItemWithPartType(
partTypeStrings.FRONT_WIPER, partTypeStrings.FRONT_WIPER,
availableLineItems, availableLineItems
); );
const isFrontWindshieldTask = const isFrontWindshieldTask =
@ -129,19 +129,19 @@ export function shouldRearWipersBeAvailable(
glassToReplace, glassToReplace,
availableLineItems, availableLineItems,
isRepair, isRepair,
targetTier, targetTier
) { ) {
const rearWiperIsAvailable = containsLineItemWithPartType( const rearWiperIsAvailable = containsLineItemWithPartType(
partTypeStrings.REAR_WIPER, partTypeStrings.REAR_WIPER,
availableLineItems, availableLineItems
); );
const frontWiperIsAvailable = containsLineItemWithPartType( const frontWiperIsAvailable = containsLineItemWithPartType(
partTypeStrings.FRONT_WIPER, partTypeStrings.FRONT_WIPER,
availableLineItems, availableLineItems
); );
const isRearWindshieldTask = containsGlassPieceWithLocation( const isRearWindshieldTask = containsGlassPieceWithLocation(
glassLocations.REAR, glassLocations.REAR,
glassToReplace, glassToReplace
); );
switch (targetTier) { switch (targetTier) {
@ -158,26 +158,26 @@ export function shouldRainDefenseBeAvailable(
glassToReplace, glassToReplace,
availableLineItems, availableLineItems,
isRepair, isRepair,
targetTier, targetTier
) { ) {
const isTierThree = targetTier === packageNames.TIER_THREE; const isTierThree = targetTier === packageNames.TIER_THREE;
const frontWipersInTierTwo = shouldFrontWipersBeAvailable( const frontWipersInTierTwo = shouldFrontWipersBeAvailable(
glassToReplace, glassToReplace,
availableLineItems, availableLineItems,
isRepair, isRepair,
packageNames.TIER_TWO, packageNames.TIER_TWO
); );
const frontWipersInTierThree = shouldFrontWipersBeAvailable( const frontWipersInTierThree = shouldFrontWipersBeAvailable(
glassToReplace, glassToReplace,
availableLineItems, availableLineItems,
isRepair, isRepair,
packageNames.TIER_THREE, packageNames.TIER_THREE
); );
const rearWipersInTierTwo = shouldRearWipersBeAvailable( const rearWipersInTierTwo = shouldRearWipersBeAvailable(
glassToReplace, glassToReplace,
availableLineItems, availableLineItems,
isRepair, isRepair,
packageNames.TIER_TWO, packageNames.TIER_TWO
); );
return isTierThree && !(rearWipersInTierTwo && !frontWipersInTierTwo && frontWipersInTierThree); return isTierThree && !(rearWipersInTierTwo && !frontWipersInTierTwo && frontWipersInTierThree);
@ -203,7 +203,7 @@ export function getHighestRequiredTier(glassToReplace, availableLineItems, isRep
glassToReplace, glassToReplace,
availableLineItems, availableLineItems,
isRepair, isRepair,
vaps[i].partType, vaps[i].partType
); );
currentHighestTier = maxTier(currentHighestTier, lowestTierForItem); currentHighestTier = maxTier(currentHighestTier, lowestTierForItem);

View file

@ -223,7 +223,7 @@ describe("service-package-helper.js", () => {
// Act // Act
const result = servicePackageHelper.containsGlassPieceWithLocation( const result = servicePackageHelper.containsGlassPieceWithLocation(
locationName, locationName,
locations, locations
); );
// Assert // Assert
@ -239,7 +239,7 @@ describe("service-package-helper.js", () => {
// Act // Act
const result = servicePackageHelper.containsGlassPieceWithLocation( const result = servicePackageHelper.containsGlassPieceWithLocation(
locationName, locationName,
locations, locations
); );
// Assert // Assert
@ -255,7 +255,7 @@ describe("service-package-helper.js", () => {
// Act // Act
const result = servicePackageHelper.containsGlassPieceWithLocation( const result = servicePackageHelper.containsGlassPieceWithLocation(
locationName, locationName,
locations, locations
); );
// Assert // Assert
@ -271,7 +271,7 @@ describe("service-package-helper.js", () => {
// Act // Act
const result = servicePackageHelper.containsGlassPieceWithLocation( const result = servicePackageHelper.containsGlassPieceWithLocation(
locationName, locationName,
locations, locations
); );
// Assert // Assert
@ -287,7 +287,7 @@ describe("service-package-helper.js", () => {
// Act // Act
const result = servicePackageHelper.containsGlassPieceWithLocation( const result = servicePackageHelper.containsGlassPieceWithLocation(
locationName, locationName,
locations, locations
); );
// Assert // Assert
@ -306,7 +306,7 @@ describe("service-package-helper.js", () => {
const results = servicePackageHelper.getAvailablePackages( const results = servicePackageHelper.getAvailablePackages(
damageLocations, damageLocations,
availableLineItems, availableLineItems,
false, false
); );
// Assert // Assert
@ -329,7 +329,7 @@ describe("service-package-helper.js", () => {
const results = servicePackageHelper.getAvailablePackages( const results = servicePackageHelper.getAvailablePackages(
damageLocations, damageLocations,
availableLineItems, availableLineItems,
true, true
); );
// Assert // Assert
@ -358,13 +358,13 @@ describe("service-package-helper.js", () => {
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
packageNames.TIER_TWO, packageNames.TIER_TWO
); );
const resultThree = servicePackageHelper.shouldFrontWipersBeAvailable( const resultThree = servicePackageHelper.shouldFrontWipersBeAvailable(
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
packageNames.TIER_THREE, packageNames.TIER_THREE
); );
// Assert // Assert
@ -383,13 +383,13 @@ describe("service-package-helper.js", () => {
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
packageNames.TIER_TWO, packageNames.TIER_TWO
); );
const resultThree = servicePackageHelper.shouldFrontWipersBeAvailable( const resultThree = servicePackageHelper.shouldFrontWipersBeAvailable(
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
packageNames.TIER_THREE, packageNames.TIER_THREE
); );
// Assert // Assert
@ -408,7 +408,7 @@ describe("service-package-helper.js", () => {
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
packageNames.TIER_TWO, packageNames.TIER_TWO
); );
// Assert // Assert
@ -426,7 +426,7 @@ describe("service-package-helper.js", () => {
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
packageNames.TIER_THREE, packageNames.TIER_THREE
); );
// Assert // Assert
@ -444,19 +444,19 @@ describe("service-package-helper.js", () => {
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
packageNames.TIER_ONE, packageNames.TIER_ONE
); );
const resultTwo = servicePackageHelper.shouldFrontWipersBeAvailable( const resultTwo = servicePackageHelper.shouldFrontWipersBeAvailable(
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
packageNames.TIER_TWO, packageNames.TIER_TWO
); );
const resultThree = servicePackageHelper.shouldFrontWipersBeAvailable( const resultThree = servicePackageHelper.shouldFrontWipersBeAvailable(
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
packageNames.TIER_THREE, packageNames.TIER_THREE
); );
// Assert // Assert
@ -476,7 +476,7 @@ describe("service-package-helper.js", () => {
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
packageNames.TIER_ONE, packageNames.TIER_ONE
); );
// Assert // Assert
@ -496,13 +496,13 @@ describe("service-package-helper.js", () => {
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
packageNames.TIER_TWO, packageNames.TIER_TWO
); );
const resultThree = servicePackageHelper.shouldRearWipersBeAvailable( const resultThree = servicePackageHelper.shouldRearWipersBeAvailable(
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
packageNames.TIER_THREE, packageNames.TIER_THREE
); );
// Assert // Assert
@ -521,7 +521,7 @@ describe("service-package-helper.js", () => {
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
packageNames.TIER_TWO, packageNames.TIER_TWO
); );
// Assert // Assert
@ -539,7 +539,7 @@ describe("service-package-helper.js", () => {
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
packageNames.TIER_THREE, packageNames.TIER_THREE
); );
// Assert // Assert
@ -561,7 +561,7 @@ describe("service-package-helper.js", () => {
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
packageNames.TIER_THREE, packageNames.TIER_THREE
); );
// Assert // Assert
@ -579,19 +579,19 @@ describe("service-package-helper.js", () => {
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
packageNames.TIER_ONE, packageNames.TIER_ONE
); );
const resultTwo = servicePackageHelper.shouldRearWipersBeAvailable( const resultTwo = servicePackageHelper.shouldRearWipersBeAvailable(
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
packageNames.TIER_TWO, packageNames.TIER_TWO
); );
const resultThree = servicePackageHelper.shouldRearWipersBeAvailable( const resultThree = servicePackageHelper.shouldRearWipersBeAvailable(
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
packageNames.TIER_THREE, packageNames.TIER_THREE
); );
// Assert // Assert
@ -611,7 +611,7 @@ describe("service-package-helper.js", () => {
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
packageNames.TIER_ONE, packageNames.TIER_ONE
); );
// Assert // Assert
@ -636,19 +636,19 @@ describe("service-package-helper.js", () => {
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
packageNames.TIER_ONE, packageNames.TIER_ONE
); );
const resultTwo = servicePackageHelper.shouldRainDefenseBeAvailable( const resultTwo = servicePackageHelper.shouldRainDefenseBeAvailable(
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
packageNames.TIER_TWO, packageNames.TIER_TWO
); );
const resultThree = servicePackageHelper.shouldRainDefenseBeAvailable( const resultThree = servicePackageHelper.shouldRainDefenseBeAvailable(
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
packageNames.TIER_THREE, packageNames.TIER_THREE
); );
// Assert // Assert
@ -675,7 +675,7 @@ describe("service-package-helper.js", () => {
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
packageNames.TIER_THREE, packageNames.TIER_THREE
); );
// Assert // Assert
@ -702,7 +702,7 @@ describe("service-package-helper.js", () => {
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
partTypeStrings.RAIN_DEFENSE, partTypeStrings.RAIN_DEFENSE
); );
// Assert // Assert
@ -727,13 +727,13 @@ describe("service-package-helper.js", () => {
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
partTypeStrings.FRONT_WIPER, partTypeStrings.FRONT_WIPER
); );
const resultRear = servicePackageHelper.getLowestTierForType( const resultRear = servicePackageHelper.getLowestTierForType(
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
partTypeStrings.REAR_WIPER, partTypeStrings.REAR_WIPER
); );
// Assert // Assert
@ -758,7 +758,7 @@ describe("service-package-helper.js", () => {
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
partTypeStrings.RAIN_DEFENSE, partTypeStrings.RAIN_DEFENSE
); );
// Assert // Assert
@ -788,7 +788,7 @@ describe("service-package-helper.js", () => {
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
vaps, vaps
); );
// Assert // Assert
@ -812,7 +812,7 @@ describe("service-package-helper.js", () => {
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
vaps, vaps
); );
// Assert // Assert
@ -836,7 +836,7 @@ describe("service-package-helper.js", () => {
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
vaps, vaps
); );
// Assert // Assert
@ -860,7 +860,7 @@ describe("service-package-helper.js", () => {
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
vaps, vaps
); );
// Assert // Assert
@ -891,7 +891,7 @@ describe("service-package-helper.js", () => {
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
vaps, vaps
); );
// Assert // Assert
@ -915,7 +915,7 @@ describe("service-package-helper.js", () => {
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
vaps, vaps
); );
// Assert // Assert
@ -939,7 +939,7 @@ describe("service-package-helper.js", () => {
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
vaps, vaps
); );
// Assert // Assert
@ -963,7 +963,7 @@ describe("service-package-helper.js", () => {
damageLocations, damageLocations,
availableLineItems, availableLineItems,
isRepair, isRepair,
vaps, vaps
); );
// Assert // Assert

View file

@ -118,7 +118,7 @@ export function getMockOrderInfo(
mockReferralDate, mockReferralDate,
parentAccountNumber = "0", parentAccountNumber = "0",
savedSessionId, savedSessionId,
crmCustomerId, crmCustomerId
) { ) {
return { return {
referralNumber: mockReferralNumber, referralNumber: mockReferralNumber,

View file

@ -97,7 +97,7 @@ describe("address-lookup.vue", () => {
// Assert // Assert
expect(wrapper.findComponent({ ref: "alertMatchedDifferentVehicle" }).isVisible()).toBe( expect(wrapper.findComponent({ ref: "alertMatchedDifferentVehicle" }).isVisible()).toBe(
true, true
); );
}); });
@ -145,9 +145,7 @@ describe("address-lookup.vue", () => {
// Assert // Assert
expect( expect(
wrapper wrapper.findComponent({ ref: "alertVinLookupsByHomeAddressNotAllowed" }).isVisible()
.findComponent({ ref: "alertVinLookupsByHomeAddressNotAllowed" })
.isVisible(),
).toBe(true); ).toBe(true);
}); });
@ -298,7 +296,7 @@ describe("address-lookup.vue", () => {
undefined, undefined,
{}, {},
{}, {},
carsFound, carsFound
); );
}); });
@ -386,7 +384,7 @@ describe("address-lookup.vue", () => {
navigationScenarios.SELECTED_VIN_WITH_MISMATCHED_GLASS, navigationScenarios.SELECTED_VIN_WITH_MISMATCHED_GLASS,
undefined, undefined,
{}, {},
{ displayVehicleChangeAlert: true }, { displayVehicleChangeAlert: true }
); );
}); });
@ -482,7 +480,7 @@ describe("address-lookup.vue", () => {
licenseZip: "43215", licenseZip: "43215",
}, },
"address-lookup", "address-lookup",
false, false
); );
expect(wrapper.vm.dispatchStoreActionWithLogging).toHaveBeenCalledWith( expect(wrapper.vm.dispatchStoreActionWithLogging).toHaveBeenCalledWith(
@ -490,7 +488,7 @@ describe("address-lookup.vue", () => {
{ {
zip: "43215", zip: "43215",
}, },
"address-lookup", "address-lookup"
); );
}); });
}); });
@ -527,7 +525,7 @@ describe("address-lookup.vue", () => {
}); });
expect(wrapper.findComponent({ ref: "alertNonServiceableZip" }).exists()).toBe( expect(wrapper.findComponent({ ref: "alertNonServiceableZip" }).exists()).toBe(
false, false
); );
// Act // Act
@ -536,10 +534,10 @@ describe("address-lookup.vue", () => {
// Assert // Assert
expect(wrapper.vm.displayNonServiceableZipAlert).toBe(true); expect(wrapper.vm.displayNonServiceableZipAlert).toBe(true);
expect(wrapper.findComponent({ ref: "alertNonServiceableZip" }).exists()).toBe( expect(wrapper.findComponent({ ref: "alertNonServiceableZip" }).exists()).toBe(
true, true
); );
expect(wrapper.findComponent({ ref: "alertNonServiceableZip" }).isVisible()).toBe( expect(wrapper.findComponent({ ref: "alertNonServiceableZip" }).isVisible()).toBe(
true, true
); );
}); });
@ -570,7 +568,7 @@ describe("address-lookup.vue", () => {
//FIX THIS //FIX THIS
// Assert // Assert
expect(wrapper.vm.dispatchStoreAction).not.toHaveBeenCalledWith( expect(wrapper.vm.dispatchStoreAction).not.toHaveBeenCalledWith(
storeActions.UPDATE_SERVICE_LOCATION_WITH_VEHICLE_REGISTRATION, storeActions.UPDATE_SERVICE_LOCATION_WITH_VEHICLE_REGISTRATION
); );
}); });
@ -634,7 +632,7 @@ describe("address-lookup.vue", () => {
// // Assert // // Assert
expect(wrapper.vm.$store.getters.order.serviceLocation.zipCode).not.toEqual( expect(wrapper.vm.$store.getters.order.serviceLocation.zipCode).not.toEqual(
wrapper.vm.$store.getters.vehicle.registration.zipCode, wrapper.vm.$store.getters.vehicle.registration.zipCode
); );
expect(wrapper.vm.$store.getters.vehicle.registration.zipCode).toEqual("12345"); expect(wrapper.vm.$store.getters.vehicle.registration.zipCode).toEqual("12345");
expect(wrapper.vm.$store.getters.order.serviceLocation.zipCode).toEqual("11111"); expect(wrapper.vm.$store.getters.order.serviceLocation.zipCode).toEqual("11111");
@ -723,7 +721,7 @@ function setupMocks({
}, },
}, },
mixins: [mockMixin], mixins: [mockMixin],
}), })
); );
const apiResponses = { const apiResponses = {

View file

@ -127,7 +127,7 @@ import vinPagesMixin from "@/mixins/vin-pages-mixin";
defineRule("service-zip-required", required(errorMessages.SERVICE_ZIP_REQUIRED)); defineRule("service-zip-required", required(errorMessages.SERVICE_ZIP_REQUIRED));
defineRule( defineRule(
"service-zip-format", "service-zip-format",
regex(/(^\d{5}$)|(^\d{5}-\d{4}$)/, errorMessages.SERVICE_ZIP_FORMAT), regex(/(^\d{5}$)|(^\d{5}-\d{4}$)/, errorMessages.SERVICE_ZIP_FORMAT)
); );
export default { export default {
@ -196,7 +196,7 @@ export default {
this.$route.query[this.queryStrings.FMG_PAGE], this.$route.query[this.queryStrings.FMG_PAGE],
this.GaActions.SUBMITTED, this.GaActions.SUBMITTED,
this.GaLabels.ADDRESS_LOOKUP, this.GaLabels.ADDRESS_LOOKUP,
true, true
); );
}); });
}, },
@ -239,7 +239,7 @@ export default {
licenseState: this.customerQuestions.addressQuestions.state, licenseState: this.customerQuestions.addressQuestions.state,
}, },
"address-lookup", "address-lookup",
false, false
); );
// Settle promises and get results // Settle promises and get results
@ -256,14 +256,14 @@ export default {
{ {
zip: this.serviceZipCode, zip: this.serviceZipCode,
}, },
"address-lookup", "address-lookup"
) )
: this.dispatchStoreActionWithLogging( : this.dispatchStoreActionWithLogging(
storeActions.VALIDATE_ZIP, storeActions.VALIDATE_ZIP,
{ {
zip: this.customerQuestions.addressQuestions.zipCode, zip: this.customerQuestions.addressQuestions.zipCode,
}, },
"address-lookup", "address-lookup"
), ),
}, },
]; ];
@ -300,12 +300,12 @@ export default {
this.isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId( this.isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId(
carFound.carId, carFound.carId,
"address-lookup", "address-lookup"
); );
// Update button "Continue with..." // Update button "Continue with..."
this.$refs.navbar.updateButtonText( this.$refs.navbar.updateButtonText(
`Continue with ${carFound.year} ${carFound.make} ${carFound.model}`, `Continue with ${carFound.year} ${carFound.make} ${carFound.model}`
); );
return this.$refs.navbar.removeLoader(); return this.$refs.navbar.removeLoader();
} }
@ -316,7 +316,7 @@ export default {
// If multiple cars were found and one and only one of them matches the carId entered, save the vehicle info // If multiple cars were found and one and only one of them matches the carId entered, save the vehicle info
// so we can go to the Heritage Funnel directly // so we can go to the Heritage Funnel directly
const matchingCars = carsFound.filter( const matchingCars = carsFound.filter(
(vin) => vin.vehicle.carId === this.$store.getters.vehicle.carId, (vin) => vin.vehicle.carId === this.$store.getters.vehicle.carId
); );
if (matchingCars.length === 1) { if (matchingCars.length === 1) {
@ -358,13 +358,13 @@ export default {
lastName: this.customerQuestions.lastName, lastName: this.customerQuestions.lastName,
}, },
}, },
false, false
); );
await this.dispatchStoreAction( await this.dispatchStoreAction(
storeActions.SAVE_EMAIL, storeActions.SAVE_EMAIL,
this.customerQuestions.emailAddress, this.customerQuestions.emailAddress,
false, false
); );
await this.dispatchStoreAction( await this.dispatchStoreAction(
storeActions.SAVE_SERVICE_ZIP_CODE_INFO, storeActions.SAVE_SERVICE_ZIP_CODE_INFO,
@ -373,7 +373,7 @@ export default {
zipCode: this.serviceZipCode, zipCode: this.serviceZipCode,
zipCodeCtu: resultMap.serviceZipValidationResponse.zipCodeCtu, zipCodeCtu: resultMap.serviceZipValidationResponse.zipCodeCtu,
}, },
false, false
); );
return await this.navigateForward(carsFound); return await this.navigateForward(carsFound);
@ -381,7 +381,7 @@ export default {
async navigateForward(carsFound) { async navigateForward(carsFound) {
// Match vehicles found to vehicles in state. // Match vehicles found to vehicles in state.
const matchingCars = carsFound.filter( const matchingCars = carsFound.filter(
(car) => car.vehicle.carId === this.$store.getters.vehicle.carId, (car) => car.vehicle.carId === this.$store.getters.vehicle.carId
); );
// If a different vehicle is found than the one entered and the selected glass is not available for that vehicle then navigate back to "vehicle-damage" // If a different vehicle is found than the one entered and the selected glass is not available for that vehicle then navigate back to "vehicle-damage"
@ -395,7 +395,7 @@ export default {
this.navigationScenarios.SELECTED_VIN_WITH_MISMATCHED_GLASS, this.navigationScenarios.SELECTED_VIN_WITH_MISMATCHED_GLASS,
this.$route, this.$route,
{}, {},
{ [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: true }, { [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: true }
); );
} else if (matchingCars.length === 1) { } else if (matchingCars.length === 1) {
await this.navigateForwardWithSingleCarMatch(); await this.navigateForwardWithSingleCarMatch();
@ -405,7 +405,7 @@ export default {
this.$route, this.$route,
{}, {},
{}, {},
carsFound, carsFound
); );
} }
}, },
@ -426,7 +426,7 @@ export default {
: this.customerQuestions.addressQuestions.zipCode; : this.customerQuestions.addressQuestions.zipCode;
const text = this.getCmsContent( const text = this.getCmsContent(
"AlertNonServiceableZipWidget", "AlertNonServiceableZipWidget",
"HeadlineText", "HeadlineText"
).replaceAll("{custom:serviceZip}", zipCode); ).replaceAll("{custom:serviceZip}", zipCode);
return text; return text;
}, },
@ -436,7 +436,7 @@ export default {
AlertMatchedDifferentVehicleHeader() { AlertMatchedDifferentVehicleHeader() {
return this.getCmsContent( return this.getCmsContent(
"AlertMatchedDifferentVehicleWidget", "AlertMatchedDifferentVehicleWidget",
"HeadlineText", "HeadlineText"
).replaceAll("{custom:glassText}", getDamageString()); ).replaceAll("{custom:glassText}", getDamageString());
}, },
AlertMatchedDifferentVehicleBody() { AlertMatchedDifferentVehicleBody() {
@ -454,7 +454,7 @@ export default {
handler(newValue) { handler(newValue) {
// if they modify one of the lookup fields (address, city, state, zipCode, or lastName), then modify the button text back to "Get my personalized quote" // if they modify one of the lookup fields (address, city, state, zipCode, or lastName), then modify the button text back to "Get my personalized quote"
this.$refs.navbar.updateButtonText( this.$refs.navbar.updateButtonText(
this.getCmsContent("FunnelFooterWidget", "ForwardButtonText"), this.getCmsContent("FunnelFooterWidget", "ForwardButtonText")
); );
this.showServiceZipField = false; this.showServiceZipField = false;
this.resetWarningsAndErrors(); this.resetWarningsAndErrors();

View file

@ -61,8 +61,8 @@ defineRule(
"email-address-format", "email-address-format",
regex( regex(
/^([a-zA-Z0-9_\-.+]+)@([a-zA-Z0-9-]+)\.([a-zA-Z]{2,})$/, /^([a-zA-Z0-9_\-.+]+)@([a-zA-Z0-9-]+)\.([a-zA-Z]{2,})$/,
errorMessages.EMAIL_ADDRESS_FORMAT, errorMessages.EMAIL_ADDRESS_FORMAT
), )
); );
export default { export default {

View file

@ -40,7 +40,7 @@ export default {
differentVehicleAlertHeader() { differentVehicleAlertHeader() {
return this.getCmsContent("FoundWindshield", "HeadlineText").replaceAll( return this.getCmsContent("FoundWindshield", "HeadlineText").replaceAll(
"{custom:damage}", "{custom:damage}",
getDamageString(), getDamageString()
); );
}, },
differentVehicleAlertBody() { differentVehicleAlertBody() {

View file

@ -121,7 +121,7 @@ export default {
AlertFoundMultipleVehiclesHeader() { AlertFoundMultipleVehiclesHeader() {
return this.getCmsContent("FoundMultipleVehicles", "HeadlineText").replaceAll( return this.getCmsContent("FoundMultipleVehicles", "HeadlineText").replaceAll(
"{custom:vehicleCount}", "{custom:vehicleCount}",
this.vehicleCount, this.vehicleCount
); );
}, },
AlertProvideVinBody() { AlertProvideVinBody() {
@ -179,7 +179,7 @@ export default {
{ {
vin: this.selectedVehicle.vin, vin: this.selectedVehicle.vin,
}, },
"address-vehicles", "address-vehicles"
).catch(() => { ).catch(() => {
this.$refs.navbar.removeLoader(); this.$refs.navbar.removeLoader();
}); });
@ -190,7 +190,7 @@ export default {
this.isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId( this.isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId(
vinLookup.data.carId, vinLookup.data.carId,
"address-vehicles", "address-vehicles"
); );
await this.dispatchStoreAction( await this.dispatchStoreAction(
@ -201,7 +201,7 @@ export default {
}), }),
isSelectedGlassAvailableForVehicle: this.isSelectedGlassAvailableForVehicle, isSelectedGlassAvailableForVehicle: this.isSelectedGlassAvailableForVehicle,
}, },
false, false
); );
return await this.navigateForward(); return await this.navigateForward();
@ -212,7 +212,7 @@ export default {
this.navigationScenarios.CLICKED_FORWARD, this.navigationScenarios.CLICKED_FORWARD,
this.$route, this.$route,
{}, {},
{ [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: true }, { [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: true }
); );
} else { } else {
await this.navigateForwardWithSingleCarMatch(); await this.navigateForwardWithSingleCarMatch();
@ -228,11 +228,11 @@ export default {
this.selectedVehicle?.vehicle.carId !== store.getters.vehicle.carId; this.selectedVehicle?.vehicle.carId !== store.getters.vehicle.carId;
if (this.isCarIdDifferent) { if (this.isCarIdDifferent) {
this.$refs.navbar.updateButtonText( this.$refs.navbar.updateButtonText(
`Continue with ${this.selectedVehicle.vehicle.year} ${this.selectedVehicle.vehicle.make} ${this.selectedVehicle.vehicle.model}`, `Continue with ${this.selectedVehicle.vehicle.year} ${this.selectedVehicle.vehicle.make} ${this.selectedVehicle.vehicle.model}`
); );
} else { } else {
this.$refs.navbar.updateButtonText( this.$refs.navbar.updateButtonText(
this.getCmsContent("FunnelFooterWidget", "ForwardButtonText"), this.getCmsContent("FunnelFooterWidget", "ForwardButtonText")
); );
} }
}, },

View file

@ -24,7 +24,7 @@ jest.mock(
() => { () => {
return {}; return {};
}, },
{ virtual: true }, { virtual: true }
); );
jest.mock("@/helpers/heritage-integration/navigation-helper", () => ({ jest.mock("@/helpers/heritage-integration/navigation-helper", () => ({
@ -305,7 +305,7 @@ describe("capabilityQuestions.vue", () => {
result2: undefined, result2: undefined,
}, },
], ],
false, false
); );
wrapper.unmount(); wrapper.unmount();
@ -354,7 +354,7 @@ describe("capabilityQuestions.vue", () => {
"getPartFromCapabilityQuestionAnswer", "getPartFromCapabilityQuestionAnswer",
"Windshield", "Windshield",
"capability-questions", "capability-questions",
false, false
); );
wrapper.unmount(); wrapper.unmount();

View file

@ -84,13 +84,13 @@ export default {
methods: { methods: {
arePagePrerequisitesValid() { arePagePrerequisitesValid() {
const capabilityQuestionsPageData = store.getters.pageData( const capabilityQuestionsPageData = store.getters.pageData(
fmgPageValues.CAPABILITY_QUESTIONS, fmgPageValues.CAPABILITY_QUESTIONS
); );
return ( return (
// has capabilityQuestions array and has glassName not null // has capabilityQuestions array and has glassName not null
capabilityQuestionsPageData?.partsOrQuestions?.some((part) => part?.glassName) && capabilityQuestionsPageData?.partsOrQuestions?.some((part) => part?.glassName) &&
capabilityQuestionsPageData?.partsOrQuestions?.some( capabilityQuestionsPageData?.partsOrQuestions?.some(
(part) => part?.capabilityQuestions?.length > 0, (part) => part?.capabilityQuestions?.length > 0
) )
); );
}, },
@ -110,7 +110,7 @@ export default {
const updatedGlass = this.setupInitialData( const updatedGlass = this.setupInitialData(
glass, glass,
index, index,
alreadyAnsweredQuestions, alreadyAnsweredQuestions
); );
// Set up watch for each set of glass questions // Set up watch for each set of glass questions
@ -121,7 +121,7 @@ export default {
this.handleCompletedQuestionChainAnswers(newValue, glass.answerKey); this.handleCompletedQuestionChainAnswers(newValue, glass.answerKey);
} }
}, },
{ deep: true }, { deep: true }
); );
return updatedGlass; return updatedGlass;
@ -130,7 +130,7 @@ export default {
// if no preanswered questions then make sure index starts with the correct value // if no preanswered questions then make sure index starts with the correct value
this.currentGlassIndex = this.calculateQuestionIndex( this.currentGlassIndex = this.calculateQuestionIndex(
this.currentGlassIndex, this.currentGlassIndex,
this.questionsData, this.questionsData
); );
}, },
async forwardButtonAction() { async forwardButtonAction() {
@ -139,7 +139,7 @@ export default {
let selectedAnswerResult2; let selectedAnswerResult2;
glass.questions.forEach((q) => { glass.questions.forEach((q) => {
const idx = q.answers.findIndex( const idx = q.answers.findIndex(
(a) => a.answerResult === glass.answerData.answerResult, (a) => a.answerResult === glass.answerData.answerResult
); );
if (idx !== -1) { if (idx !== -1) {
selectedAnswerResult2 = q.answers[idx].answerResult2; selectedAnswerResult2 = q.answers[idx].answerResult2;
@ -167,7 +167,7 @@ export default {
await this.dispatchStoreAction( await this.dispatchStoreAction(
this.storeActions.SAVE_CAPABILITY_QUESTION_ANSWERS, this.storeActions.SAVE_CAPABILITY_QUESTION_ANSWERS,
questionAnswersArray, questionAnswersArray,
false, false
); );
// get parts from the capabilityQuestionAnswers // get parts from the capabilityQuestionAnswers
@ -178,12 +178,12 @@ export default {
this.storeActions.GET_PART_FROM_CAPABILITY_QUESTION_ANSWER, this.storeActions.GET_PART_FROM_CAPABILITY_QUESTION_ANSWER,
answer.glassLocation, answer.glassLocation,
"capability-questions", "capability-questions",
false, false
) )
).data; ).data;
partsOrQuestions.find( partsOrQuestions.find(
(partOrQuestion) => partOrQuestion.glassLocation === answer.glassLocation, (partOrQuestion) => partOrQuestion.glassLocation === answer.glassLocation
).parts = partFromCapabilityQuestionAnswer; ).parts = partFromCapabilityQuestionAnswer;
} }

View file

@ -140,7 +140,7 @@ export default {
location = this.serviceLocationFullAddress?.replace("<br/>", ""); location = this.serviceLocationFullAddress?.replace("<br/>", "");
subject = this.AddToCalendar_Mobile_Subject?.replace( subject = this.AddToCalendar_Mobile_Subject?.replace(
"{custom:SERVICETYPE}", "{custom:SERVICETYPE}",
this.ServiceType, this.ServiceType
); );
body = this.AddToCalendar_Mobile_Body; body = this.AddToCalendar_Mobile_Body;
} else { } else {
@ -158,28 +158,28 @@ export default {
endDateTime = addMinutes(startDateTime, 120); endDateTime = addMinutes(startDateTime, 120);
subject = this.AddToCalendar_AllDayDropOff_Subject?.replace( subject = this.AddToCalendar_AllDayDropOff_Subject?.replace(
"{custom:STARTDATETIME}", "{custom:STARTDATETIME}",
shortTimeString(startDateTime), shortTimeString(startDateTime)
).replace("{custom:ENDDATETIME}", shortTimeString(endDateTime)); ).replace("{custom:ENDDATETIME}", shortTimeString(endDateTime));
body = this.AddToCalendar_AllDayDropOff_Body?.replace( body = this.AddToCalendar_AllDayDropOff_Body?.replace(
"{custom:ENDDATETIME}", "{custom:ENDDATETIME}",
shortTimeString(endDateTime), shortTimeString(endDateTime)
); );
} }
} //normal time slot } //normal time slot
else { else {
subject = this.AddToCalendar_DropOff_Subject?.replace( subject = this.AddToCalendar_DropOff_Subject?.replace(
"{custom:SERVICETYPE}", "{custom:SERVICETYPE}",
this.ServiceType, this.ServiceType
); );
body = this.AddToCalendar_DropOff_Body?.replace( body = this.AddToCalendar_DropOff_Body?.replace(
"{custom:ADDRESS}", "{custom:ADDRESS}",
location, location
); );
} }
} else { } else {
subject = this.AddToCalendar_InShop_Subject?.replace( subject = this.AddToCalendar_InShop_Subject?.replace(
"{custom:SERVICETYPE}", "{custom:SERVICETYPE}",
this.ServiceType, this.ServiceType
); );
body = this.AddToCalendar_InShop_Body?.replace("{custom:ADDRESS}", location); body = this.AddToCalendar_InShop_Body?.replace("{custom:ADDRESS}", location);
} }
@ -229,33 +229,33 @@ export default {
const outlookComTimeSpanFormat = "yyyy-MM-ddTHH:mm:ss"; const outlookComTimeSpanFormat = "yyyy-MM-ddTHH:mm:ss";
if (type == calendarOptions.OUTLOOKCOM) { if (type == calendarOptions.OUTLOOKCOM) {
URL = `${applicationConfig.OUTLOOK_CALENDAR}&startdt=${encodeURIComponent( URL = `${applicationConfig.OUTLOOK_CALENDAR}&startdt=${encodeURIComponent(
getDateFormat(this.Appointment.StartDate, outlookComTimeSpanFormat), getDateFormat(this.Appointment.StartDate, outlookComTimeSpanFormat)
)}&enddt=${encodeURIComponent( )}&enddt=${encodeURIComponent(
getDateFormat(this.Appointment.EndDate, outlookComTimeSpanFormat), getDateFormat(this.Appointment.EndDate, outlookComTimeSpanFormat)
)}&subject=${encodeURIComponent( )}&subject=${encodeURIComponent(
this.Appointment.Subject, this.Appointment.Subject
)}&body=${encodeURIComponent(this.Appointment.Body)}&location=${encodeURIComponent( )}&body=${encodeURIComponent(this.Appointment.Body)}&location=${encodeURIComponent(
this.Appointment.Location, this.Appointment.Location
)}`; )}`;
} }
if (type == calendarOptions.GOOGLE) { if (type == calendarOptions.GOOGLE) {
URL = `${applicationConfig.GOOGLE_CALENDAR}&text=${encodeURIComponent( URL = `${applicationConfig.GOOGLE_CALENDAR}&text=${encodeURIComponent(
this.Appointment.Subject, this.Appointment.Subject
)}&dates=${encodeURIComponent( )}&dates=${encodeURIComponent(
getDateFormat(this.Appointment.StartDate, dateFormat), getDateFormat(this.Appointment.StartDate, dateFormat)
)}/${encodeURIComponent( )}/${encodeURIComponent(
getDateFormat(this.Appointment.EndDate, dateFormat), getDateFormat(this.Appointment.EndDate, dateFormat)
)}&details=${encodeURIComponent( )}&details=${encodeURIComponent(
this.Appointment.Body, this.Appointment.Body
)}&location=${encodeURIComponent(this.Appointment.Location)}&sf=true&output=xml`; )}&location=${encodeURIComponent(this.Appointment.Location)}&sf=true&output=xml`;
} }
if (type == calendarOptions.YAHOO) { if (type == calendarOptions.YAHOO) {
URL = `${applicationConfig.YAHOO_CALENDAR}&TITLE=${encodeURIComponent( URL = `${applicationConfig.YAHOO_CALENDAR}&TITLE=${encodeURIComponent(
this.Appointment.Subject, this.Appointment.Subject
)}&DESC=${encodeURIComponent(this.Appointment.Body)}&ST=${encodeURIComponent( )}&DESC=${encodeURIComponent(this.Appointment.Body)}&ST=${encodeURIComponent(
getDateFormat(this.Appointment.StartDate, dateFormat), getDateFormat(this.Appointment.StartDate, dateFormat)
)}&DUR=${this.Appointment.Duration}&in_loc=${encodeURIComponent( )}&DUR=${this.Appointment.Duration}&in_loc=${encodeURIComponent(
this.Appointment.Location, this.Appointment.Location
)}`; )}`;
} }
return { return {

View file

@ -75,7 +75,7 @@ export default {
const { errorMessage, handleChange, meta, validate, errors } = useField( const { errorMessage, handleChange, meta, validate, errors } = useField(
componentId, componentId,
props.validationRules, props.validationRules,
fieldOptions, fieldOptions
); );
return { return {
@ -146,7 +146,7 @@ export default {
getSelectedCalendarObject(calendarOptionId) { getSelectedCalendarObject(calendarOptionId) {
const calendarOption = this.calendarOptionsData?.find( const calendarOption = this.calendarOptionsData?.find(
(calendarOption) => calendarOption.name == calendarOptionId, (calendarOption) => calendarOption.name == calendarOptionId
); );
if (calendarOption) { if (calendarOption) {

View file

@ -120,13 +120,13 @@ export default {
serviceZipCode: store.getters.submittedOrder.serviceLocation.zipCode, serviceZipCode: store.getters.submittedOrder.serviceLocation.zipCode,
carId: store.getters.submittedOrder.vehicle.carId, carId: store.getters.submittedOrder.vehicle.carId,
}, },
"confirmation", "confirmation"
); );
const rainDefensePromise = baseMixin.methods.dispatchStoreActionWithLogging( const rainDefensePromise = baseMixin.methods.dispatchStoreActionWithLogging(
storeActions.GET_RAIN_DEFENSE, storeActions.GET_RAIN_DEFENSE,
null, null,
"confirmation", "confirmation"
); );
// Settle promises and get results // Settle promises and get results
@ -240,17 +240,17 @@ export default {
if (this.AppointmentType == AppointmentTypeStrings.MOBILE) { if (this.AppointmentType == AppointmentTypeStrings.MOBILE) {
return this.MobileWordingText?.replaceAll( return this.MobileWordingText?.replaceAll(
"{custom:ADDRESS}", "{custom:ADDRESS}",
this.ServiceLocationFullAddress, this.ServiceLocationFullAddress
); );
} else if (this.AppointmentType == AppointmentTypeStrings.DROP_OFF) { } else if (this.AppointmentType == AppointmentTypeStrings.DROP_OFF) {
return this.DropOffWordingText?.replaceAll( return this.DropOffWordingText?.replaceAll(
"{custom:ADDRESS}", "{custom:ADDRESS}",
this.ProviderFullAddress, this.ProviderFullAddress
); );
} else { } else {
return this.InShopWordingText?.replaceAll( return this.InShopWordingText?.replaceAll(
"{custom:ADDRESS}", "{custom:ADDRESS}",
this.ProviderFullAddress, this.ProviderFullAddress
); );
} }
}, },
@ -277,7 +277,7 @@ export default {
ScheduleTimeFormatted() { ScheduleTimeFormatted() {
if (this.AppointmentType == AppointmentTypeStrings.MOBILE) { if (this.AppointmentType == AppointmentTypeStrings.MOBILE) {
return `Between ${get12HourTimeMobileFormat( return `Between ${get12HourTimeMobileFormat(
this.ScheduleStartTime, this.ScheduleStartTime
)} - ${get12HourTimeMobileFormat(this.ScheduleEndTime)}`; )} - ${get12HourTimeMobileFormat(this.ScheduleEndTime)}`;
} else if (this.AppointmentType == AppointmentTypeStrings.DROP_OFF) { } else if (this.AppointmentType == AppointmentTypeStrings.DROP_OFF) {
return `Drop off before 9:30 AM`; return `Drop off before 9:30 AM`;
@ -329,19 +329,19 @@ export default {
const durationLengthString = "Duration: "; const durationLengthString = "Duration: ";
if ( if (
store.getters.submittedOrder?.schedule?.routeCode.includes( store.getters.submittedOrder?.schedule?.routeCode.includes(
RouteCodeFlags.ALL_DAY_DROP_OFF, RouteCodeFlags.ALL_DAY_DROP_OFF
) )
) { ) {
return durationLengthString.concat("All Day"); return durationLengthString.concat("All Day");
} else if ( } else if (
store.getters.submittedOrder?.schedule?.routeCode.includes( store.getters.submittedOrder?.schedule?.routeCode.includes(
RouteCodeFlags.OVERNIGHT_DROP_OFF, RouteCodeFlags.OVERNIGHT_DROP_OFF
) )
) { ) {
return durationLengthString.concat("Overnight"); return durationLengthString.concat("Overnight");
} else { } else {
return durationLengthString.concat( return durationLengthString.concat(
getDisplayTextForDurationLength(durationMinimum, durationMaximum), getDisplayTextForDurationLength(durationMinimum, durationMaximum)
); );
} }
}, },

View file

@ -46,7 +46,7 @@ function setupMocks() {
navigateWithSaving: jest.fn(), navigateWithSaving: jest.fn(),
navigateWithoutSaving: jest.fn(), navigateWithoutSaving: jest.fn(),
}, },
}), })
); );
return { wrapper }; return { wrapper };

View file

@ -97,8 +97,8 @@ defineRule(
"email-address-format", "email-address-format",
regex( regex(
/^([a-zA-Z0-9_\-.+]+)@([a-zA-Z0-9-]+)\.([a-zA-Z]{2,})$/, /^([a-zA-Z0-9_\-.+]+)@([a-zA-Z0-9-]+)\.([a-zA-Z]{2,})$/,
errorMessages.EMAIL_ADDRESS_FORMAT, errorMessages.EMAIL_ADDRESS_FORMAT
), )
); );
export default { export default {
@ -172,13 +172,13 @@ export default {
phoneNumber: this.phoneNumber, phoneNumber: this.phoneNumber,
isSmsOptIn: this.isSmsOptIn, isSmsOptIn: this.isSmsOptIn,
}, },
false, false
); );
this.dispatchStoreAction( this.dispatchStoreAction(
this.storeActions.SAVE_SERVICE_LOCATION_TECH_NOTES, this.storeActions.SAVE_SERVICE_LOCATION_TECH_NOTES,
this.techNotes, this.techNotes,
false, false
); );
this.$router.navigateWithSaving(this.navigationScenarios.CLICKED_FORWARD, this.$route); this.$router.navigateWithSaving(this.navigationScenarios.CLICKED_FORWARD, this.$route);

View file

@ -114,7 +114,7 @@ describe("estimate.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "estimate" } }, { query: { fmgPage: "estimate" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
wrapper.vm.backButtonAction(); wrapper.vm.backButtonAction();
@ -232,7 +232,7 @@ describe("estimate.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "estimate" } }, { query: { fmgPage: "estimate" } },
undefined, undefined,
nextFunction, nextFunction
); );
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();

View file

@ -73,8 +73,8 @@ defineRule(
"email-address-format", "email-address-format",
regex( regex(
/^([a-zA-Z0-9_\-.+]+)@([a-zA-Z0-9-]+)\.([a-zA-Z]{2,})$/, /^([a-zA-Z0-9_\-.+]+)@([a-zA-Z0-9-]+)\.([a-zA-Z]{2,})$/,
errorMessages.EMAIL_ADDRESS_FORMAT, errorMessages.EMAIL_ADDRESS_FORMAT
), )
); );
defineRule("option-required", required(errorMessages.OPTION_REQUIRED)); defineRule("option-required", required(errorMessages.OPTION_REQUIRED));
@ -110,7 +110,7 @@ export default {
storeActions.IS_VIN_BY_ADDRESS_PERMISSIBLE, storeActions.IS_VIN_BY_ADDRESS_PERMISSIBLE,
{ zip: zip }, { zip: zip },
"estimate", "estimate",
false, false
); );
} }
@ -138,7 +138,7 @@ export default {
if (!zip || resultMap.vinByAddress === false) { if (!zip || resultMap.vinByAddress === false) {
var indexToRemove = resultMap.cmsContent.VinLookupMethod.Answers.findIndex( var indexToRemove = resultMap.cmsContent.VinLookupMethod.Answers.findIndex(
(answer) => answer.Name === "HomeAddress", (answer) => answer.Name === "HomeAddress"
); );
if (indexToRemove) { if (indexToRemove) {
resultMap.cmsContent.VinLookupMethod.Answers.splice(indexToRemove, 1); resultMap.cmsContent.VinLookupMethod.Answers.splice(indexToRemove, 1);
@ -149,7 +149,7 @@ export default {
if (store.getters.isExternalParameter) { if (store.getters.isExternalParameter) {
if (store.getters.externalParameterEstimate.vinSelection) { if (store.getters.externalParameterEstimate.vinSelection) {
vm.selectedVinLookupMethod = vinPagesMixin.methods.getVinlookupMethod( vm.selectedVinLookupMethod = vinPagesMixin.methods.getVinlookupMethod(
store.getters.externalParameterEstimate.vinSelection, store.getters.externalParameterEstimate.vinSelection
); );
await nextTick(); await nextTick();
const isValid = await baseMixin.methods.isFormValid(vm.$refs.theForm); const isValid = await baseMixin.methods.isFormValid(vm.$refs.theForm);
@ -179,25 +179,25 @@ export default {
await this.dispatchStoreAction(storeActions.CLEAR_VIN); await this.dispatchStoreAction(storeActions.CLEAR_VIN);
return this.$router.navigateWithSaving( return this.$router.navigateWithSaving(
this.navigationScenarios.SELECTED_MANUAL_VIN, this.navigationScenarios.SELECTED_MANUAL_VIN,
this.$route, this.$route
); );
} }
if (this.selectedVinLookupMethod === vinLookupMethodSelections.LICENSEPLATE) { if (this.selectedVinLookupMethod === vinLookupMethodSelections.LICENSEPLATE) {
return this.$router.navigateWithSaving( return this.$router.navigateWithSaving(
this.navigationScenarios.SELECTED_LICENSE_PLATE, this.navigationScenarios.SELECTED_LICENSE_PLATE,
this.$route, this.$route
); );
} }
if (this.selectedVinLookupMethod === vinLookupMethodSelections.HOMEADDRESS) { if (this.selectedVinLookupMethod === vinLookupMethodSelections.HOMEADDRESS) {
return this.$router.navigateWithSaving( return this.$router.navigateWithSaving(
this.navigationScenarios.SELECTED_HOME_ADDRESS, this.navigationScenarios.SELECTED_HOME_ADDRESS,
this.$route, this.$route
); );
} }
if (this.selectedVinLookupMethod === vinLookupMethodSelections.DECLINE) { if (this.selectedVinLookupMethod === vinLookupMethodSelections.DECLINE) {
return this.$router.navigateWithSaving( return this.$router.navigateWithSaving(
this.navigationScenarios.SELECTED_NO_VIN, this.navigationScenarios.SELECTED_NO_VIN,
this.$route, this.$route
); );
} }
}, },

View file

@ -55,7 +55,7 @@ export default {
const insuranceCompanyListPromise = baseMixin.methods.dispatchStoreActionWithLogging( const insuranceCompanyListPromise = baseMixin.methods.dispatchStoreActionWithLogging(
storeActions.GET_INSURANCE_COMPANY_LIST, storeActions.GET_INSURANCE_COMPANY_LIST,
{}, {},
"insurance-company", "insurance-company"
); );
// Settle promises and get results // Settle promises and get results
@ -119,7 +119,7 @@ export default {
await this.dispatchStoreAction( await this.dispatchStoreAction(
this.storeActions.SAVE_PARENT_ACCOUNT_NUMBER, this.storeActions.SAVE_PARENT_ACCOUNT_NUMBER,
this.parentAccountNumber.toString(), this.parentAccountNumber.toString(),
false, false
); );
navigateToHeritageFunnel({ navigateToHeritageFunnel({
shouldSaveSession: true, shouldSaveSession: true,

View file

@ -96,7 +96,7 @@ describe("license-plate-lookup.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "license-plate-lookup" } }, { query: { fmgPage: "license-plate-lookup" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
wrapper.vm.backButtonAction(); wrapper.vm.backButtonAction();
@ -128,7 +128,7 @@ describe("license-plate-lookup.vue", () => {
carId: mockCarId, carId: mockCarId,
}, },
}, },
}), })
); );
//Act //Act
@ -136,7 +136,7 @@ describe("license-plate-lookup.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "license-plate-lookup" } }, { query: { fmgPage: "license-plate-lookup" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
await wrapper.vm.forwardButtonAction(); await wrapper.vm.forwardButtonAction();
@ -165,7 +165,7 @@ describe("license-plate-lookup.vue", () => {
carId: "C00000", // Make sure carId returned from call does not match carId in state. carId: "C00000", // Make sure carId returned from call does not match carId in state.
}, },
}, },
}), })
); );
//Act //Act
@ -173,7 +173,7 @@ describe("license-plate-lookup.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "license-plate-lookup" } }, { query: { fmgPage: "license-plate-lookup" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
await wrapper.vm.forwardButtonAction(); await wrapper.vm.forwardButtonAction();
@ -209,7 +209,7 @@ describe("license-plate-lookup.vue", () => {
carId: "C00000", // Make sure carId returned from call does not match carId in state. carId: "C00000", // Make sure carId returned from call does not match carId in state.
}, },
}, },
}), })
); );
//Act //Act
@ -217,7 +217,7 @@ describe("license-plate-lookup.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "license-plate-lookup" } }, { query: { fmgPage: "license-plate-lookup" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
await wrapper.vm.forwardButtonAction(); await wrapper.vm.forwardButtonAction();
@ -387,7 +387,7 @@ describe("license-plate-lookup.vue", () => {
carId: "C00000", carId: "C00000",
}, },
}, },
}), })
); );
// Act // Act
@ -395,7 +395,7 @@ describe("license-plate-lookup.vue", () => {
// Assert // Assert
expect(wrapper.vm.$store.getters.order.serviceLocation.zipCode).toEqual( expect(wrapper.vm.$store.getters.order.serviceLocation.zipCode).toEqual(
wrapper.vm.$store.getters.vehicle.registration.zipCode, wrapper.vm.$store.getters.vehicle.registration.zipCode
); );
expect(wrapper.vm.$store.getters.vehicle.registration.zipCode).toEqual("12345"); expect(wrapper.vm.$store.getters.vehicle.registration.zipCode).toEqual("12345");
@ -425,7 +425,7 @@ describe("license-plate-lookup.vue", () => {
carId: "C00000", carId: "C00000",
}, },
}, },
}), })
); );
//TODO FIX - test succeeds even if comment out the Act section //TODO FIX - test succeeds even if comment out the Act section
@ -434,7 +434,7 @@ describe("license-plate-lookup.vue", () => {
// Assert // Assert
const serviceZipField = wrapper.findComponent( const serviceZipField = wrapper.findComponent(
"[cmsWidgetName='ServiceZipQuestionWidget']", "[cmsWidgetName='ServiceZipQuestionWidget']"
); );
expect(serviceZipField.exists()).toBe(true); expect(serviceZipField.exists()).toBe(true);
expect(serviceZipField.isVisible()).toBe(true); expect(serviceZipField.isVisible()).toBe(true);
@ -457,7 +457,7 @@ describe("license-plate-lookup.vue", () => {
carId: "C00000", carId: "C00000",
}, },
}, },
}), })
); );
await wrapper.vm.forwardButtonAction(); await wrapper.vm.forwardButtonAction();
@ -470,7 +470,7 @@ describe("license-plate-lookup.vue", () => {
// Assert // Assert
const serviceZipField = wrapper.findComponent( const serviceZipField = wrapper.findComponent(
"[cmsWidgetName='ServiceZipQuestionWidget']", "[cmsWidgetName='ServiceZipQuestionWidget']"
); );
expect(serviceZipField.exists()).toBe(true); expect(serviceZipField.exists()).toBe(true);
expect(serviceZipField.isVisible()).toBe(true); expect(serviceZipField.isVisible()).toBe(true);
@ -507,7 +507,7 @@ describe("license-plate-lookup.vue", () => {
// Assert // Assert
const serviceZipField = wrapper.findComponent( const serviceZipField = wrapper.findComponent(
"[cmsWidgetName='ServiceZipQuestionWidget']", "[cmsWidgetName='ServiceZipQuestionWidget']"
); );
expect(serviceZipField.exists()).toBe(true); expect(serviceZipField.exists()).toBe(true);
expect(serviceZipField.isVisible()).toBe(true); expect(serviceZipField.isVisible()).toBe(true);
@ -582,7 +582,7 @@ describe("license-plate-lookup.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "license-plate-lookup" } }, { query: { fmgPage: "license-plate-lookup" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
let arePagePrerequisitesValid = wrapper.vm.arePagePrerequisitesValid(); let arePagePrerequisitesValid = wrapper.vm.arePagePrerequisitesValid();
@ -601,7 +601,7 @@ describe("license-plate-lookup.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "license-plate-lookup" } }, { query: { fmgPage: "license-plate-lookup" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
let arePagePrerequisitesValid = wrapper.vm.arePagePrerequisitesValid(); let arePagePrerequisitesValid = wrapper.vm.arePagePrerequisitesValid();

View file

@ -125,8 +125,8 @@ defineRule(
"email-address-format", "email-address-format",
regex( regex(
/^([a-zA-Z0-9_\-.+]+)@([a-zA-Z0-9-]+)\.([a-zA-Z]{2,})$/, /^([a-zA-Z0-9_\-.+]+)@([a-zA-Z0-9-]+)\.([a-zA-Z]{2,})$/,
errorMessages.EMAIL_ADDRESS_FORMAT, errorMessages.EMAIL_ADDRESS_FORMAT
), )
); );
export default { export default {
@ -188,7 +188,7 @@ export default {
this.$route.query[this.queryStrings.FMG_PAGE], this.$route.query[this.queryStrings.FMG_PAGE],
this.GaActions.SUBMITTED, this.GaActions.SUBMITTED,
this.GaLabels.LICENSE_PLATE_LOOKUP, this.GaLabels.LICENSE_PLATE_LOOKUP,
true, true
); );
}); });
}, },
@ -210,7 +210,7 @@ export default {
const registrationZipValidationResponse = this.dispatchStoreActionWithLogging( const registrationZipValidationResponse = this.dispatchStoreActionWithLogging(
storeActions.VALIDATE_ZIP, storeActions.VALIDATE_ZIP,
{ zip: this.registrationZipCode }, { zip: this.registrationZipCode },
"license-plate-lookup", "license-plate-lookup"
); );
// Settle promises and get results // Settle promises and get results
@ -228,7 +228,7 @@ export default {
{ {
zip: this.serviceZipCode, zip: this.serviceZipCode,
}, },
"license-plate-lookup", "license-plate-lookup"
) )
: registrationZipValidationResponse, : registrationZipValidationResponse,
}, },
@ -239,7 +239,7 @@ export default {
// Lookup vin // Lookup vin
const vinLookup = await this.lookupVin( const vinLookup = await this.lookupVin(
this.licensePlate, this.licensePlate,
resultMap.registrationZipValidationResponse.state, resultMap.registrationZipValidationResponse.state
).catch(() => { ).catch(() => {
// No VIN found. // No VIN found.
this.displayVinNotFoundAlert = true; this.displayVinNotFoundAlert = true;
@ -274,12 +274,12 @@ export default {
this.isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId( this.isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId(
vinLookup.data.vehicle.carId, vinLookup.data.vehicle.carId,
"license-plate-lookup", "license-plate-lookup"
); );
// Update button "Continue with..." // Update button "Continue with..."
this.$refs.navbar.updateButtonText( this.$refs.navbar.updateButtonText(
`Continue with ${vinLookup.data.vehicle.year} ${vinLookup.data.vehicle.make} ${vinLookup.data.vehicle.model}`, `Continue with ${vinLookup.data.vehicle.year} ${vinLookup.data.vehicle.make} ${vinLookup.data.vehicle.model}`
); );
return this.$refs.navbar.removeLoader(); return this.$refs.navbar.removeLoader();
} }
@ -308,7 +308,7 @@ export default {
licensePlate: this.licensePlate, licensePlate: this.licensePlate,
}, },
}, },
false, false
); );
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.email, false); await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.email, false);
@ -320,7 +320,7 @@ export default {
zipCode: this.serviceZipCode, zipCode: this.serviceZipCode,
zipCodeCtu: resultMap.serviceZipValidationResponse.zipCodeCtu, zipCodeCtu: resultMap.serviceZipValidationResponse.zipCodeCtu,
}, },
false, false
); );
return await this.navigateForward(); return await this.navigateForward();
@ -330,7 +330,7 @@ export default {
storeActions.LOOKUP_VIN_BY_PLATE, storeActions.LOOKUP_VIN_BY_PLATE,
{ licensePlate: plate, licenseState: state }, { licensePlate: plate, licenseState: state },
"license-plate-lookup", "license-plate-lookup",
false, false
); );
}, },
async navigateForward() { async navigateForward() {
@ -339,7 +339,7 @@ export default {
this.navigationScenarios.CLICKED_FORWARD, this.navigationScenarios.CLICKED_FORWARD,
this.$route, this.$route,
{}, {},
{ [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: true }, { [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: true }
); );
} else { } else {
await this.navigateForwardWithSingleCarMatch(); await this.navigateForwardWithSingleCarMatch();
@ -360,7 +360,7 @@ export default {
const zipCode = this.serviceZipCode ? this.serviceZipCode : this.registrationZipCode; const zipCode = this.serviceZipCode ? this.serviceZipCode : this.registrationZipCode;
return this.getCmsContent("AlertNonServiceableZipWidget", "HeadlineText").replaceAll( return this.getCmsContent("AlertNonServiceableZipWidget", "HeadlineText").replaceAll(
"{custom:serviceZip}", "{custom:serviceZip}",
zipCode, zipCode
); );
}, },
AlertNonServiceableZipBody() { AlertNonServiceableZipBody() {
@ -369,7 +369,7 @@ export default {
AlertMatchedDifferentVehicleHeader() { AlertMatchedDifferentVehicleHeader() {
return this.getCmsContent( return this.getCmsContent(
"AlertMatchedDifferentVehicleWidget", "AlertMatchedDifferentVehicleWidget",
"HeadlineText", "HeadlineText"
).replaceAll("{custom:damage}", getDamageString()); ).replaceAll("{custom:damage}", getDamageString());
}, },
AlertMatchedDifferentVehicleBody() { AlertMatchedDifferentVehicleBody() {
@ -383,19 +383,19 @@ export default {
watch: { watch: {
licensePlate() { licensePlate() {
this.$refs.navbar.updateButtonText( this.$refs.navbar.updateButtonText(
this.getCmsContent("FunnelFooterWidget", "ForwardButtonText"), this.getCmsContent("FunnelFooterWidget", "ForwardButtonText")
); );
}, },
registrationZipCode() { registrationZipCode() {
this.$refs.navbar.updateButtonText( this.$refs.navbar.updateButtonText(
this.getCmsContent("FunnelFooterWidget", "ForwardButtonText"), this.getCmsContent("FunnelFooterWidget", "ForwardButtonText")
); );
}, },
serviceZipCode() { serviceZipCode() {
// If they modify the service zip code, then hide the error message. // If they modify the service zip code, then hide the error message.
this.displayNonServiceableZipAlert = false; this.displayNonServiceableZipAlert = false;
this.$refs.navbar.updateButtonText( this.$refs.navbar.updateButtonText(
this.getCmsContent("FunnelFooterWidget", "ForwardButtonText"), this.getCmsContent("FunnelFooterWidget", "ForwardButtonText")
); );
}, },
}, },

View file

@ -24,7 +24,7 @@ jest.mock(
() => { () => {
return {}; return {};
}, },
{ virtual: true }, { virtual: true }
); );
jest.mock("@/helpers/heritage-integration/navigation-helper", () => ({ jest.mock("@/helpers/heritage-integration/navigation-helper", () => ({
@ -290,7 +290,7 @@ describe("moldingQuestions.vue", () => {
partNum: "FW04848", partNum: "FW04848",
}, },
], ],
false, false
); );
wrapper.unmount(); wrapper.unmount();

View file

@ -83,13 +83,13 @@ export default {
methods: { methods: {
arePagePrerequisitesValid() { arePagePrerequisitesValid() {
const moldingQuestionsFromPageData = store.getters.pageData( const moldingQuestionsFromPageData = store.getters.pageData(
fmgPageValues.MOLDING_QUESTIONS, fmgPageValues.MOLDING_QUESTIONS
); );
return ( return (
// has childPartQuestions array and has glassName not null // has childPartQuestions array and has glassName not null
moldingQuestionsFromPageData?.partsOrQuestions?.some((part) => part?.glassName) && moldingQuestionsFromPageData?.partsOrQuestions?.some((part) => part?.glassName) &&
moldingQuestionsFromPageData.partsOrQuestions.some((glass) => moldingQuestionsFromPageData.partsOrQuestions.some((glass) =>
glass.parts?.some((part) => part?.childPartQuestions?.length > 0), glass.parts?.some((part) => part?.childPartQuestions?.length > 0)
) )
); );
}, },
@ -109,7 +109,7 @@ export default {
const updatedGlass = this.setupInitialData( const updatedGlass = this.setupInitialData(
glass, glass,
index, index,
alreadyAnsweredQuestions, alreadyAnsweredQuestions
); );
// Set up watch for each set of glass questions // Set up watch for each set of glass questions
@ -120,7 +120,7 @@ export default {
this.handleCompletedQuestionChainAnswers(newValue, glass.answerKey); this.handleCompletedQuestionChainAnswers(newValue, glass.answerKey);
} }
}, },
{ deep: true }, { deep: true }
); );
return updatedGlass; return updatedGlass;
@ -129,7 +129,7 @@ export default {
// if no preanswered questions then make sure index starts with the correct value // if no preanswered questions then make sure index starts with the correct value
this.currentGlassIndex = this.calculateQuestionIndex( this.currentGlassIndex = this.calculateQuestionIndex(
this.currentGlassIndex, this.currentGlassIndex,
this.questionsData, this.questionsData
); );
}, },
async forwardButtonAction() { async forwardButtonAction() {
@ -152,7 +152,7 @@ export default {
await this.dispatchStoreAction( await this.dispatchStoreAction(
this.storeActions.SAVE_MOLDING_QUESTION_ANSWERS, this.storeActions.SAVE_MOLDING_QUESTION_ANSWERS,
questionAnswersArray, questionAnswersArray,
false, false
); );
// get parts from the questionAnswers // get parts from the questionAnswers

View file

@ -28,7 +28,7 @@ jest.mock(
() => { () => {
return {}; return {};
}, },
{ virtual: true }, { virtual: true }
); );
jest.mock("@/helpers/heritage-integration/navigation-helper", () => ({ jest.mock("@/helpers/heritage-integration/navigation-helper", () => ({
@ -316,7 +316,7 @@ describe("partQuestions.vue...", () => {
result: "FW04848", result: "FW04848",
}, },
], ],
false, false
); );
wrapper.unmount(); wrapper.unmount();

View file

@ -87,7 +87,7 @@ export default {
// has .partQuestions array and has glassName not null // has .partQuestions array and has glassName not null
partQuestionsFromPageData?.partsOrQuestions?.some((part) => part?.glassName) && partQuestionsFromPageData?.partsOrQuestions?.some((part) => part?.glassName) &&
partQuestionsFromPageData?.partsOrQuestions?.some( partQuestionsFromPageData?.partsOrQuestions?.some(
(part) => part?.partQuestions?.length > 0, (part) => part?.partQuestions?.length > 0
) )
); );
}, },
@ -107,7 +107,7 @@ export default {
const updatedGlass = this.setupInitialData( const updatedGlass = this.setupInitialData(
glass, glass,
index, index,
alreadyAnsweredQuestions, alreadyAnsweredQuestions
); );
// Set up watch for each set of glass questions // Set up watch for each set of glass questions
@ -118,7 +118,7 @@ export default {
this.handleCompletedQuestionChainAnswers(newValue, glass.answerKey); this.handleCompletedQuestionChainAnswers(newValue, glass.answerKey);
} }
}, },
{ deep: true }, { deep: true }
); );
return updatedGlass; return updatedGlass;
@ -127,7 +127,7 @@ export default {
// if no preanswered questions then make sure index starts with the correct value // if no preanswered questions then make sure index starts with the correct value
this.currentGlassIndex = this.calculateQuestionIndex( this.currentGlassIndex = this.calculateQuestionIndex(
this.currentGlassIndex, this.currentGlassIndex,
this.questionsData, this.questionsData
); );
}, },
async forwardButtonAction() { async forwardButtonAction() {
@ -153,14 +153,14 @@ export default {
await this.dispatchStoreAction( await this.dispatchStoreAction(
this.storeActions.SAVE_PART_QUESTION_ANSWERS, this.storeActions.SAVE_PART_QUESTION_ANSWERS,
questionAnswersArray, questionAnswersArray,
false, false
); );
// call API parts method // call API parts method
const partsLookup = await this.dispatchStoreActionWithLogging( const partsLookup = await this.dispatchStoreActionWithLogging(
this.storeActions.GET_PARTS, this.storeActions.GET_PARTS,
null, null,
"part-questions", "part-questions"
); );
const glassPartsForStore = partsLookup.data.glassPieceParts; const glassPartsForStore = partsLookup.data.glassPieceParts;

View file

@ -77,7 +77,7 @@ export default {
if (this.isInsurance) { if (this.isInsurance) {
tempItems.splice( tempItems.splice(
tempItems.findIndex((a) => a.value === "Insurance"), tempItems.findIndex((a) => a.value === "Insurance"),
1, 1
); );
} }

View file

@ -164,12 +164,12 @@ export default {
const frontWipersOnOrder = const frontWipersOnOrder =
lineItemsFromStore.vaps.filter( lineItemsFromStore.vaps.filter(
(wiper) => wiper.partType == partTypeStrings.FRONT_WIPER, (wiper) => wiper.partType == partTypeStrings.FRONT_WIPER
) ?? []; ) ?? [];
const rearWipersOnOrder = const rearWipersOnOrder =
lineItemsFromStore.vaps.filter( lineItemsFromStore.vaps.filter(
(wiper) => wiper.partType == partTypeStrings.REAR_WIPER, (wiper) => wiper.partType == partTypeStrings.REAR_WIPER
) ?? []; ) ?? [];
const orderHasFrontWipers = frontWipersOnOrder.length > 0; const orderHasFrontWipers = frontWipersOnOrder.length > 0;
@ -183,14 +183,14 @@ export default {
serviceZipCode: store.getters.order.serviceLocation.zipCode, serviceZipCode: store.getters.order.serviceLocation.zipCode,
carId: store.getters.vehicle.carId, carId: store.getters.vehicle.carId,
}, },
"payment-method", "payment-method"
) )
: Promise.resolve([]); : Promise.resolve([]);
const rainDefensePromise = baseMixin.methods.dispatchStoreActionWithLogging( const rainDefensePromise = baseMixin.methods.dispatchStoreActionWithLogging(
storeActions.GET_RAIN_DEFENSE, storeActions.GET_RAIN_DEFENSE,
null, null,
"payment-method", "payment-method"
); );
const reviewDropdownPromise = reviewDropdown.methods.loadInitialData(); const reviewDropdownPromise = reviewDropdown.methods.loadInitialData();
@ -252,7 +252,7 @@ export default {
availableLineItems: lineItemsToTax, availableLineItems: lineItemsToTax,
}, },
"payment-method", "payment-method",
false, false
); );
// Promo logic // Promo logic
@ -265,13 +265,13 @@ export default {
await revalidatePromosAndValidateQueryStringPromo( await revalidatePromosAndValidateQueryStringPromo(
promoCodeFromQueryString, promoCodeFromQueryString,
pricedLineItemsToTax, pricedLineItemsToTax,
"payment-method", "payment-method"
); );
// Add newly validated promos to the array to get taxed // Add newly validated promos to the array to get taxed
const newValidatedPromos = validatePromoResponse?.orderPromos ?? []; const newValidatedPromos = validatePromoResponse?.orderPromos ?? [];
newValidatedPromos.push( newValidatedPromos.push(
...(revalidatePromoResponse ? revalidatePromoResponse.promoLineItems : []), ...(revalidatePromoResponse ? revalidatePromoResponse.promoLineItems : [])
); );
pricedLineItemsToTax.push(...newValidatedPromos); pricedLineItemsToTax.push(...newValidatedPromos);
// End of promo logic // End of promo logic
@ -288,7 +288,7 @@ export default {
pricedLineItems: pricedLineItemsToTax, pricedLineItems: pricedLineItemsToTax,
}, },
"payment-method", "payment-method",
false, false
); );
// Match all line items to the line items as they are in the store // Match all line items to the line items as they are in the store
@ -300,7 +300,7 @@ export default {
const vapsToAddToCart = getVapsThatNeedToBeAddedToSatisfyPromos( const vapsToAddToCart = getVapsThatNeedToBeAddedToSatisfyPromos(
newValidatedPromos, newValidatedPromos,
taxedVaps, taxedVaps,
lineItems, lineItems
); );
lineItems.vaps = lineItems.vaps ?? []; lineItems.vaps = lineItems.vaps ?? [];
lineItems.vaps.push(...vapsToAddToCart); lineItems.vaps.push(...vapsToAddToCart);
@ -312,7 +312,7 @@ export default {
vm.lineItems = lineItems; vm.lineItems = lineItems;
vm.inactivePromos = removeCurrentlyActivePromoCodesFromInactivePromos( vm.inactivePromos = removeCurrentlyActivePromoCodesFromInactivePromos(
vm.lineItems.promos, vm.lineItems.promos,
vm.inactivePromos, vm.inactivePromos
); );
vm.updateFooterButtonText(vm.customCtaCopy); vm.updateFooterButtonText(vm.customCtaCopy);
@ -322,7 +322,7 @@ export default {
const revalidateAlerts = buildToastMessagesFromRevalidateOrValidatePromoResponse( const revalidateAlerts = buildToastMessagesFromRevalidateOrValidatePromoResponse(
revalidatePromoResponse, revalidatePromoResponse,
oldActivePromos, oldActivePromos,
oldInactivePromos, oldInactivePromos
); );
revalidateAlerts.forEach((alert) => { revalidateAlerts.forEach((alert) => {
@ -334,7 +334,7 @@ export default {
buildToastMessagesFromRevalidateOrValidatePromoResponse(validatePromoResponse); buildToastMessagesFromRevalidateOrValidatePromoResponse(validatePromoResponse);
vm.$refs.funnelHeader.pushGlobalAlert( vm.$refs.funnelHeader.pushGlobalAlert(
validateAlerts[0], validateAlerts[0],
validateAlerts[0].shouldAutoFade, validateAlerts[0].shouldAutoFade
); );
} }
}); });
@ -438,14 +438,14 @@ export default {
lineItemsToUse: this.lineItems, lineItemsToUse: this.lineItems,
}, },
"payment-method", "payment-method",
false, false
); );
// Handle error alerts here, success alerts are handled in the watcher // Handle error alerts here, success alerts are handled in the watcher
if (revalidatePromoResponse.errors.length) { if (revalidatePromoResponse.errors.length) {
getNewlyInactivatedPromos( getNewlyInactivatedPromos(
this.inactivePromos, this.inactivePromos,
revalidatePromoResponse.errors, revalidatePromoResponse.errors
).forEach((promoCode) => { ).forEach((promoCode) => {
const errorAlert = createPromoErrorAlert(promoCode); const errorAlert = createPromoErrorAlert(promoCode);
this.$refs.funnelHeader.pushGlobalAlert(errorAlert, errorAlert.shouldAutoFade); this.$refs.funnelHeader.pushGlobalAlert(errorAlert, errorAlert.shouldAutoFade);
@ -466,21 +466,21 @@ export default {
pricedLineItems: revalidatePromoResponse.promoLineItems, pricedLineItems: revalidatePromoResponse.promoLineItems,
}, },
"payment-method", "payment-method",
false, false
); );
} }
const vapsToAddToCart = getVapsThatNeedToBeAddedToSatisfyPromos( const vapsToAddToCart = getVapsThatNeedToBeAddedToSatisfyPromos(
revalidatePromoResponse.promoLineItems, revalidatePromoResponse.promoLineItems,
this.availableVaps, this.availableVaps,
this.lineItems, this.lineItems
); );
this.lineItems.vaps.push(...vapsToAddToCart); this.lineItems.vaps.push(...vapsToAddToCart);
this.lineItems.promos = revalidatePromoResponse.promoLineItems; this.lineItems.promos = revalidatePromoResponse.promoLineItems;
this.inactivePromos = revalidatePromoResponse.errors.map((x) => this.inactivePromos = revalidatePromoResponse.errors.map((x) =>
getPromoCodeWithoutBundleIdentifier(x.promoCode), getPromoCodeWithoutBundleIdentifier(x.promoCode)
); );
this.$refs.loadingModal.hideModal(); this.$refs.loadingModal.hideModal();
@ -497,18 +497,18 @@ export default {
await this.dispatchStoreAction( await this.dispatchStoreAction(
storeActions.SAVE_PAYMENT_METHOD_CHOICE, storeActions.SAVE_PAYMENT_METHOD_CHOICE,
this.paymentMethod, this.paymentMethod,
false, false
); );
// save lineitems as they now have salestax added // save lineitems as they now have salestax added
await this.dispatchStoreAction( await this.dispatchStoreAction(
storeActions.SAVE_GLASS_PARTS_SUPPRESSING_STATE_RESETTING, storeActions.SAVE_GLASS_PARTS_SUPPRESSING_STATE_RESETTING,
this.lineItems.glassParts, this.lineItems.glassParts,
false, false
); );
await this.dispatchStoreAction( await this.dispatchStoreAction(
storeActions.SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING, storeActions.SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING,
this.lineItems.supportingItems, this.lineItems.supportingItems,
false, false
); );
await this.dispatchStoreAction(storeActions.SAVE_VAPS, this.lineItems.vaps, false); await this.dispatchStoreAction(storeActions.SAVE_VAPS, this.lineItems.vaps, false);
this.dispatchStoreAction( this.dispatchStoreAction(
@ -517,7 +517,7 @@ export default {
activePromos: this.lineItems.promos, activePromos: this.lineItems.promos,
inactivePromos: this.inactivePromos, inactivePromos: this.inactivePromos,
}, },
false, false
); );
this.dispatchStoreAction(storeActions.SAVE_IS_RECAL_ACK_OPT_IN, this.isRecalAckOptIn); this.dispatchStoreAction(storeActions.SAVE_IS_RECAL_ACK_OPT_IN, this.isRecalAckOptIn);
if (this.paymentMethod == paymentMethods.LATER) { if (this.paymentMethod == paymentMethods.LATER) {
@ -525,14 +525,14 @@ export default {
await submitWorkOrder({ pageNameToLog: "payment-method", submitAfterSave: true }); await submitWorkOrder({ pageNameToLog: "payment-method", submitAfterSave: true });
this.$router.navigateWithoutSaving( this.$router.navigateWithoutSaving(
this.navigationScenarios.CLICKED_FORWARD, this.navigationScenarios.CLICKED_FORWARD,
this.$route, this.$route
); );
} else { } else {
if (this.paymentMethod == paymentMethods.INSURANCE) { if (this.paymentMethod == paymentMethods.INSURANCE) {
this.dispatchStoreAction(this.storeActions.SAVE_PAYMENT_TYPE, true, false); this.dispatchStoreAction(this.storeActions.SAVE_PAYMENT_TYPE, true, false);
this.$router.navigateWithoutSaving( this.$router.navigateWithoutSaving(
this.navigationScenarios.CLICKED_INSURANCE, this.navigationScenarios.CLICKED_INSURANCE,
this.$route, this.$route
); );
} else { } else {
this.setupPia(); this.setupPia();
@ -561,7 +561,7 @@ export default {
this.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE); this.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE);
this.$router.navigateWithoutSaving( this.$router.navigateWithoutSaving(
this.navigationScenarios.CLICKED_PAY_NOW, this.navigationScenarios.CLICKED_PAY_NOW,
this.$route, this.$route
); );
}, },
hasSubmittedOrder() { hasSubmittedOrder() {
@ -574,7 +574,7 @@ export default {
computed: { computed: {
hasRecal() { hasRecal() {
const recalLineItem = this.$store.getters.order.lineItems?.supportingItems?.find( const recalLineItem = this.$store.getters.order.lineItems?.supportingItems?.find(
(lineItem) => lineItem.partType.indexOf(partTypeStrings.RECALIBRATION) !== -1, (lineItem) => lineItem.partType.indexOf(partTypeStrings.RECALIBRATION) !== -1
); );
if (recalLineItem) { if (recalLineItem) {
@ -711,11 +711,11 @@ export default {
if (oldValue.promos.length < newValue.promos.length) { if (oldValue.promos.length < newValue.promos.length) {
const oldPromoCodes = oldValue.promos.map( const oldPromoCodes = oldValue.promos.map(
(promoObject) => promoObject.promoCode, (promoObject) => promoObject.promoCode
); );
const newlyActivatedPromoCodes = newValue.promos.filter( const newlyActivatedPromoCodes = newValue.promos.filter(
(newPromo) => !oldPromoCodes.includes(newPromo.promoCode), (newPromo) => !oldPromoCodes.includes(newPromo.promoCode)
); );
const alert = createPromoSuccessAlert(newlyActivatedPromoCodes[0].promoCode); const alert = createPromoSuccessAlert(newlyActivatedPromoCodes[0].promoCode);

View file

@ -33,7 +33,7 @@ export default {
}, },
getGlassPieces(damageLocation) { getGlassPieces(damageLocation) {
return this.damage?.glassToReplace?.filter( return this.damage?.glassToReplace?.filter(
(item) => item.glassLocation === damageLocation, (item) => item.glassLocation === damageLocation
); );
}, },
generateBulletedListFromAnswers(answers) { generateBulletedListFromAnswers(answers) {
@ -91,7 +91,7 @@ export default {
const damageAnswers = this.getAnswersNullSafe(answerContent?.SubWidgetName); const damageAnswers = this.getAnswersNullSafe(answerContent?.SubWidgetName);
const driverSideItems = this.getGlassPieces(damageLocationsSelected.DRIVER); const driverSideItems = this.getGlassPieces(damageLocationsSelected.DRIVER);
const damageAnswersOnOrder = damageAnswers?.filter((answer) => const damageAnswersOnOrder = damageAnswers?.filter((answer) =>
driverSideItems?.some((glassPiece) => answer.Name === glassPiece.glassName), driverSideItems?.some((glassPiece) => answer.Name === glassPiece.glassName)
); );
if (this.hasDriverSideDamage) { if (this.hasDriverSideDamage) {
@ -108,7 +108,7 @@ export default {
const damageAnswers = this.getAnswersNullSafe(answerContent?.SubWidgetName); const damageAnswers = this.getAnswersNullSafe(answerContent?.SubWidgetName);
const passengerSideItems = this.getGlassPieces(damageLocationsSelected.PASSENGER); const passengerSideItems = this.getGlassPieces(damageLocationsSelected.PASSENGER);
const damageAnswersOnOrder = damageAnswers?.filter((answer) => const damageAnswersOnOrder = damageAnswers?.filter((answer) =>
passengerSideItems?.some((glassPiece) => answer.Name === glassPiece.glassName), passengerSideItems?.some((glassPiece) => answer.Name === glassPiece.glassName)
); );
if (this.hasPassengerSideDamage) { if (this.hasPassengerSideDamage) {

View file

@ -811,7 +811,7 @@ describe("Service Package Review Block", () => {
expect(wrapper.vm.packageNameWidget).toEqual(testConstants.widgetNames.tierOneTitle); expect(wrapper.vm.packageNameWidget).toEqual(testConstants.widgetNames.tierOneTitle);
let containsRainDefenseCopy = wrapper.vm.displayContent.includes( let containsRainDefenseCopy = wrapper.vm.displayContent.includes(
testConstants.vapsCopy.rainDefenseCopy, testConstants.vapsCopy.rainDefenseCopy
); );
expect(containsRainDefenseCopy).toBe(true); expect(containsRainDefenseCopy).toBe(true);
}); });
@ -863,10 +863,10 @@ describe("Service Package Review Block", () => {
// Assert // Assert
const includesFrontWiperCopy = wrapper.vm.displayContent.includes( const includesFrontWiperCopy = wrapper.vm.displayContent.includes(
testConstants.vapsCopy.frontWiperCopy, testConstants.vapsCopy.frontWiperCopy
); );
const includesRainDefenseCopy = wrapper.vm.displayContent.includes( const includesRainDefenseCopy = wrapper.vm.displayContent.includes(
testConstants.vapsCopy.rainDefenseCopy, testConstants.vapsCopy.rainDefenseCopy
); );
expect(includesFrontWiperCopy).toBe(true); expect(includesFrontWiperCopy).toBe(true);
expect(includesRainDefenseCopy).toBe(false); expect(includesRainDefenseCopy).toBe(false);
@ -916,7 +916,7 @@ describe("Service Package Review Block", () => {
// Assert // Assert
expect(wrapper.vm.packageNameWidget).toEqual( expect(wrapper.vm.packageNameWidget).toEqual(
iteration.expected.packageNameWidget, iteration.expected.packageNameWidget
); );
expect(wrapper.vm.displayContent).toEqual(iteration.expected.displayContent); expect(wrapper.vm.displayContent).toEqual(iteration.expected.displayContent);
}); });

View file

@ -38,12 +38,12 @@ export default {
serviceZipCode: store.getters.order.serviceLocation.zipCode, serviceZipCode: store.getters.order.serviceLocation.zipCode,
carId: store.getters.vehicle.carId, carId: store.getters.vehicle.carId,
}, },
"review", "review"
); );
const rainDefensePromise = baseMixin.methods.dispatchStoreActionWithLogging( const rainDefensePromise = baseMixin.methods.dispatchStoreActionWithLogging(
storeActions.GET_RAIN_DEFENSE, storeActions.GET_RAIN_DEFENSE,
null, null,
"review", "review"
); );
const promiseResultMap = [ const promiseResultMap = [
@ -75,7 +75,7 @@ export default {
packageNameWidget() { packageNameWidget() {
const servicePackageNames = this.getCmsContent( const servicePackageNames = this.getCmsContent(
this.servicePackageOptionsCmsName, this.servicePackageOptionsCmsName,
"Answers", "Answers"
); );
if (!servicePackageNames) { if (!servicePackageNames) {
@ -83,7 +83,7 @@ export default {
} }
const currentPackage = servicePackageNames.find( const currentPackage = servicePackageNames.find(
(entry) => entry.Name === this.packageLevel, (entry) => entry.Name === this.packageLevel
); );
return currentPackage.SubWidgetName; return currentPackage.SubWidgetName;
@ -105,7 +105,7 @@ export default {
} }
const vapsDescriptionsOnOrder = vapsDescriptions.filter((answer) => const vapsDescriptionsOnOrder = vapsDescriptions.filter((answer) =>
containsLineItemWithPartType(answer.Name, this.vaps), containsLineItemWithPartType(answer.Name, this.vaps)
); );
return vapsDescriptionsOnOrder.map((answer) => answer.Text); return vapsDescriptionsOnOrder.map((answer) => answer.Text);
@ -115,7 +115,7 @@ export default {
this.glassToReplace, this.glassToReplace,
this.availableLineItems, this.availableLineItems,
this.isRepair, this.isRepair,
this.vaps, this.vaps
); );
}, },
glassToReplace() { glassToReplace() {

View file

@ -34,7 +34,7 @@ export default {
this.$route, this.$route,
{ {
[queryStrings.DISPLAY_PIA_ALERT]: store.getters.order.payment.piaType, [queryStrings.DISPLAY_PIA_ALERT]: store.getters.order.payment.piaType,
}, }
); );
} else { } else {
this.$router.navigateWithoutSaving( this.$router.navigateWithoutSaving(
@ -42,7 +42,7 @@ export default {
this.$route, this.$route,
{ {
[queryStrings.DISPLAY_PIA_ALERT]: true, [queryStrings.DISPLAY_PIA_ALERT]: true,
}, }
); );
} }
} else { } else {
@ -63,12 +63,12 @@ export default {
const lastFour = getQuerystringParameter(queryStrings.LAST_FOUR); const lastFour = getQuerystringParameter(queryStrings.LAST_FOUR);
if (lastFour) { if (lastFour) {
console.log( console.log(
new Date() + ": Payment method credit card selected by default", new Date() + ": Payment method credit card selected by default"
); );
this.dispatchStoreAction( this.dispatchStoreAction(
storeActions.SAVE_PAYMENT_METHOD_CHOICE, storeActions.SAVE_PAYMENT_METHOD_CHOICE,
paymentMethods.CREDIT_CARD, paymentMethods.CREDIT_CARD,
false, false
); );
await this.processCreditCardResponse(); await this.processCreditCardResponse();
} else { } else {
@ -78,7 +78,7 @@ export default {
this.navigationScenarios.PIA_ERROR, this.navigationScenarios.PIA_ERROR,
this.$route, this.$route,
{}, {},
{ [routerParams.DISPLAY_PIA_ALERT]: true }, { [routerParams.DISPLAY_PIA_ALERT]: true }
); );
} }
} }
@ -97,7 +97,7 @@ export default {
baseMixin.methods.dispatchStoreAction( baseMixin.methods.dispatchStoreAction(
storeActions.SAVE_NEXTGEN_SETTLED_AMOUNT, storeActions.SAVE_NEXTGEN_SETTLED_AMOUNT,
this.getAmountDue(), this.getAmountDue(),
false, false
); );
await this.saveAndSubmitWorkOrder(); await this.saveAndSubmitWorkOrder();
@ -111,13 +111,13 @@ export default {
"error: unknown ref:" + "error: unknown ref:" +
referralSeqNum + referralSeqNum +
" " + " " +
store.getters.order.referralSequenceNumber, store.getters.order.referralSequenceNumber
); );
this.$router.navigateWithoutSaving( this.$router.navigateWithoutSaving(
this.navigationScenarios.PIA_ERROR, this.navigationScenarios.PIA_ERROR,
this.$route, this.$route,
{}, {},
{ [routerParams.DISPLAY_PIA_ALERT]: true }, { [routerParams.DISPLAY_PIA_ALERT]: true }
); );
} else { } else {
const expMonth = getQuerystringParameter(queryStrings.CARD_EXPIRATION_MONTH); const expMonth = getQuerystringParameter(queryStrings.CARD_EXPIRATION_MONTH);
@ -130,7 +130,7 @@ export default {
const authCode = getQuerystringParameter(queryStrings.AUTH_CODE); const authCode = getQuerystringParameter(queryStrings.AUTH_CODE);
const transactionId = getQuerystringParameter(queryStrings.TRANSACTION_ID); const transactionId = getQuerystringParameter(queryStrings.TRANSACTION_ID);
const transReferenceNumber = getQuerystringParameter( const transReferenceNumber = getQuerystringParameter(
queryStrings.TRANS_REFERENCE_NUMBER, queryStrings.TRANS_REFERENCE_NUMBER
); );
const lastFour = getQuerystringParameter(queryStrings.LAST_FOUR); const lastFour = getQuerystringParameter(queryStrings.LAST_FOUR);
@ -153,7 +153,7 @@ export default {
baseMixin.methods.dispatchStoreAction( baseMixin.methods.dispatchStoreAction(
storeActions.SAVE_NEXTGEN_SETTLED_AMOUNT, storeActions.SAVE_NEXTGEN_SETTLED_AMOUNT,
this.getAmountDue(), this.getAmountDue(),
false, false
); );
await this.saveAndSubmitWorkOrder(); await this.saveAndSubmitWorkOrder();
} }
@ -175,7 +175,7 @@ export default {
this.navigationScenarios.PIA_ERROR, this.navigationScenarios.PIA_ERROR,
this.$route, this.$route,
{}, {},
{ [routerParams.DISPLAY_PIA_ALERT]: true }, { [routerParams.DISPLAY_PIA_ALERT]: true }
); );
this.$refs.loadingModal.isModalVisible = false; this.$refs.loadingModal.isModalVisible = false;
return; return;

View file

@ -38,7 +38,7 @@ export default {
this.$route.query[this.queryStrings.FMG_PAGE], this.$route.query[this.queryStrings.FMG_PAGE],
this.GaActions.CLICKED, this.GaActions.CLICKED,
this.buttonText, this.buttonText,
true, true
); );
this.$emit("click-event", clickValue); this.$emit("click-event", clickValue);
}, },

View file

@ -308,7 +308,7 @@ describe("payment.vue", () => {
vmMock, vmMock,
{ query: { fmgPage: "payment" } }, { query: { fmgPage: "payment" } },
undefined, undefined,
nextF, nextF
); );
// Assert // Assert

View file

@ -280,7 +280,7 @@ export default {
const signaturePromise = baseMixin.methods.dispatchStoreActionWithLogging( const signaturePromise = baseMixin.methods.dispatchStoreActionWithLogging(
storeActions.GET_SIGNATURE, storeActions.GET_SIGNATURE,
null, null,
"payment", "payment"
); );
const wipersPromise = baseMixin.methods.dispatchStoreActionWithLogging( const wipersPromise = baseMixin.methods.dispatchStoreActionWithLogging(
@ -289,13 +289,13 @@ export default {
serviceZipCode: store.getters.order.serviceLocation.zipCode, serviceZipCode: store.getters.order.serviceLocation.zipCode,
carId: store.getters.vehicle.carId, carId: store.getters.vehicle.carId,
}, },
"payment", "payment"
); );
const rainDefensePromise = baseMixin.methods.dispatchStoreActionWithLogging( const rainDefensePromise = baseMixin.methods.dispatchStoreActionWithLogging(
storeActions.GET_RAIN_DEFENSE, storeActions.GET_RAIN_DEFENSE,
null, null,
"payment", "payment"
); );
const promiseResultMap = [ const promiseResultMap = [
@ -336,7 +336,7 @@ export default {
availableLineItems: lineItemsToTax, availableLineItems: lineItemsToTax,
}, },
"payment", "payment",
false, false
); );
// Promo logic // Promo logic
@ -346,12 +346,12 @@ export default {
await revalidatePromosAndValidateQueryStringPromo( await revalidatePromosAndValidateQueryStringPromo(
promoCodeFromQueryString, promoCodeFromQueryString,
pricedLineItemsToTax, pricedLineItemsToTax,
"payment", "payment"
); );
const newValidatedPromos = validatePromoResponse?.orderPromos ?? []; const newValidatedPromos = validatePromoResponse?.orderPromos ?? [];
newValidatedPromos.push( newValidatedPromos.push(
...(revalidatePromoResponse ? revalidatePromoResponse.promoLineItems : []), ...(revalidatePromoResponse ? revalidatePromoResponse.promoLineItems : [])
); );
pricedLineItemsToTax.push(...newValidatedPromos); pricedLineItemsToTax.push(...newValidatedPromos);
@ -369,7 +369,7 @@ export default {
pricedLineItems: pricedLineItemsToTax, pricedLineItems: pricedLineItemsToTax,
}, },
"payment", "payment",
false, false
); );
// Match all line items to the line items as they are in the store // Match all line items to the line items as they are in the store
@ -383,7 +383,7 @@ export default {
const vapsToAddToCart = getVapsThatNeedToBeAddedToSatisfyPromos( const vapsToAddToCart = getVapsThatNeedToBeAddedToSatisfyPromos(
newValidatedPromos, newValidatedPromos,
taxedVaps, taxedVaps,
lineItems, lineItems
); );
lineItems.vaps = lineItems.vaps ?? []; lineItems.vaps = lineItems.vaps ?? [];
lineItems.vaps.push(...vapsToAddToCart); lineItems.vaps.push(...vapsToAddToCart);
@ -614,7 +614,7 @@ export default {
await this.dispatchStoreAction( await this.dispatchStoreAction(
storeActions.SAVE_PAYMENT_METHOD_CHOICE, storeActions.SAVE_PAYMENT_METHOD_CHOICE,
paymentMethods.LATER, paymentMethods.LATER,
false, false
); );
await this.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE); await this.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE);
@ -632,7 +632,7 @@ export default {
this.navigationScenarios.PIA_ERROR, this.navigationScenarios.PIA_ERROR,
this.$route, this.$route,
{}, {},
{ [routerParams.DISPLAY_PIA_ALERT]: true }, { [routerParams.DISPLAY_PIA_ALERT]: true }
); );
this.$refs.loadingModal.isModalVisible = false; this.$refs.loadingModal.isModalVisible = false;
return; return;
@ -727,13 +727,13 @@ export default {
this.dispatchStoreAction( this.dispatchStoreAction(
storeActions.SAVE_PAYMENT_METHOD_CHOICE, storeActions.SAVE_PAYMENT_METHOD_CHOICE,
paymentMethod, paymentMethod,
false, false
); );
} }
}, },
setIFrameListener() { setIFrameListener() {
window.addEventListener("message", (event) => window.addEventListener("message", (event) =>
this.handleIFrameContentWindowMessage(event), this.handleIFrameContentWindowMessage(event)
); );
}, },
setUIBlock(val) { setUIBlock(val) {

View file

@ -82,7 +82,7 @@ export default {
} }
let price = baseMixin.methods.getTierOnePackagePrice( let price = baseMixin.methods.getTierOnePackagePrice(
baseMixin.methods.filterOutFees(allLineItems), baseMixin.methods.filterOutFees(allLineItems)
); );
let vapsLineItemsForSelectedPackage = this.lineItems.vaps; let vapsLineItemsForSelectedPackage = this.lineItems.vaps;
@ -94,7 +94,7 @@ export default {
let allLineItems = getArrayOfAllLineItems(this.lineItems); let allLineItems = getArrayOfAllLineItems(this.lineItems);
const promos = getPromosThatMatchLineItemsOnOrder( const promos = getPromosThatMatchLineItemsOnOrder(
this.lineItems.promos, this.lineItems.promos,
allLineItems, allLineItems
); );
promos.forEach((promo) => { promos.forEach((promo) => {
price += baseMixin.methods.getTotalLineItemPrice(promo); price += baseMixin.methods.getTotalLineItemPrice(promo);

View file

@ -27,7 +27,7 @@ export default {
const answers = this.getCmsContent(this.cmsWidgetName, "Answers"); const answers = this.getCmsContent(this.cmsWidgetName, "Answers");
if (answers) { if (answers) {
answers.forEach( answers.forEach(
(answer) => (answer.additionalButtonData = this.additionalButtonData), (answer) => (answer.additionalButtonData = this.additionalButtonData)
); );
} }
return answers; return answers;

View file

@ -38,7 +38,7 @@ jest.mock(
() => { () => {
return {}; return {};
}, },
{ virtual: true }, { virtual: true }
); );
// START beforeRouteEnter mock arranging // // START beforeRouteEnter mock arranging //
@ -265,7 +265,7 @@ describe("quote.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "quote" } }, { query: { fmgPage: "quote" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
//Assert //Assert
@ -303,7 +303,7 @@ describe("quote.vue", () => {
wrapper.vm.$route = { query: { isInsurance: "false" } }; wrapper.vm.$route = { query: { isInsurance: "false" } };
const isServicePackageDiscount = mockMixin.methods.getSettingValue( const isServicePackageDiscount = mockMixin.methods.getSettingValue(
experimentSettings.SERVICE_PACKAGE_DISCOUNT, experimentSettings.SERVICE_PACKAGE_DISCOUNT
); );
//Act //Act
@ -311,7 +311,7 @@ describe("quote.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "quote" } }, { query: { fmgPage: "quote" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
//Assert //Assert
expect(isServicePackageDiscount).toBe(true); expect(isServicePackageDiscount).toBe(true);
@ -348,7 +348,7 @@ describe("quote.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "quote" } }, { query: { fmgPage: "quote" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
//Assert //Assert
@ -386,7 +386,7 @@ describe("quote.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "quote" } }, { query: { fmgPage: "quote" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
//Assert //Assert
@ -426,7 +426,7 @@ describe("quote.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "quote" } }, { query: { fmgPage: "quote" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
//Assert //Assert
@ -465,7 +465,7 @@ describe("quote.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "quote" } }, { query: { fmgPage: "quote" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
//Assert //Assert
@ -506,7 +506,7 @@ describe("quote.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "quote" } }, { query: { fmgPage: "quote" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
//Assert //Assert
@ -548,7 +548,7 @@ describe("quote.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "quote" } }, { query: { fmgPage: "quote" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
//Assert //Assert
@ -586,7 +586,7 @@ describe("quote.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "quote" } }, { query: { fmgPage: "quote" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
//Assert //Assert
expect(wrapper.vm.isInsuranceSelected).toBe(true); expect(wrapper.vm.isInsuranceSelected).toBe(true);
@ -642,7 +642,7 @@ describe("quote.vue", () => {
expect(wrapper.vm.dispatchStoreAction).toHaveBeenCalledWith( expect(wrapper.vm.dispatchStoreAction).toHaveBeenCalledWith(
"saveSupportingItems", "saveSupportingItems",
wrapper.vm.lineItems.supportingItems, wrapper.vm.lineItems.supportingItems,
false, false
); );
}); });
}); });
@ -701,7 +701,7 @@ describe("quote.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "quote" } }, { query: { fmgPage: "quote" } },
undefined, undefined,
nextFunction, nextFunction
); );
await nextTick(); await nextTick();
expect(nextFunction).toHaveBeenCalled(); expect(nextFunction).toHaveBeenCalled();

View file

@ -138,17 +138,17 @@ export default {
serviceZipCode: store.getters.order.serviceLocation.zipCode, serviceZipCode: store.getters.order.serviceLocation.zipCode,
carId: store.getters.vehicle.carId, carId: store.getters.vehicle.carId,
}, },
"quote", "quote"
); );
const rainDefensePromise = baseMixin.methods.dispatchStoreActionWithLogging( const rainDefensePromise = baseMixin.methods.dispatchStoreActionWithLogging(
storeActions.GET_RAIN_DEFENSE, storeActions.GET_RAIN_DEFENSE,
null, null,
"quote", "quote"
); );
const supportingItemsPromise = baseMixin.methods.dispatchStoreActionWithLogging( const supportingItemsPromise = baseMixin.methods.dispatchStoreActionWithLogging(
storeActions.GET_SUPPORTING_ITEMS, storeActions.GET_SUPPORTING_ITEMS,
null, null,
"quote", "quote"
); );
const promiseResultMap = [ const promiseResultMap = [
@ -175,7 +175,7 @@ export default {
lineItems.vaps = lineItems.vaps ?? []; lineItems.vaps = lineItems.vaps ?? [];
const nullSafeGlassParts = lineItems.glassParts ?? []; const nullSafeGlassParts = lineItems.glassParts ?? [];
const servicePackageDiscountSettingValue = experimentMixin.methods.getSettingValue( const servicePackageDiscountSettingValue = experimentMixin.methods.getSettingValue(
experimentSettings.SERVICE_PACKAGE_DISCOUNT, experimentSettings.SERVICE_PACKAGE_DISCOUNT
); );
const isServicePackageDiscount = servicePackageDiscountSettingValue === "True"; const isServicePackageDiscount = servicePackageDiscountSettingValue === "True";
//Service package cash discount api call when experiment is active //Service package cash discount api call when experiment is active
@ -185,7 +185,7 @@ export default {
await baseMixin.methods.dispatchStoreActionWithLogging( await baseMixin.methods.dispatchStoreActionWithLogging(
storeActions.GET_SERVICE_PACKAGE_DISCOUNT_PART, storeActions.GET_SERVICE_PACKAGE_DISCOUNT_PART,
null, null,
"quote", "quote"
); );
if (servicePackageDiscountPartResponse.data) { if (servicePackageDiscountPartResponse.data) {
servicePackageDiscountPart.push(servicePackageDiscountPartResponse.data); servicePackageDiscountPart.push(servicePackageDiscountPartResponse.data);
@ -203,12 +203,12 @@ export default {
baseMixin.methods.dispatchStoreAction( baseMixin.methods.dispatchStoreAction(
storeActions.SAVE_PARENT_ACCOUNT_NUMBER, storeActions.SAVE_PARENT_ACCOUNT_NUMBER,
applicationConfig.CASH_PARENT_ACCOUNT_NUMBER, applicationConfig.CASH_PARENT_ACCOUNT_NUMBER,
false, false
); );
baseMixin.methods.dispatchStoreAction( baseMixin.methods.dispatchStoreAction(
storeActions.SAVE_BILL_TO_ACCOUNT_NUMBER, storeActions.SAVE_BILL_TO_ACCOUNT_NUMBER,
applicationConfig.CASH_DEFAULT_BILL_TO_ACCOUNT_NUMBER, applicationConfig.CASH_DEFAULT_BILL_TO_ACCOUNT_NUMBER,
false, false
); );
const pricingResults = await baseMixin.methods.dispatchStoreActionWithLogging( const pricingResults = await baseMixin.methods.dispatchStoreActionWithLogging(
@ -217,13 +217,13 @@ export default {
availableLineItems: availableLineItems, availableLineItems: availableLineItems,
}, },
"quote", "quote",
false, false
); );
baseMixin.methods.dispatchStoreAction( baseMixin.methods.dispatchStoreAction(
storeActions.SAVE_SUPPORTING_ITEMS, storeActions.SAVE_SUPPORTING_ITEMS,
resultMap.supportingItems, resultMap.supportingItems,
false, false
); );
lineItems.supportingItems = resultMap.supportingItems; lineItems.supportingItems = resultMap.supportingItems;
const addableVaps = [...resultMap.wipers, resultMap.rainDefense]; const addableVaps = [...resultMap.wipers, resultMap.rainDefense];
@ -239,7 +239,7 @@ export default {
promoCodeFromQueryString, promoCodeFromQueryString,
pricingResults, pricingResults,
"quote", "quote",
true, true
); );
// Sync local promos with any new promos added by validate/revalidate // Sync local promos with any new promos added by validate/revalidate
lineItems.promos = store.getters.lineItems.promos ?? []; lineItems.promos = store.getters.lineItems.promos ?? [];
@ -257,7 +257,7 @@ export default {
const revalidateAlerts = buildToastMessagesFromRevalidateOrValidatePromoResponse( const revalidateAlerts = buildToastMessagesFromRevalidateOrValidatePromoResponse(
revalidatePromoResponse, revalidatePromoResponse,
oldActivePromos, oldActivePromos,
oldInactivePromos, oldInactivePromos
); );
revalidateAlerts.forEach((alert) => { revalidateAlerts.forEach((alert) => {
vm.$refs.funnelHeader.pushGlobalAlert(alert, alert.shouldAutoFade); vm.$refs.funnelHeader.pushGlobalAlert(alert, alert.shouldAutoFade);
@ -268,7 +268,7 @@ export default {
buildToastMessagesFromRevalidateOrValidatePromoResponse(validatePromoResponse); buildToastMessagesFromRevalidateOrValidatePromoResponse(validatePromoResponse);
vm.$refs.funnelHeader.pushGlobalAlert( vm.$refs.funnelHeader.pushGlobalAlert(
validateAlerts[0], validateAlerts[0],
validateAlerts[0].shouldAutoFade, validateAlerts[0].shouldAutoFade
); );
} }
if (store.getters.isExternalParameter) { if (store.getters.isExternalParameter) {
@ -306,7 +306,7 @@ export default {
isRecalibrationOnOrder() { isRecalibrationOnOrder() {
return containsLineItemWithPartType( return containsLineItemWithPartType(
partTypeStrings.RECALIBRATION, partTypeStrings.RECALIBRATION,
this?.availableLineItems, this?.availableLineItems
); );
}, },
}, },
@ -343,7 +343,7 @@ export default {
} else { } else {
return availableLineItems return availableLineItems
? baseMixin.methods.getTierOnePackagePrice( ? baseMixin.methods.getTierOnePackagePrice(
baseMixin.methods.filterOutFees(availableLineItems), baseMixin.methods.filterOutFees(availableLineItems)
) > 300 ) > 300
: null; : null;
} }
@ -361,19 +361,19 @@ export default {
this.dispatchStoreAction( this.dispatchStoreAction(
this.storeActions.SAVE_PAYMENT_TYPE, this.storeActions.SAVE_PAYMENT_TYPE,
this.isInsuranceSelected, this.isInsuranceSelected,
false, false
); );
if (!this.isInsuranceSelected) { if (!this.isInsuranceSelected) {
this.dispatchStoreAction( this.dispatchStoreAction(
this.storeActions.SAVE_PARENT_ACCOUNT_NUMBER, this.storeActions.SAVE_PARENT_ACCOUNT_NUMBER,
applicationConfig.CASH_PARENT_ACCOUNT_NUMBER, applicationConfig.CASH_PARENT_ACCOUNT_NUMBER,
false, false
); );
this.dispatchStoreAction( this.dispatchStoreAction(
this.storeActions.SAVE_BILL_TO_ACCOUNT_NUMBER, this.storeActions.SAVE_BILL_TO_ACCOUNT_NUMBER,
applicationConfig.CASH_DEFAULT_BILL_TO_ACCOUNT_NUMBER, applicationConfig.CASH_DEFAULT_BILL_TO_ACCOUNT_NUMBER,
false, false
); );
} }
@ -388,13 +388,13 @@ export default {
this.dispatchStoreAction( this.dispatchStoreAction(
this.storeActions.SAVE_GLASS_PARTS_SUPPRESSING_STATE_RESETTING, this.storeActions.SAVE_GLASS_PARTS_SUPPRESSING_STATE_RESETTING,
this.lineItems.glassParts, this.lineItems.glassParts,
false, false
); );
} }
this.dispatchStoreAction( this.dispatchStoreAction(
this.storeActions.SAVE_SUPPORTING_ITEMS, this.storeActions.SAVE_SUPPORTING_ITEMS,
this.lineItems.supportingItems, this.lineItems.supportingItems,
false, false
); );
this.dispatchStoreAction(this.storeActions.SAVE_VAPS, this.lineItems.vaps, false); this.dispatchStoreAction(this.storeActions.SAVE_VAPS, this.lineItems.vaps, false);
this.dispatchStoreAction( this.dispatchStoreAction(
@ -402,19 +402,19 @@ export default {
{ {
activePromos: this.lineItems.promos, activePromos: this.lineItems.promos,
}, },
false, false
); );
const payment = this.$store.getters.payment; const payment = this.$store.getters.payment;
if (payment.isInsurance) { if (payment.isInsurance) {
this.$router.navigateWithSaving( this.$router.navigateWithSaving(
this.navigationScenarios.CLICKED_FORWARD_WITH_INSURANCE, this.navigationScenarios.CLICKED_FORWARD_WITH_INSURANCE,
this.$route, this.$route
); );
} else { } else {
this.$router.navigateWithSaving( this.$router.navigateWithSaving(
this.navigationScenarios.CLICKED_FORWARD_WITH_CASH, this.navigationScenarios.CLICKED_FORWARD_WITH_CASH,
this.$route, this.$route
); );
} }
}, },
@ -425,16 +425,16 @@ export default {
this.lineItems.promos?.length > 0 this.lineItems.promos?.length > 0
? this.$refs.servicePackage.getDiscountedPackagePriceString( ? this.$refs.servicePackage.getDiscountedPackagePriceString(
packageNames.TIER_ONE, packageNames.TIER_ONE,
false, false
) )
: this.$refs.servicePackage.getPackagePriceString( : this.$refs.servicePackage.getPackagePriceString(
packageNames.TIER_ONE, packageNames.TIER_ONE
); );
this.pushEventToGA( this.pushEventToGA(
this.$route.query[this.queryStrings.FMG_PAGE], this.$route.query[this.queryStrings.FMG_PAGE],
this.GaActions.CASH_QUOTE_DISPLAYED, this.GaActions.CASH_QUOTE_DISPLAYED,
tierOnePrice, tierOnePrice,
true, true
); );
} }
}); });
@ -457,10 +457,10 @@ export default {
} }
if (oldValue.promos.length < newValue.promos.length) { if (oldValue.promos.length < newValue.promos.length) {
const oldPromoCodes = oldValue.promos.map( const oldPromoCodes = oldValue.promos.map(
(promoObject) => promoObject.promoCode, (promoObject) => promoObject.promoCode
); );
const newlyActivatedPromoCodes = newValue.promos.filter( const newlyActivatedPromoCodes = newValue.promos.filter(
(newPromo) => !oldPromoCodes.includes(newPromo.promoCode), (newPromo) => !oldPromoCodes.includes(newPromo.promoCode)
); );
const alert = createPromoSuccessAlert(newlyActivatedPromoCodes[0].promoCode); const alert = createPromoSuccessAlert(newlyActivatedPromoCodes[0].promoCode);
this.$refs.funnelHeader.pushGlobalAlert(alert, alert.shouldAutoFade); this.$refs.funnelHeader.pushGlobalAlert(alert, alert.shouldAutoFade);

View file

@ -68,7 +68,7 @@ export default {
}, },
recalBody() { recalBody() {
return splitCopyOnCMSPlaceHolder( return splitCopyOnCMSPlaceHolder(
this.getCmsContent(this.cmsWidgetName, "SubheaderText"), this.getCmsContent(this.cmsWidgetName, "SubheaderText")
); );
}, },
}, },

View file

@ -119,11 +119,11 @@ describe("service-package-question.vue", () => {
wrapper.vm.isServicePackageDiscountOnOrder = containsLineItemWithPartType( wrapper.vm.isServicePackageDiscountOnOrder = containsLineItemWithPartType(
partType, partType,
mockProps.lineItems.supportingItems, mockProps.lineItems.supportingItems
); );
const servicePackageDiscountLineItem = findLineItemsWithPartType( const servicePackageDiscountLineItem = findLineItemsWithPartType(
partType, partType,
mockProps.lineItems.supportingItems, mockProps.lineItems.supportingItems
); );
wrapper.vm.getServicePackageDiscountPrice(); wrapper.vm.getServicePackageDiscountPrice();
const price = baseMixin.methods.getTotalLineItemPrice(servicePackageDiscountLineItem[0]); const price = baseMixin.methods.getTotalLineItemPrice(servicePackageDiscountLineItem[0]);
@ -159,7 +159,7 @@ describe("service-package-question.vue", () => {
// Assert // Assert
expect( expect(
wrapper.vm.servicePackageAnswers[0].buttonAuxillaryCopy.includes("As little as"), wrapper.vm.servicePackageAnswers[0].buttonAuxillaryCopy.includes("As little as")
).toBe(true); ).toBe(true);
}); });
it("should return [] from nullSafeAvailableLineItems and not error out if availableLineItems is null", () => { it("should return [] from nullSafeAvailableLineItems and not error out if availableLineItems is null", () => {
@ -209,14 +209,14 @@ describe("service-package-question.vue", () => {
// economy answer // economy answer
runPackageAnswerExpectStatements( runPackageAnswerExpectStatements(
wrapper.vm.servicePackageAnswers[0], wrapper.vm.servicePackageAnswers[0],
expectedModifiedAnswers[packageNameKey].tierOne, expectedModifiedAnswers[packageNameKey].tierOne
); );
// standard answer should not be created // standard answer should not be created
expect(wrapper.vm.servicePackageAnswers.length).toBe(2); expect(wrapper.vm.servicePackageAnswers.length).toBe(2);
// premium answer // premium answer
runPackageAnswerExpectStatements( runPackageAnswerExpectStatements(
wrapper.vm.servicePackageAnswers[1], wrapper.vm.servicePackageAnswers[1],
expectedModifiedAnswers[packageNameKey].tierThree, expectedModifiedAnswers[packageNameKey].tierThree
); );
}); });
it("should not select a default package if isInsurance is null", async () => { it("should not select a default package if isInsurance is null", async () => {
@ -456,17 +456,17 @@ describe("service-package-question.vue, matching business rules for package disp
// economy answer // economy answer
runPackageAnswerExpectStatements( runPackageAnswerExpectStatements(
wrapper.vm.servicePackageAnswers[0], wrapper.vm.servicePackageAnswers[0],
expectedModifiedAnswers[packageNameKey].tierOne, expectedModifiedAnswers[packageNameKey].tierOne
); );
// standard answer // standard answer
runPackageAnswerExpectStatements( runPackageAnswerExpectStatements(
wrapper.vm.servicePackageAnswers[1], wrapper.vm.servicePackageAnswers[1],
expectedModifiedAnswers[packageNameKey].tierTwo, expectedModifiedAnswers[packageNameKey].tierTwo
); );
// premium answer // premium answer
runPackageAnswerExpectStatements( runPackageAnswerExpectStatements(
wrapper.vm.servicePackageAnswers[2], wrapper.vm.servicePackageAnswers[2],
expectedModifiedAnswers[packageNameKey].tierThree, expectedModifiedAnswers[packageNameKey].tierThree
); );
}); });
it("should match the 05_01_CSR_Quote_Recal mock", () => { it("should match the 05_01_CSR_Quote_Recal mock", () => {
@ -496,17 +496,17 @@ describe("service-package-question.vue, matching business rules for package disp
// economy answer // economy answer
runPackageAnswerExpectStatements( runPackageAnswerExpectStatements(
wrapper.vm.servicePackageAnswers[0], wrapper.vm.servicePackageAnswers[0],
expectedModifiedAnswers[packageNameKey].tierOne, expectedModifiedAnswers[packageNameKey].tierOne
); );
// standard answer // standard answer
runPackageAnswerExpectStatements( runPackageAnswerExpectStatements(
wrapper.vm.servicePackageAnswers[1], wrapper.vm.servicePackageAnswers[1],
expectedModifiedAnswers[packageNameKey].tierTwo, expectedModifiedAnswers[packageNameKey].tierTwo
); );
// premium answer // premium answer
runPackageAnswerExpectStatements( runPackageAnswerExpectStatements(
wrapper.vm.servicePackageAnswers[2], wrapper.vm.servicePackageAnswers[2],
expectedModifiedAnswers[packageNameKey].tierThree, expectedModifiedAnswers[packageNameKey].tierThree
); );
}); });
it("should match the 05_01_CSR_Quote_RearGlass mock", () => { it("should match the 05_01_CSR_Quote_RearGlass mock", () => {
@ -536,17 +536,17 @@ describe("service-package-question.vue, matching business rules for package disp
// economy answer // economy answer
runPackageAnswerExpectStatements( runPackageAnswerExpectStatements(
wrapper.vm.servicePackageAnswers[0], wrapper.vm.servicePackageAnswers[0],
expectedModifiedAnswers[packageNameKey].tierOne, expectedModifiedAnswers[packageNameKey].tierOne
); );
// standard answer // standard answer
runPackageAnswerExpectStatements( runPackageAnswerExpectStatements(
wrapper.vm.servicePackageAnswers[1], wrapper.vm.servicePackageAnswers[1],
expectedModifiedAnswers[packageNameKey].tierTwo, expectedModifiedAnswers[packageNameKey].tierTwo
); );
// premium answer // premium answer
runPackageAnswerExpectStatements( runPackageAnswerExpectStatements(
wrapper.vm.servicePackageAnswers[2], wrapper.vm.servicePackageAnswers[2],
expectedModifiedAnswers[packageNameKey].tierThree, expectedModifiedAnswers[packageNameKey].tierThree
); );
}); });
it("should match the 05_01_CSR_Quote_RearGlass+NonWindshield mock", () => { it("should match the 05_01_CSR_Quote_RearGlass+NonWindshield mock", () => {
@ -580,17 +580,17 @@ describe("service-package-question.vue, matching business rules for package disp
// economy answer // economy answer
runPackageAnswerExpectStatements( runPackageAnswerExpectStatements(
wrapper.vm.servicePackageAnswers[0], wrapper.vm.servicePackageAnswers[0],
expectedModifiedAnswers[packageNameKey].tierOne, expectedModifiedAnswers[packageNameKey].tierOne
); );
// standard answer // standard answer
runPackageAnswerExpectStatements( runPackageAnswerExpectStatements(
wrapper.vm.servicePackageAnswers[1], wrapper.vm.servicePackageAnswers[1],
expectedModifiedAnswers[packageNameKey].tierTwo, expectedModifiedAnswers[packageNameKey].tierTwo
); );
// premium answer // premium answer
runPackageAnswerExpectStatements( runPackageAnswerExpectStatements(
wrapper.vm.servicePackageAnswers[2], wrapper.vm.servicePackageAnswers[2],
expectedModifiedAnswers[packageNameKey].tierThree, expectedModifiedAnswers[packageNameKey].tierThree
); );
}); });
it("should match the 05_01_CSR_Quote_RearGlass+Windshield mock", () => { it("should match the 05_01_CSR_Quote_RearGlass+Windshield mock", () => {
@ -623,17 +623,17 @@ describe("service-package-question.vue, matching business rules for package disp
// economy answer // economy answer
runPackageAnswerExpectStatements( runPackageAnswerExpectStatements(
wrapper.vm.servicePackageAnswers[0], wrapper.vm.servicePackageAnswers[0],
expectedModifiedAnswers[packageNameKey].tierOne, expectedModifiedAnswers[packageNameKey].tierOne
); );
// standard answer // standard answer
runPackageAnswerExpectStatements( runPackageAnswerExpectStatements(
wrapper.vm.servicePackageAnswers[1], wrapper.vm.servicePackageAnswers[1],
expectedModifiedAnswers[packageNameKey].tierTwo, expectedModifiedAnswers[packageNameKey].tierTwo
); );
// premium answer // premium answer
runPackageAnswerExpectStatements( runPackageAnswerExpectStatements(
wrapper.vm.servicePackageAnswers[2], wrapper.vm.servicePackageAnswers[2],
expectedModifiedAnswers[packageNameKey].tierThree, expectedModifiedAnswers[packageNameKey].tierThree
); );
}); });
it("should match the 05_01_CSR_Quote_RearGlassNoFrontFit mock", () => { it("should match the 05_01_CSR_Quote_RearGlassNoFrontFit mock", () => {
@ -661,17 +661,17 @@ describe("service-package-question.vue, matching business rules for package disp
// economy answer // economy answer
runPackageAnswerExpectStatements( runPackageAnswerExpectStatements(
wrapper.vm.servicePackageAnswers[0], wrapper.vm.servicePackageAnswers[0],
expectedModifiedAnswers[packageNameKey].tierOne, expectedModifiedAnswers[packageNameKey].tierOne
); );
// standard answer // standard answer
runPackageAnswerExpectStatements( runPackageAnswerExpectStatements(
wrapper.vm.servicePackageAnswers[1], wrapper.vm.servicePackageAnswers[1],
expectedModifiedAnswers[packageNameKey].tierTwo, expectedModifiedAnswers[packageNameKey].tierTwo
); );
// premium answer // premium answer
runPackageAnswerExpectStatements( runPackageAnswerExpectStatements(
wrapper.vm.servicePackageAnswers[2], wrapper.vm.servicePackageAnswers[2],
expectedModifiedAnswers[packageNameKey].tierThree, expectedModifiedAnswers[packageNameKey].tierThree
); );
}); });
it("should match the 05_01_CSR_Quote_Windshield+SideGlass mock", () => { it("should match the 05_01_CSR_Quote_Windshield+SideGlass mock", () => {
@ -704,17 +704,17 @@ describe("service-package-question.vue, matching business rules for package disp
// economy answer // economy answer
runPackageAnswerExpectStatements( runPackageAnswerExpectStatements(
wrapper.vm.servicePackageAnswers[0], wrapper.vm.servicePackageAnswers[0],
expectedModifiedAnswers[packageNameKey].tierOne, expectedModifiedAnswers[packageNameKey].tierOne
); );
// standard answer // standard answer
runPackageAnswerExpectStatements( runPackageAnswerExpectStatements(
wrapper.vm.servicePackageAnswers[1], wrapper.vm.servicePackageAnswers[1],
expectedModifiedAnswers[packageNameKey].tierTwo, expectedModifiedAnswers[packageNameKey].tierTwo
); );
// premium answer // premium answer
runPackageAnswerExpectStatements( runPackageAnswerExpectStatements(
wrapper.vm.servicePackageAnswers[2], wrapper.vm.servicePackageAnswers[2],
expectedModifiedAnswers[packageNameKey].tierThree, expectedModifiedAnswers[packageNameKey].tierThree
); );
}); });
it("should match the 05_01_CSR_Quote_SideGlass mock", () => { it("should match the 05_01_CSR_Quote_SideGlass mock", () => {
@ -744,14 +744,14 @@ describe("service-package-question.vue, matching business rules for package disp
// economy answer // economy answer
runPackageAnswerExpectStatements( runPackageAnswerExpectStatements(
wrapper.vm.servicePackageAnswers[0], wrapper.vm.servicePackageAnswers[0],
expectedModifiedAnswers[packageNameKey].tierOne, expectedModifiedAnswers[packageNameKey].tierOne
); );
// standard answer should not be created // standard answer should not be created
expect(wrapper.vm.servicePackageAnswers.length).toBe(2); expect(wrapper.vm.servicePackageAnswers.length).toBe(2);
// premium answer // premium answer
runPackageAnswerExpectStatements( runPackageAnswerExpectStatements(
wrapper.vm.servicePackageAnswers[1], wrapper.vm.servicePackageAnswers[1],
expectedModifiedAnswers[packageNameKey].tierThree, expectedModifiedAnswers[packageNameKey].tierThree
); );
}); });
it("should match the 05_01_CSR_Quote_NoWiperFit mock", () => { it("should match the 05_01_CSR_Quote_NoWiperFit mock", () => {
@ -778,14 +778,14 @@ describe("service-package-question.vue, matching business rules for package disp
// economy answer // economy answer
runPackageAnswerExpectStatements( runPackageAnswerExpectStatements(
wrapper.vm.servicePackageAnswers[0], wrapper.vm.servicePackageAnswers[0],
expectedModifiedAnswers[packageNameKey].tierOne, expectedModifiedAnswers[packageNameKey].tierOne
); );
// standard answer should not be created // standard answer should not be created
expect(wrapper.vm.servicePackageAnswers.length).toBe(2); expect(wrapper.vm.servicePackageAnswers.length).toBe(2);
// premium answer // premium answer
runPackageAnswerExpectStatements( runPackageAnswerExpectStatements(
wrapper.vm.servicePackageAnswers[1], wrapper.vm.servicePackageAnswers[1],
expectedModifiedAnswers[packageNameKey].tierThree, expectedModifiedAnswers[packageNameKey].tierThree
); );
}); });
}); });

View file

@ -78,11 +78,11 @@ export default {
if ( if (
containsLineItemWithPartType( containsLineItemWithPartType(
partTypeStrings.SERVICE_PACKAGE_DISCOUNT, partTypeStrings.SERVICE_PACKAGE_DISCOUNT,
supportingItems, supportingItems
) )
) { ) {
supportingItems = supportingItems.filter( supportingItems = supportingItems.filter(
(item) => item.partType !== partTypeStrings.SERVICE_PACKAGE_DISCOUNT, (item) => item.partType !== partTypeStrings.SERVICE_PACKAGE_DISCOUNT
); );
} }
if ( if (
@ -114,11 +114,11 @@ export default {
const availablePackages = getAvailablePackages( const availablePackages = getAvailablePackages(
this.glassToReplace, this.glassToReplace,
this.nullSafeAvailableLineItems, this.nullSafeAvailableLineItems,
this.isRepair, this.isRepair
); );
cmsAnswersContent = cmsAnswersContent.filter((answer) => cmsAnswersContent = cmsAnswersContent.filter((answer) =>
availablePackages.some((tier) => answer.Name === tier.packageName), availablePackages.some((tier) => answer.Name === tier.packageName)
); );
const modifiedAnswers = cmsAnswersContent.map((answer) => ({ const modifiedAnswers = cmsAnswersContent.map((answer) => ({
@ -129,7 +129,7 @@ export default {
//The package supports service-package-discount if it has the text value in CMS //The package supports service-package-discount if it has the text value in CMS
buttonAuxillaryCopy: this.getDiscountedPackagePriceString( buttonAuxillaryCopy: this.getDiscountedPackagePriceString(
answer.Name, answer.Name,
this.isServicePackageDiscountOnOrder && answer.Text != "", this.isServicePackageDiscountOnOrder && answer.Text != ""
), ),
buttonFooterCopy: this.getFooterTextFromCms(answer.SubWidgetName), buttonFooterCopy: this.getFooterTextFromCms(answer.SubWidgetName),
additionalButtonData: { additionalButtonData: {
@ -144,13 +144,13 @@ export default {
isRecalibrationOnOrder() { isRecalibrationOnOrder() {
return containsLineItemWithPartType( return containsLineItemWithPartType(
partTypeStrings.RECALIBRATION, partTypeStrings.RECALIBRATION,
this.nullSafeAvailableLineItems, this.nullSafeAvailableLineItems
); );
}, },
isServicePackageDiscountOnOrder() { isServicePackageDiscountOnOrder() {
return containsLineItemWithPartType( return containsLineItemWithPartType(
partTypeStrings.SERVICE_PACKAGE_DISCOUNT, partTypeStrings.SERVICE_PACKAGE_DISCOUNT,
this.nullSafeAvailableLineItems, this.nullSafeAvailableLineItems
); );
}, },
frontWipersApplicableForTierTwo() { frontWipersApplicableForTierTwo() {
@ -158,7 +158,7 @@ export default {
this.glassToReplace, this.glassToReplace,
this.nullSafeAvailableLineItems, this.nullSafeAvailableLineItems,
this.isRepair, this.isRepair,
packageNames.TIER_TWO, packageNames.TIER_TWO
); );
}, },
rearWiperApplicableForTierTwo() { rearWiperApplicableForTierTwo() {
@ -166,7 +166,7 @@ export default {
this.glassToReplace, this.glassToReplace,
this.nullSafeAvailableLineItems, this.nullSafeAvailableLineItems,
this.isRepair, this.isRepair,
packageNames.TIER_TWO, packageNames.TIER_TWO
); );
}, },
frontWipersApplicableForTierThree() { frontWipersApplicableForTierThree() {
@ -174,7 +174,7 @@ export default {
this.glassToReplace, this.glassToReplace,
this.nullSafeAvailableLineItems, this.nullSafeAvailableLineItems,
this.isRepair, this.isRepair,
packageNames.TIER_THREE, packageNames.TIER_THREE
); );
}, },
rearWiperApplicableForTierThree() { rearWiperApplicableForTierThree() {
@ -182,7 +182,7 @@ export default {
this.glassToReplace, this.glassToReplace,
this.nullSafeAvailableLineItems, this.nullSafeAvailableLineItems,
this.isRepair, this.isRepair,
packageNames.TIER_THREE, packageNames.TIER_THREE
); );
}, },
rainDefenseApplicableForTierThree() { rainDefenseApplicableForTierThree() {
@ -190,7 +190,7 @@ export default {
this.glassToReplace, this.glassToReplace,
this.nullSafeAvailableLineItems, this.nullSafeAvailableLineItems,
this.isRepair, this.isRepair,
packageNames.TIER_THREE, packageNames.TIER_THREE
); );
}, },
glassToReplace() { glassToReplace() {
@ -202,7 +202,7 @@ export default {
servicePackageDiscountParts() { servicePackageDiscountParts() {
return findLineItemsWithPartType( return findLineItemsWithPartType(
partTypeStrings.SERVICE_PACKAGE_DISCOUNT, partTypeStrings.SERVICE_PACKAGE_DISCOUNT,
this.nullSafeAvailableLineItems, this.nullSafeAvailableLineItems
); );
}, },
}, },
@ -227,7 +227,7 @@ export default {
this.getPackagePrice(packageName, { this.getPackagePrice(packageName, {
discountedPrice: false, discountedPrice: false,
servicePackageDiscount: false, servicePackageDiscount: false,
}), })
).toFixed(2); ).toFixed(2);
return "$" + formattedPriceFloat; return "$" + formattedPriceFloat;
}, },
@ -236,7 +236,7 @@ export default {
this.getPackagePrice(packageName, { this.getPackagePrice(packageName, {
discountedPrice: true, discountedPrice: true,
servicePackageDiscount, servicePackageDiscount,
}), })
).toFixed(2); ).toFixed(2);
return (this.isInsuranceSelected ? "As little as $" : "$") + formattedPriceFloat; return (this.isInsuranceSelected ? "As little as $" : "$") + formattedPriceFloat;
}, },
@ -264,7 +264,7 @@ export default {
let priceFloat = this.isInsuranceSelected let priceFloat = this.isInsuranceSelected
? 0 ? 0
: baseMixin.methods.getTierOnePackagePrice( : baseMixin.methods.getTierOnePackagePrice(
baseMixin.methods.filterOutFees(lineItemsToPrice), baseMixin.methods.filterOutFees(lineItemsToPrice)
); );
priceFloat += this.getVapsPrice(packageName, discountedPrice); priceFloat += this.getVapsPrice(packageName, discountedPrice);
@ -275,7 +275,7 @@ export default {
if (this.isServicePackageDiscountOnOrder) { if (this.isServicePackageDiscountOnOrder) {
let price = 0; let price = 0;
price += baseMixin.methods.getTotalLineItemPrice( price += baseMixin.methods.getTotalLineItemPrice(
this.servicePackageDiscountParts[0], this.servicePackageDiscountParts[0]
); );
return Math.abs(price); return Math.abs(price);
} }
@ -291,7 +291,7 @@ export default {
if (applyPromoDiscounts && this.activePromos) { if (applyPromoDiscounts && this.activePromos) {
const relevantPromos = getPromosThatMatchLineItemsOnOrder( const relevantPromos = getPromosThatMatchLineItemsOnOrder(
this.activePromos, this.activePromos,
vapsItems, vapsItems
); );
relevantPromos.forEach((promo) => { relevantPromos.forEach((promo) => {
price += baseMixin.methods.getTotalLineItemPrice(promo); price += baseMixin.methods.getTotalLineItemPrice(promo);
@ -308,19 +308,19 @@ export default {
const promosWithAddableVaps = getPromosWithAddableVaps(this.activePromos); const promosWithAddableVaps = getPromosWithAddableVaps(this.activePromos);
const vapsThatMatchPromos = getLineItemsThatMatchPromos( const vapsThatMatchPromos = getLineItemsThatMatchPromos(
promosWithAddableVaps, promosWithAddableVaps,
this.nullSafeAvailableLineItems, this.nullSafeAvailableLineItems
); );
const vapsFromStore = this.$store.getters.lineItems.vaps ?? []; const vapsFromStore = this.$store.getters.lineItems.vaps ?? [];
const vapsToUseForDefaultPackageSelection = this.combineLineItemsWithoutDuplicates( const vapsToUseForDefaultPackageSelection = this.combineLineItemsWithoutDuplicates(
vapsThatMatchPromos, vapsThatMatchPromos,
vapsFromStore, vapsFromStore
); );
this.selectedPackageName = getHighestRequiredTier( this.selectedPackageName = getHighestRequiredTier(
this.glassToReplace, this.glassToReplace,
this.nullSafeAvailableLineItems, this.nullSafeAvailableLineItems,
this.isRepair, this.isRepair,
vapsToUseForDefaultPackageSelection, vapsToUseForDefaultPackageSelection
); );
}, },
getVapsLineItemsForSelectedPackage(packageName) { getVapsLineItemsForSelectedPackage(packageName) {
@ -328,14 +328,14 @@ export default {
this.glassToReplace, this.glassToReplace,
this.nullSafeAvailableLineItems, this.nullSafeAvailableLineItems,
this.isRepair, this.isRepair,
packageName, packageName
); );
let vapsLineItemsForSelectedPackage = []; let vapsLineItemsForSelectedPackage = [];
packageContentTypes.forEach((vapType) => { packageContentTypes.forEach((vapType) => {
vapsLineItemsForSelectedPackage.push( vapsLineItemsForSelectedPackage.push(
...findLineItemsWithPartType(vapType, this.nullSafeAvailableLineItems), ...findLineItemsWithPartType(vapType, this.nullSafeAvailableLineItems)
); );
}); });
@ -343,7 +343,7 @@ export default {
}, },
getServicePackageDiscountPartForSelectedPackage(packageName) { getServicePackageDiscountPartForSelectedPackage(packageName) {
const selectedPackage = this.servicePackageAnswers.filter( const selectedPackage = this.servicePackageAnswers.filter(
(item) => item.value === packageName, (item) => item.value === packageName
); );
if (selectedPackage?.[0]?.additionalButtonData?.servicePackageDiscount) { if (selectedPackage?.[0]?.additionalButtonData?.servicePackageDiscount) {
return this.servicePackageDiscountParts; return this.servicePackageDiscountParts;

View file

@ -111,7 +111,7 @@ export default {
}, },
shouldDisplayStrikeThroughPrice() { shouldDisplayStrikeThroughPrice() {
const displayPrice = this.buttonAuxillaryCopy.substring( const displayPrice = this.buttonAuxillaryCopy.substring(
this.buttonAuxillaryCopy.indexOf("$"), this.buttonAuxillaryCopy.indexOf("$")
); );
return displayPrice != this.additionalButtonData.strikeThroughPrice; return displayPrice != this.additionalButtonData.strikeThroughPrice;
}, },

View file

@ -7,7 +7,7 @@ export async function getAlertReasons(ctu) {
{ {
ctu: ctu, ctu: ctu,
}, },
"schedule", "schedule"
); );
return Promise.resolve(alertReasons); return Promise.resolve(alertReasons);

View file

@ -245,7 +245,7 @@ describe("schedule.vue...", () => {
// Act // Act
const newShopTimeSlots = await wrapper.vm.getAvailableDatesMethod( const newShopTimeSlots = await wrapper.vm.getAvailableDatesMethod(
"2023-01-01", "2023-01-01",
"2023-01-31", "2023-01-31"
); );
// Assert // Assert
@ -281,7 +281,7 @@ describe("schedule.vue...", () => {
"2023-01-01", "2023-01-01",
"2023-03-31", "2023-03-31",
"Inshop", "Inshop",
"123", "123"
); );
// Assert // Assert
@ -290,7 +290,7 @@ describe("schedule.vue...", () => {
"getShopTimeSlots", "getShopTimeSlots",
expect.anything(), expect.anything(),
expect.anything(), expect.anything(),
expect.anything(), expect.anything()
); );
}); });
@ -311,7 +311,7 @@ describe("schedule.vue...", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "schedule" } }, { query: { fmgPage: "schedule" } },
undefined, undefined,
nextFunction, nextFunction
); );
// Assert // Assert
@ -320,7 +320,7 @@ describe("schedule.vue...", () => {
expect(wrapper.vm.$refs.datePicker.initializeComponent).toHaveBeenCalledWith( expect(wrapper.vm.$refs.datePicker.initializeComponent).toHaveBeenCalledWith(
expect.objectContaining({ expect.objectContaining({
calendarViewDirection: "future", calendarViewDirection: "future",
}), })
); );
expect(wrapper.vm.$refs.locationAlerts.initializeComponent).toHaveBeenCalled(); expect(wrapper.vm.$refs.locationAlerts.initializeComponent).toHaveBeenCalled();
expect(wrapper.vm.selectableDatesData).toStrictEqual( expect(wrapper.vm.selectableDatesData).toStrictEqual(
@ -328,12 +328,12 @@ describe("schedule.vue...", () => {
days: expect.any(Array), days: expect.any(Array),
estimatedServiceMinutesMaximum: expect.any(Number), estimatedServiceMinutesMaximum: expect.any(Number),
estimatedServiceMinutesMinimum: expect.any(Number), estimatedServiceMinutesMinimum: expect.any(Number),
}), })
); );
expect(wrapper.vm.mobilePremiumAppointmentFee).toStrictEqual( expect(wrapper.vm.mobilePremiumAppointmentFee).toStrictEqual(
expect.objectContaining({ expect.objectContaining({
partNumber: expect.any(String), partNumber: expect.any(String),
}), })
); );
expect(wrapper.vm.updateFooterButtonText).toHaveBeenCalled(); expect(wrapper.vm.updateFooterButtonText).toHaveBeenCalled();
}); });
@ -375,7 +375,7 @@ describe("schedule.vue...", () => {
expect(testValue).toStrictEqual( expect(testValue).toStrictEqual(
expect.objectContaining({ expect.objectContaining({
date: "2022-11-11", date: "2022-11-11",
}), })
); );
}); });
@ -514,7 +514,7 @@ describe("schedule.vue...", () => {
// Assert // Assert
expect(wrapper.vm.$router.navigateWithoutSaving).toBeCalledWith( expect(wrapper.vm.$router.navigateWithoutSaving).toBeCalledWith(
"CLICKED_BACK", "CLICKED_BACK",
"testRoute", "testRoute"
); );
}); });
}); });
@ -579,7 +579,7 @@ describe("schedule.vue...", () => {
partType: "EARLY BIRD", partType: "EARLY BIRD",
}), }),
]), ]),
expect.anything(), expect.anything()
); );
}); });
@ -624,7 +624,7 @@ describe("schedule.vue...", () => {
partType: "EARLY BIRD", partType: "EARLY BIRD",
}), }),
]), ]),
expect.anything(), expect.anything()
); );
}); });

View file

@ -106,7 +106,7 @@ const getAvailableDates = async (
startDateString, startDateString,
endDateString, endDateString,
appointmentType, appointmentType,
providerNumber, providerNumber
) => { ) => {
const apiEndDateLimit = sumDateString(startDateString, TIME_SLOTS_CALL_DAYS_LIMIT); const apiEndDateLimit = sumDateString(startDateString, TIME_SLOTS_CALL_DAYS_LIMIT);
const difference = calcDaysBetweenDates(startDateString, endDateString); const difference = calcDaysBetweenDates(startDateString, endDateString);
@ -172,7 +172,7 @@ const getAvailableDates = async (
storeAction.storeAction, storeAction.storeAction,
storeAction.payload, storeAction.payload,
"schedule", "schedule",
false, false
); );
timeSlotsResponsesData.estimatedServiceMinutesMinimum = timeSlotsResponsesData.estimatedServiceMinutesMinimum =
timeSlotsResponse.data.estimatedServiceMinutesMinimum; timeSlotsResponse.data.estimatedServiceMinutesMinimum;
@ -182,7 +182,7 @@ const getAvailableDates = async (
...timeSlotsResponsesData.days, ...timeSlotsResponsesData.days,
...timeSlotsResponse.data.days, ...timeSlotsResponse.data.days,
]; ];
}), })
); );
}; };
@ -222,7 +222,7 @@ export default {
const premiumFeePromise = baseMixin.methods.dispatchStoreActionWithLogging( const premiumFeePromise = baseMixin.methods.dispatchStoreActionWithLogging(
storeActions.GET_MOBILE_PREMIUM_FEE, storeActions.GET_MOBILE_PREMIUM_FEE,
null, null,
"schedule", "schedule"
); );
const premiumFeeWithPricePromise = premiumFeePromise.then((result) => { const premiumFeeWithPricePromise = premiumFeePromise.then((result) => {
@ -233,7 +233,7 @@ export default {
availableLineItems: [result.data], availableLineItems: [result.data],
}, },
"schedule", "schedule",
false, false
); );
} else { } else {
return result.data; return result.data;
@ -242,7 +242,7 @@ export default {
const alertReasonsPromise = locationAlerts.methods.loadInitialData( const alertReasonsPromise = locationAlerts.methods.loadInitialData(
store.getters.order.serviceLocation.zipCodeCtu, store.getters.order.serviceLocation.zipCodeCtu,
store.getters.order.serviceLocation.provider?.address?.zipCodeCtu, store.getters.order.serviceLocation.provider?.address?.zipCodeCtu
); );
// Settle promises and get results // Settle promises and get results
@ -296,7 +296,7 @@ export default {
} }
return this.selectableDatesData.days?.find( return this.selectableDatesData.days?.find(
(selectableDate) => selectableDate.date === this.selectedDate, (selectableDate) => selectableDate.date === this.selectedDate
); );
}, },
}, },
@ -326,11 +326,11 @@ export default {
startDate, startDate,
endDate, endDate,
this.appointmentType, this.appointmentType,
this.$store.getters.order.serviceLocation.provider.providerNumber, this.$store.getters.order.serviceLocation.provider.providerNumber
); );
// ADD API CALL RESULTS TO EXISTING DATE DATA // ADD API CALL RESULTS TO EXISTING DATE DATA
this.selectableDatesData.days = this.selectableDatesData.days.concat( this.selectableDatesData.days = this.selectableDatesData.days.concat(
newShopTimeSlots.days, newShopTimeSlots.days
); );
return newShopTimeSlots; return newShopTimeSlots;
}, },
@ -351,7 +351,7 @@ export default {
if (supportingItems) { if (supportingItems) {
isPremiumAppointment = isPremiumAppointment =
!!supportingItems.filter( !!supportingItems.filter(
(lineItem) => lineItem.partType === PREMIUM_FEE_PART_TYPE, (lineItem) => lineItem.partType === PREMIUM_FEE_PART_TYPE
).length > 0; ).length > 0;
} }
@ -377,12 +377,12 @@ export default {
navbarButtonText = "Continue"; navbarButtonText = "Continue";
} else { } else {
navbarButtonText = `Select ${this.convertSelectedDateToShortMonthAndDay( navbarButtonText = `Select ${this.convertSelectedDateToShortMonthAndDay(
timeSlotInfo.timeSlot.date, timeSlotInfo.timeSlot.date
)}`; )}`;
if (this.appointmentType === AppointmentTypeStrings.IN_SHOP) { if (this.appointmentType === AppointmentTypeStrings.IN_SHOP) {
navbarButtonText += ` at ${this.getDisplayTextForMilitaryTime( navbarButtonText += ` at ${this.getDisplayTextForMilitaryTime(
timeSlotInfo.timeSlot.startTime, timeSlotInfo.timeSlot.startTime
)}`; )}`;
} else if ( } else if (
this.appointmentType === AppointmentTypeStrings.MOBILE && this.appointmentType === AppointmentTypeStrings.MOBILE &&
@ -390,10 +390,10 @@ export default {
) { ) {
navbarButtonText += ` at ${this.getDisplayTextForMilitaryTime( navbarButtonText += ` at ${this.getDisplayTextForMilitaryTime(
timeSlotInfo.timeSlot.startTime, timeSlotInfo.timeSlot.startTime,
true, true
)} - ${this.getDisplayTextForMilitaryTime( )} - ${this.getDisplayTextForMilitaryTime(
timeSlotInfo.timeSlot.endTime, timeSlotInfo.timeSlot.endTime,
true, true
)}`; )}`;
} }
} }
@ -430,7 +430,7 @@ export default {
this.dispatchStoreAction( this.dispatchStoreAction(
this.storeActions.SAVE_SCHEDULE, this.storeActions.SAVE_SCHEDULE,
this.selectedTimeSlotInfo.timeSlot, this.selectedTimeSlotInfo.timeSlot,
false, false
); );
this.$router.navigateWithSaving(this.navigationScenarios.CLICKED_FORWARD, this.$route); this.$router.navigateWithSaving(this.navigationScenarios.CLICKED_FORWARD, this.$route);
@ -444,7 +444,7 @@ export default {
this.selectedTimeSlotInfo?.isPremiumAppointment this.selectedTimeSlotInfo?.isPremiumAppointment
) { ) {
const premiumFeeIndex = supportingItems.findIndex( const premiumFeeIndex = supportingItems.findIndex(
(item) => item.partType == PREMIUM_FEE_PART_TYPE, (item) => item.partType == PREMIUM_FEE_PART_TYPE
); );
if (premiumFeeIndex >= 0) { if (premiumFeeIndex >= 0) {
@ -461,7 +461,7 @@ export default {
this.dispatchStoreAction( this.dispatchStoreAction(
this.storeActions.SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING, this.storeActions.SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING,
supportingItems, supportingItems,
false, false
); );
} else { } else {
if (!supportingItems) { if (!supportingItems) {
@ -470,7 +470,7 @@ export default {
// if it's not a mobile and/or premium early bird, then make sure we remove any that may have been added // if it's not a mobile and/or premium early bird, then make sure we remove any that may have been added
const removePremiumFeeIndex = supportingItems.findIndex( const removePremiumFeeIndex = supportingItems.findIndex(
(item) => item.partType == PREMIUM_FEE_PART_TYPE, (item) => item.partType == PREMIUM_FEE_PART_TYPE
); );
if (removePremiumFeeIndex >= 0) { if (removePremiumFeeIndex >= 0) {
@ -478,7 +478,7 @@ export default {
this.dispatchStoreAction( this.dispatchStoreAction(
this.storeActions.SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING, this.storeActions.SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING,
supportingItems, supportingItems,
false, false
); );
} }
} }

View file

@ -117,7 +117,7 @@ describe("time-slot-modal-question.vue Supplemental information", () => {
//Assert //Assert
expect(wrapper.vm.supplementalInformationBlock).toEqual( expect(wrapper.vm.supplementalInformationBlock).toEqual(
mockCmsContent[mobileCmsWidgetName]["BodyText"], mockCmsContent[mobileCmsWidgetName]["BodyText"]
); );
}); });
@ -136,7 +136,7 @@ describe("time-slot-modal-question.vue Supplemental information", () => {
//Assert //Assert
expect(wrapper.vm.supplementalInformationBlock).toEqual( expect(wrapper.vm.supplementalInformationBlock).toEqual(
mockCmsContent[mobileCmsWidgetName]["BodyText"], mockCmsContent[mobileCmsWidgetName]["BodyText"]
); );
}); });
@ -199,7 +199,7 @@ describe("time-slot-modal-question.vue Supplemental information", () => {
//Assert //Assert
expect(wrapper.vm.supplementalInformationBlock).toEqual( expect(wrapper.vm.supplementalInformationBlock).toEqual(
mockCmsContent[dropOffWidgetName]["BodyText"], mockCmsContent[dropOffWidgetName]["BodyText"]
); );
}); });
@ -230,7 +230,7 @@ describe("time-slot-modal-question.vue Supplemental information", () => {
//Assert //Assert
expect(wrapper.vm.supplementalInformationBlock).toEqual( expect(wrapper.vm.supplementalInformationBlock).toEqual(
mockCmsContent[overnightDropOffCmsWidgetName]["BodyText"], mockCmsContent[overnightDropOffCmsWidgetName]["BodyText"]
); );
}); });
@ -279,7 +279,7 @@ describe("time-slot-modal-question.vue Supplemental information", () => {
//Assert //Assert
expect(wrapper.vm.supplementalInformationBlock).toEqual( expect(wrapper.vm.supplementalInformationBlock).toEqual(
mockCmsContent[sameDayDropOffCmsWidgetName]["BodyText"], mockCmsContent[sameDayDropOffCmsWidgetName]["BodyText"]
); );
}); });
}); });
@ -331,7 +331,7 @@ describe("time-slot-modal-list-button-question.vue Disclaimer", () => {
//Assert //Assert
expect(wrapper.vm.disclaimerTextBlockCopy).toEqual( expect(wrapper.vm.disclaimerTextBlockCopy).toEqual(
mockCmsContent[sameDayDropOffCmsWidgetName]["FooterText"], mockCmsContent[sameDayDropOffCmsWidgetName]["FooterText"]
); );
}); });
@ -362,7 +362,7 @@ describe("time-slot-modal-list-button-question.vue Disclaimer", () => {
//Assert //Assert
expect(wrapper.vm.disclaimerTextBlockCopy).toEqual( expect(wrapper.vm.disclaimerTextBlockCopy).toEqual(
mockCmsContent[dropOffWidgetName]["FooterText"], mockCmsContent[dropOffWidgetName]["FooterText"]
); );
}); });
@ -393,7 +393,7 @@ describe("time-slot-modal-list-button-question.vue Disclaimer", () => {
//Assert //Assert
expect(wrapper.vm.disclaimerTextBlockCopy).toEqual( expect(wrapper.vm.disclaimerTextBlockCopy).toEqual(
mockCmsContent[overnightDropOffCmsWidgetName]["FooterText"], mockCmsContent[overnightDropOffCmsWidgetName]["FooterText"]
); );
}); });
@ -473,7 +473,7 @@ describe("time-slot-modal-question.vue Duration", () => {
//Assert //Assert
expect(wrapper.vm.durationTextBlockCopy).toEqual( expect(wrapper.vm.durationTextBlockCopy).toEqual(
mockCmsContent[sameDayDropOffCmsWidgetName]["SubheaderText"], mockCmsContent[sameDayDropOffCmsWidgetName]["SubheaderText"]
); );
}); });
@ -505,7 +505,7 @@ describe("time-slot-modal-question.vue Duration", () => {
//Assert //Assert
expect(wrapper.vm.durationTextBlockCopy).toEqual( expect(wrapper.vm.durationTextBlockCopy).toEqual(
mockCmsContent[overnightDropOffCmsWidgetName]["SubheaderText"], mockCmsContent[overnightDropOffCmsWidgetName]["SubheaderText"]
); );
}); });
@ -536,7 +536,7 @@ describe("time-slot-modal-question.vue Duration", () => {
}); });
//Assert //Assert
expect(wrapper.vm.durationTextBlockCopy).toEqual( expect(wrapper.vm.durationTextBlockCopy).toEqual(
mockCmsContent[dropoffCmsWidgetName]["SubheaderText"], mockCmsContent[dropoffCmsWidgetName]["SubheaderText"]
); );
}); });
@ -568,7 +568,7 @@ describe("time-slot-modal-question.vue Duration", () => {
//Assert //Assert
expect(wrapper.vm.durationTextBlockCopy).toEqual( expect(wrapper.vm.durationTextBlockCopy).toEqual(
mockCmsContent[cmsWidgetName]["SubheaderText"] + " 2 - 3 hours", mockCmsContent[cmsWidgetName]["SubheaderText"] + " 2 - 3 hours"
); );
}); });
@ -588,7 +588,7 @@ describe("time-slot-modal-question.vue Duration", () => {
}); });
//Assert //Assert
expect(wrapper.vm.durationTextBlockCopy).toEqual( expect(wrapper.vm.durationTextBlockCopy).toEqual(
mockCmsContent[cmsWidgetName]["SubheaderText"] + " 60 - 90 minutes", mockCmsContent[cmsWidgetName]["SubheaderText"] + " 60 - 90 minutes"
); );
}); });
@ -608,7 +608,7 @@ describe("time-slot-modal-question.vue Duration", () => {
}); });
//Assert //Assert
expect(wrapper.vm.durationTextBlockCopy).toEqual( expect(wrapper.vm.durationTextBlockCopy).toEqual(
mockCmsContent[cmsWidgetName]["SubheaderText"] + " 4 hours", mockCmsContent[cmsWidgetName]["SubheaderText"] + " 4 hours"
); );
}); });

View file

@ -137,7 +137,7 @@ export default {
const { errorMessage, handleChange, meta, validate, errors } = useField( const { errorMessage, handleChange, meta, validate, errors } = useField(
componentId, componentId,
props.validationRules, props.validationRules,
fieldOptions, fieldOptions
); );
return { return {
@ -162,7 +162,7 @@ export default {
return null; return null;
} else if (this.appointmentType === AppointmentTypeStrings.MOBILE) { } else if (this.appointmentType === AppointmentTypeStrings.MOBILE) {
appointmentTypeCmsWidgetName = this.selectedRouteCode?.includes( appointmentTypeCmsWidgetName = this.selectedRouteCode?.includes(
PREMIUM_TIME_SLOT_ID_FLAG, PREMIUM_TIME_SLOT_ID_FLAG
) )
? this.mobilePremiumCmsWidgetName ? this.mobilePremiumCmsWidgetName
: this.mobileCmsWidgetName; : this.mobileCmsWidgetName;
@ -173,44 +173,44 @@ export default {
appointmentTypeCmsWidgetName = appointmentTypeCmsWidgetName =
this.getRelevantDropOffCmsWidgetNameForSelectedTimeSlot( this.getRelevantDropOffCmsWidgetNameForSelectedTimeSlot(
this.selectedRouteCode, this.selectedRouteCode,
true, true
); );
} }
} }
return this.getCmsContent( return this.getCmsContent(
appointmentTypeCmsWidgetName, appointmentTypeCmsWidgetName,
cmsWidgetFieldMappings.SUPPLEMENTAL_INFORMATION, cmsWidgetFieldMappings.SUPPLEMENTAL_INFORMATION
); );
}, },
footerCloseButtonText() { footerCloseButtonText() {
return this.getCmsContent( return this.getCmsContent(
this.cmsWidgetName, this.cmsWidgetName,
cmsWidgetFieldMappings.MODAL_CLOSE_BUTTON, cmsWidgetFieldMappings.MODAL_CLOSE_BUTTON
); );
}, },
premiumAppointmentButtonText() { premiumAppointmentButtonText() {
return this.getCmsContent( return this.getCmsContent(
this.mobilePremiumCmsWidgetName, this.mobilePremiumCmsWidgetName,
cmsWidgetFieldMappings.TIME_SLOT_BUTTON, cmsWidgetFieldMappings.TIME_SLOT_BUTTON
); );
}, },
dropoffButtonText() { dropoffButtonText() {
return this.getCmsContent( return this.getCmsContent(
this.dropoffCmsWidgetName, this.dropoffCmsWidgetName,
cmsWidgetFieldMappings.TIME_SLOT_BUTTON, cmsWidgetFieldMappings.TIME_SLOT_BUTTON
); );
}, },
sameDayDropoffButtonText() { sameDayDropoffButtonText() {
return this.getCmsContent( return this.getCmsContent(
this.sameDayDropOffCmsWidgetName, this.sameDayDropOffCmsWidgetName,
cmsWidgetFieldMappings.TIME_SLOT_BUTTON, cmsWidgetFieldMappings.TIME_SLOT_BUTTON
); );
}, },
overnightDropoffButtonText() { overnightDropoffButtonText() {
return this.getCmsContent( return this.getCmsContent(
this.overnightDropOffCmsWidgetName, this.overnightDropOffCmsWidgetName,
cmsWidgetFieldMappings.TIME_SLOT_BUTTON, cmsWidgetFieldMappings.TIME_SLOT_BUTTON
); );
}, },
dropoffDisclaimerText() { dropoffDisclaimerText() {
@ -219,13 +219,13 @@ export default {
sameDayDropOffDisclaimerText() { sameDayDropOffDisclaimerText() {
return this.getCmsContent( return this.getCmsContent(
this.sameDayDropOffCmsWidgetName, this.sameDayDropOffCmsWidgetName,
cmsWidgetFieldMappings.DISCLAIMER, cmsWidgetFieldMappings.DISCLAIMER
); );
}, },
overnightDropOffDisclaimerText() { overnightDropOffDisclaimerText() {
return this.getCmsContent( return this.getCmsContent(
this.overnightDropOffCmsWidgetName, this.overnightDropOffCmsWidgetName,
cmsWidgetFieldMappings.DISCLAIMER, cmsWidgetFieldMappings.DISCLAIMER
); );
}, },
disclaimerTextBlockCopy() { disclaimerTextBlockCopy() {
@ -251,24 +251,24 @@ export default {
sameDayDropoffDurationText() { sameDayDropoffDurationText() {
return this.getCmsContent( return this.getCmsContent(
this.sameDayDropOffCmsWidgetName, this.sameDayDropOffCmsWidgetName,
cmsWidgetFieldMappings.DURATION, cmsWidgetFieldMappings.DURATION
); );
}, },
overnightDropoffDurationText() { overnightDropoffDurationText() {
return this.getCmsContent( return this.getCmsContent(
this.overnightDropOffCmsWidgetName, this.overnightDropOffCmsWidgetName,
cmsWidgetFieldMappings.DURATION, cmsWidgetFieldMappings.DURATION
); );
}, },
inshopDurationText() { inshopDurationText() {
const inshopDurationTextWithoutTime = this.getCmsContent( const inshopDurationTextWithoutTime = this.getCmsContent(
this.cmsWidgetName, this.cmsWidgetName,
cmsWidgetFieldMappings.DURATION, cmsWidgetFieldMappings.DURATION
); );
const inshopDurationTime = getDisplayTextForDurationLength( const inshopDurationTime = getDisplayTextForDurationLength(
this.estimatedServiceMinutesMinimum, this.estimatedServiceMinutesMinimum,
this.estimatedServiceMinutesMaximum, this.estimatedServiceMinutesMaximum
); );
return `${inshopDurationTextWithoutTime} ${inshopDurationTime}`; return `${inshopDurationTextWithoutTime} ${inshopDurationTime}`;
@ -322,7 +322,7 @@ export default {
if (this.appointmentType === AppointmentTypeStrings.DROP_OFF) { if (this.appointmentType === AppointmentTypeStrings.DROP_OFF) {
return this.getAvailableTimeSlotsForDropOff( return this.getAvailableTimeSlotsForDropOff(
this.timeSlotsForSelectedDate.timeSlots, this.timeSlotsForSelectedDate.timeSlots
); );
} else if (this.appointmentType === AppointmentTypeStrings.MOBILE) { } else if (this.appointmentType === AppointmentTypeStrings.MOBILE) {
return this.getAvailableTimeSlotsForMobile(this.timeSlotsForSelectedDate.timeSlots); return this.getAvailableTimeSlotsForMobile(this.timeSlotsForSelectedDate.timeSlots);
@ -349,13 +349,13 @@ export default {
async setSelectedTimeSlot() { async setSelectedTimeSlot() {
this.$emit( this.$emit(
"update:modelValue", "update:modelValue",
this.getSelectedTimeSlotInfoObject(this.selectedRouteCode), this.getSelectedTimeSlotInfoObject(this.selectedRouteCode)
); );
this.$emit("TimeSlotSelected"); this.$emit("TimeSlotSelected");
}, },
getRelevantDropOffCmsWidgetNameForSelectedTimeSlot( getRelevantDropOffCmsWidgetNameForSelectedTimeSlot(
selectedRouteCode, selectedRouteCode,
isSameDayRelevant = false, isSameDayRelevant = false
) { ) {
if (selectedRouteCode.includes(RouteCodeFlags.OVERNIGHT_DROP_OFF)) { if (selectedRouteCode.includes(RouteCodeFlags.OVERNIGHT_DROP_OFF)) {
return this.overnightDropOffCmsWidgetName; return this.overnightDropOffCmsWidgetName;
@ -396,7 +396,7 @@ export default {
getAvailableTimeSlotsForMobile(timeSlotsForSelectedDate) { getAvailableTimeSlotsForMobile(timeSlotsForSelectedDate) {
const availableTimeSlots = timeSlotsForSelectedDate.map((timeSlot) => { const availableTimeSlots = timeSlotsForSelectedDate.map((timeSlot) => {
const readableTime = `${militaryToTwelveHourTime( const readableTime = `${militaryToTwelveHourTime(
timeSlot.startTime, timeSlot.startTime
)} - ${militaryToTwelveHourTime(timeSlot.endTime)}`; )} - ${militaryToTwelveHourTime(timeSlot.endTime)}`;
return { return {
value: timeSlot.id, value: timeSlot.id,
@ -409,7 +409,7 @@ export default {
this.premiumAppointmentFee?.partType === PREMIUM_FEE_PART_TYPE; this.premiumAppointmentFee?.partType === PREMIUM_FEE_PART_TYPE;
if (isPremiumTimeSlot && hasPremiumPartAvailable) { if (isPremiumTimeSlot && hasPremiumPartAvailable) {
availableTimeSlots.unshift( availableTimeSlots.unshift(
this.getPremiumAppointmentTimeSlot(timeSlotsForSelectedDate[0]), this.getPremiumAppointmentTimeSlot(timeSlotsForSelectedDate[0])
); );
} }
@ -437,7 +437,7 @@ export default {
if (this.modelValue?.isPremiumAppointment) { if (this.modelValue?.isPremiumAppointment) {
selectedRouteCode = this.addPremiumFlagToInput( selectedRouteCode = this.addPremiumFlagToInput(
this.modelValue?.timeSlot?.routeCode, this.modelValue?.timeSlot?.routeCode
); );
} else { } else {
selectedRouteCode = this.modelValue?.timeSlot?.routeCode; selectedRouteCode = this.modelValue?.timeSlot?.routeCode;
@ -464,7 +464,7 @@ export default {
} }
const timeSlot = this.timeSlotsForSelectedDate?.timeSlots?.find( const timeSlot = this.timeSlotsForSelectedDate?.timeSlots?.find(
(timeSlot) => timeSlot.id == routeCode, (timeSlot) => timeSlot.id == routeCode
); );
if (timeSlot) { if (timeSlot) {

View file

@ -4,7 +4,7 @@ export class ProviderAddress {
city = null, city = null,
state = null, state = null,
zipCode = null, zipCode = null,
zipCodeCtu = null, zipCodeCtu = null
) { ) {
this.streetAddress = streetAddress; this.streetAddress = streetAddress;
this.city = city; this.city = city;

View file

@ -13,7 +13,7 @@ export async function getPricedMobileFeePart(serviceZipCode, pageNameToLog) {
storeActions.GET_MOBILE_FEE_PART, storeActions.GET_MOBILE_FEE_PART,
null, null,
pageNameToLog, pageNameToLog,
false, false
); );
if ( if (
@ -33,7 +33,7 @@ export async function getPricedMobileFeePart(serviceZipCode, pageNameToLog) {
serviceZipCodeCtu: zipCodeData.zipCodeCtu, serviceZipCodeCtu: zipCodeData.zipCodeCtu,
}, },
pageNameToLog, pageNameToLog,
false, false
); );
return Promise.resolve(pricingResults[0]); return Promise.resolve(pricingResults[0]);
@ -48,7 +48,7 @@ export async function getServiceabilityDetails(serviceZipCode, lineItems, pageNa
lineItems: lineItems, lineItems: lineItems,
}, },
pageNameToLog, pageNameToLog,
false, false
); );
return Promise.resolve(serviceabilityDetails); return Promise.resolve(serviceabilityDetails);
@ -60,7 +60,7 @@ export async function getShopProviderData(serviceZipCode) {
{ {
serviceZipCode: serviceZipCode, serviceZipCode: serviceZipCode,
}, },
"service-location", "service-location"
); );
return Promise.resolve(shopProviderData); return Promise.resolve(shopProviderData);
@ -70,7 +70,7 @@ export async function getAvailabilityRating(
startDate, startDate,
endDate, endDate,
shopAppointmentType, shopAppointmentType,
providerNumber, providerNumber
) { ) {
// For a given shop provider number and date range, get the appointment time slots available // For a given shop provider number and date range, get the appointment time slots available
const shopTimeSlots = await baseMixin.methods.dispatchStoreActionWithLogging( const shopTimeSlots = await baseMixin.methods.dispatchStoreActionWithLogging(
@ -82,7 +82,7 @@ export async function getAvailabilityRating(
shopAppointmentType: shopAppointmentType, shopAppointmentType: shopAppointmentType,
}, },
"service-location", "service-location",
false, false
); );
const numberOfDaysToEvaluate = 2; const numberOfDaysToEvaluate = 2;

View file

@ -255,7 +255,7 @@ describe("service-location-helper.js", () => {
serviceZipCode, serviceZipCode,
damageType, damageType,
parentAccountNumber, parentAccountNumber,
billToAccountNumber, billToAccountNumber
); );
// Assert // Assert
@ -283,7 +283,7 @@ describe("service-location-helper.js", () => {
serviceZipCode, serviceZipCode,
damageType, damageType,
parentAccountNumber, parentAccountNumber,
billToAccountNumber, billToAccountNumber
); );
// Assert // Assert
@ -321,7 +321,7 @@ describe("service-location-helper.js", () => {
"2023-06-30", "2023-06-30",
"2023-07-06", "2023-07-06",
"Inshop", "Inshop",
providerNumber, providerNumber
); );
// Assert // Assert
@ -337,7 +337,7 @@ describe("service-location-helper.js", () => {
"2023-06-30", "2023-06-30",
"2023-07-06", "2023-07-06",
"Inshop", "Inshop",
providerNumber, providerNumber
); );
// Assert // Assert

View file

@ -125,7 +125,7 @@ jest.mock(
getServiceabilityDetails: jest.fn((mockServiceZipCode) => { getServiceabilityDetails: jest.fn((mockServiceZipCode) => {
return mockGetServiceabilityDetails(mockServiceZipCode); return mockGetServiceabilityDetails(mockServiceZipCode);
}), }),
}), })
); );
describe("mobile-location-modal-questions.vue", () => { describe("mobile-location-modal-questions.vue", () => {
@ -156,7 +156,7 @@ describe("mobile-location-modal-questions.vue", () => {
// Assert // Assert
expect(wrapper.vm.internalModel.addressQuestions.streetAddress).toEqual("555 Some St"); expect(wrapper.vm.internalModel.addressQuestions.streetAddress).toEqual("555 Some St");
expect(wrapper.vm.internalModel.addressQuestions.apartmentNumberOrBusinessName).toEqual( expect(wrapper.vm.internalModel.addressQuestions.apartmentNumberOrBusinessName).toEqual(
"Apt 1", "Apt 1"
); );
expect(wrapper.vm.internalModel.addressQuestions.city).toEqual("Funkytown"); expect(wrapper.vm.internalModel.addressQuestions.city).toEqual("Funkytown");
expect(wrapper.vm.internalModel.addressQuestions.state).toEqual("OH"); expect(wrapper.vm.internalModel.addressQuestions.state).toEqual("OH");

View file

@ -118,7 +118,7 @@ export default {
const { errorMessage, handleChange, meta, validate, errors } = useField( const { errorMessage, handleChange, meta, validate, errors } = useField(
componentId, componentId,
props.validationRules, props.validationRules,
fieldOptions, fieldOptions
); );
return { return {
@ -242,7 +242,7 @@ export default {
// Validate the Zip Code // Validate the Zip Code
const zipCodeData = await this.getZipCodeData( const zipCodeData = await this.getZipCodeData(
this.internalModel.addressQuestions.zipCode, this.internalModel.addressQuestions.zipCode,
"service-location", "service-location"
); );
if (!zipCodeData.isValid) { if (!zipCodeData.isValid) {
@ -256,14 +256,14 @@ export default {
const serviceZipCode = this.internalModel.addressQuestions.zipCode; const serviceZipCode = this.internalModel.addressQuestions.zipCode;
const mobileFeePart = await getPricedMobileFeePart( const mobileFeePart = await getPricedMobileFeePart(
serviceZipCode, serviceZipCode,
"service-location", "service-location"
); );
// retrieve serviceability details // retrieve serviceability details
const serviceabilityDetails = await getServiceabilityDetails( const serviceabilityDetails = await getServiceabilityDetails(
serviceZipCode, serviceZipCode,
null, null,
"service-location", "service-location"
); );
// update content related to service zip code // update content related to service zip code

View file

@ -68,7 +68,7 @@ jest.mock(
getShopProviderData: jest.fn((mockServiceZipCode) => { getShopProviderData: jest.fn((mockServiceZipCode) => {
return mockGetShopProviderData(mockServiceZipCode); return mockGetShopProviderData(mockServiceZipCode);
}), }),
}), })
); );
jest.spyOn(baseMixin.methods, "getZipCodeData").mockImplementation((serviceZipCode) => { jest.spyOn(baseMixin.methods, "getZipCodeData").mockImplementation((serviceZipCode) => {
@ -221,7 +221,7 @@ describe("service-location.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "serviceLocation" } }, { query: { fmgPage: "serviceLocation" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
// Assert // Assert
@ -458,7 +458,7 @@ describe("service-location.vue", () => {
// Act // Act
mobileLocationQuestionsComponent.vm.$emit( mobileLocationQuestionsComponent.vm.$emit(
"update:modelValue", "update:modelValue",
newMobileLocationQuestions, newMobileLocationQuestions
); );
// Assert // Assert
@ -527,7 +527,7 @@ describe("service-location.vue", () => {
// Act // Act
mobileLocationQuestionsComponent.vm.$emit( mobileLocationQuestionsComponent.vm.$emit(
"update:modelValue", "update:modelValue",
newMobileLocationQuestions, newMobileLocationQuestions
); );
// Assert // Assert
@ -596,7 +596,7 @@ describe("service-location.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "serviceLocation" } }, { query: { fmgPage: "serviceLocation" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
// Assert // Assert
@ -623,7 +623,7 @@ describe("service-location.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "serviceLocation" } }, { query: { fmgPage: "serviceLocation" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
// Assert // Assert
@ -650,7 +650,7 @@ describe("service-location.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "serviceLocation" } }, { query: { fmgPage: "serviceLocation" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
// Assert // Assert
@ -677,7 +677,7 @@ describe("service-location.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "serviceLocation" } }, { query: { fmgPage: "serviceLocation" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
// Assert // Assert
@ -704,7 +704,7 @@ describe("service-location.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "serviceLocation" } }, { query: { fmgPage: "serviceLocation" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
// Assert // Assert
@ -732,7 +732,7 @@ describe("service-location.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "serviceLocation" } }, { query: { fmgPage: "serviceLocation" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
// Assert // Assert
@ -760,7 +760,7 @@ describe("service-location.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "serviceLocation" } }, { query: { fmgPage: "serviceLocation" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
// Assert // Assert
@ -788,7 +788,7 @@ describe("service-location.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "serviceLocation" } }, { query: { fmgPage: "serviceLocation" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
// Assert // Assert
@ -816,7 +816,7 @@ describe("service-location.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "serviceLocation" } }, { query: { fmgPage: "serviceLocation" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
// Assert // Assert
@ -844,7 +844,7 @@ describe("service-location.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "serviceLocation" } }, { query: { fmgPage: "serviceLocation" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
// Assert // Assert
@ -872,7 +872,7 @@ describe("service-location.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "serviceLocation" } }, { query: { fmgPage: "serviceLocation" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
// Assert // Assert
@ -900,7 +900,7 @@ describe("service-location.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "serviceLocation" } }, { query: { fmgPage: "serviceLocation" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
// Assert // Assert
@ -928,7 +928,7 @@ describe("service-location.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "serviceLocation" } }, { query: { fmgPage: "serviceLocation" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
// Assert // Assert
@ -956,7 +956,7 @@ describe("service-location.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "serviceLocation" } }, { query: { fmgPage: "serviceLocation" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
// Assert // Assert
@ -984,7 +984,7 @@ describe("service-location.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "serviceLocation" } }, { query: { fmgPage: "serviceLocation" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
// Assert // Assert
@ -1015,7 +1015,7 @@ describe("service-location.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "serviceLocation" } }, { query: { fmgPage: "serviceLocation" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
// Assert // Assert
@ -1042,7 +1042,7 @@ describe("service-location.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "serviceLocation" } }, { query: { fmgPage: "serviceLocation" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
// Assert // Assert
@ -1069,7 +1069,7 @@ describe("service-location.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "serviceLocation" } }, { query: { fmgPage: "serviceLocation" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
// Assert // Assert
@ -1097,7 +1097,7 @@ describe("service-location.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "serviceLocation" } }, { query: { fmgPage: "serviceLocation" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
// Assert // Assert
@ -1125,7 +1125,7 @@ describe("service-location.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "serviceLocation" } }, { query: { fmgPage: "serviceLocation" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
// Assert // Assert
@ -1153,7 +1153,7 @@ describe("service-location.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "serviceLocation" } }, { query: { fmgPage: "serviceLocation" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
// Assert // Assert
@ -1183,7 +1183,7 @@ describe("service-location.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "serviceLocation" } }, { query: { fmgPage: "serviceLocation" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
const alertComponent = wrapper.findComponent({ ref: "alertMobileOnly" }); const alertComponent = wrapper.findComponent({ ref: "alertMobileOnly" });
@ -1211,7 +1211,7 @@ describe("service-location.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "serviceLocation" } }, { query: { fmgPage: "serviceLocation" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
const alertComponent = wrapper.findComponent({ ref: "alertMobileOnly" }); const alertComponent = wrapper.findComponent({ ref: "alertMobileOnly" });
@ -1239,7 +1239,7 @@ describe("service-location.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "serviceLocation" } }, { query: { fmgPage: "serviceLocation" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
const alertComponent = wrapper.findComponent({ ref: "alertNoShops" }); const alertComponent = wrapper.findComponent({ ref: "alertNoShops" });
@ -1267,7 +1267,7 @@ describe("service-location.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "serviceLocation" } }, { query: { fmgPage: "serviceLocation" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
const alertComponent = wrapper.findComponent({ ref: "alertNoShops" }); const alertComponent = wrapper.findComponent({ ref: "alertNoShops" });
@ -1295,7 +1295,7 @@ describe("service-location.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "serviceLocation" } }, { query: { fmgPage: "serviceLocation" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
const alertComponent = wrapper.findComponent({ ref: "alertInshopOnly" }); const alertComponent = wrapper.findComponent({ ref: "alertInshopOnly" });
@ -1323,7 +1323,7 @@ describe("service-location.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "serviceLocation" } }, { query: { fmgPage: "serviceLocation" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
const alertComponent = wrapper.findComponent({ ref: "alertInshopOnly" }); const alertComponent = wrapper.findComponent({ ref: "alertInshopOnly" });
@ -1351,7 +1351,7 @@ describe("service-location.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "serviceLocation" } }, { query: { fmgPage: "serviceLocation" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
const alertInshopComponent = wrapper.findComponent({ ref: "alertInshopOnly" }); const alertInshopComponent = wrapper.findComponent({ ref: "alertInshopOnly" });
@ -1381,7 +1381,7 @@ describe("service-location.vue", () => {
wrapper.vm, wrapper.vm,
{ query: { fmgPage: "serviceLocation" } }, { query: { fmgPage: "serviceLocation" } },
undefined, undefined,
(c) => c(wrapper.vm), (c) => c(wrapper.vm)
); );
const alertComponent = wrapper.findComponent({ ref: "alertRecalNoMobile" }); const alertComponent = wrapper.findComponent({ ref: "alertRecalNoMobile" });

View file

@ -202,13 +202,13 @@ export default {
const serviceZipCode = store.getters.order.serviceLocation.zipCode; const serviceZipCode = store.getters.order.serviceLocation.zipCode;
const zipCodeDataPromise = baseMixin.methods.getZipCodeData( const zipCodeDataPromise = baseMixin.methods.getZipCodeData(
serviceZipCode, serviceZipCode,
"service-location", "service-location"
); );
const serviceabilityDetailsPromise = getServiceabilityDetails( const serviceabilityDetailsPromise = getServiceabilityDetails(
serviceZipCode, serviceZipCode,
null, null,
"service-location", "service-location"
); );
const mobileFeePartPromise = getPricedMobileFeePart(serviceZipCode, "service-location"); const mobileFeePartPromise = getPricedMobileFeePart(serviceZipCode, "service-location");
@ -248,7 +248,7 @@ export default {
resultMap.zipCodeData, resultMap.zipCodeData,
resultMap.serviceabilityDetails, resultMap.serviceabilityDetails,
resultMap.mobileFeePart, resultMap.mobileFeePart,
resultMap.shopProviderData, resultMap.shopProviderData
); );
}); });
}, },
@ -293,7 +293,7 @@ export default {
getShopProviderData(newValue.addressQuestions.zipCode).then((result) => { getShopProviderData(newValue.addressQuestions.zipCode).then((result) => {
this.shopProviderData = result.data; this.shopProviderData = result.data;
this.selectedProvider = new Provider( this.selectedProvider = new Provider(
this.shopProviderData.mobileProviderNumber, this.shopProviderData.mobileProviderNumber
); );
}); });
} }
@ -393,7 +393,7 @@ export default {
":" + ":" +
store.getters.order.policy.policyNumber + store.getters.order.policy.policyNumber +
":" + ":" +
store.getters.order.serviceLocation.zipCode, store.getters.order.serviceLocation.zipCode
); );
return false; return false;
} }
@ -408,7 +408,7 @@ export default {
"cash: servce-location invalid prereq:" + "cash: servce-location invalid prereq:" +
JSON.stringify(store.getters.lineItems.supportingItems) + JSON.stringify(store.getters.lineItems.supportingItems) +
":" + ":" +
store.getters.order.serviceLocation.zipCode, store.getters.order.serviceLocation.zipCode
); );
return false; return false;
} }
@ -503,7 +503,7 @@ export default {
} else { } else {
this.$router.navigateWithoutSaving( this.$router.navigateWithoutSaving(
this.navigationScenarios.CLICKED_BACK, this.navigationScenarios.CLICKED_BACK,
this.$route, this.$route
); );
} }
}, },
@ -518,7 +518,7 @@ export default {
// if we have a mobile fee, then save/update supporting items // if we have a mobile fee, then save/update supporting items
if (this.selectedAppointmentType == "Mobile") { if (this.selectedAppointmentType == "Mobile") {
const mobileFeeIndex = supportingItems.findIndex( const mobileFeeIndex = supportingItems.findIndex(
(item) => item.partType == MOBILE_FEE_PART_TYPE, (item) => item.partType == MOBILE_FEE_PART_TYPE
); );
// If it already exists, update the price with latest data // If it already exists, update the price with latest data
if (mobileFeeIndex >= 0) { if (mobileFeeIndex >= 0) {
@ -532,12 +532,12 @@ export default {
this.dispatchStoreAction( this.dispatchStoreAction(
this.storeActions.SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING, this.storeActions.SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING,
supportingItems, supportingItems,
false, false
); );
} else { } else {
// if it's not a mobile, then make sure we remove any that may have been added // if it's not a mobile, then make sure we remove any that may have been added
const removeMobileFeeIndex = supportingItems?.findIndex( const removeMobileFeeIndex = supportingItems?.findIndex(
(item) => item.partType == MOBILE_FEE_PART_TYPE, (item) => item.partType == MOBILE_FEE_PART_TYPE
); );
if (removeMobileFeeIndex >= 0) { if (removeMobileFeeIndex >= 0) {
@ -545,7 +545,7 @@ export default {
this.dispatchStoreAction( this.dispatchStoreAction(
this.storeActions.SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING, this.storeActions.SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING,
supportingItems, supportingItems,
false, false
); );
} }
} }
@ -599,7 +599,7 @@ export default {
}, },
}, },
}, },
false, false
); );
this.updateAndSaveSupportingItems(); this.updateAndSaveSupportingItems();
@ -617,7 +617,7 @@ export default {
this.shopProviderData = result.data; this.shopProviderData = result.data;
if (this.selectedAppointmentType === "Mobile") { if (this.selectedAppointmentType === "Mobile") {
this.selectedProvider = new Provider( this.selectedProvider = new Provider(
this.shopProviderData.mobileProviderNumber, this.shopProviderData.mobileProviderNumber
); );
} else { } else {
this.selectedProvider = new Provider(); this.selectedProvider = new Provider();
@ -630,7 +630,7 @@ export default {
handler(newValue) { handler(newValue) {
if (newValue === "Mobile") { if (newValue === "Mobile") {
this.selectedProvider = new Provider( this.selectedProvider = new Provider(
this.shopProviderData.mobileProviderNumber, this.shopProviderData.mobileProviderNumber
); );
} else { } else {
this.selectedProvider = new Provider(); this.selectedProvider = new Provider();

View file

@ -51,7 +51,7 @@ jest.mock(
getServiceabilityDetails: jest.fn((mockServiceZipCode) => { getServiceabilityDetails: jest.fn((mockServiceZipCode) => {
return mockGetServiceabilityDetails(mockServiceZipCode); return mockGetServiceabilityDetails(mockServiceZipCode);
}), }),
}), })
); );
const linkWidgetName = "linkWidgetName"; const linkWidgetName = "linkWidgetName";

View file

@ -140,7 +140,7 @@ export default {
const zipCodeData = await this.getZipCodeData( const zipCodeData = await this.getZipCodeData(
this.internalModel.zipCode, this.internalModel.zipCode,
"service-location", "service-location"
); );
if (!zipCodeData.isValid) { if (!zipCodeData.isValid) {
@ -155,14 +155,14 @@ export default {
const serviceZipCode = this.internalModel.zipCode; const serviceZipCode = this.internalModel.zipCode;
const mobileFeePart = await getPricedMobileFeePart( const mobileFeePart = await getPricedMobileFeePart(
serviceZipCode, serviceZipCode,
"service-location", "service-location"
); );
// retrieve serviceability details // retrieve serviceability details
const serviceabilityDetails = await getServiceabilityDetails( const serviceabilityDetails = await getServiceabilityDetails(
serviceZipCode, serviceZipCode,
null, null,
"service-location", "service-location"
); );
// update content related to service zip code // update content related to service zip code

View file

@ -78,7 +78,7 @@ export default {
displayAvailabilityIndicators() { displayAvailabilityIndicators() {
return experimentMixin.methods.hasSettingEqualTo( return experimentMixin.methods.hasSettingEqualTo(
experimentSettings.DISPLAY_AVAILABILITY_INDICATORS, experimentSettings.DISPLAY_AVAILABILITY_INDICATORS,
"true", "true"
); );
}, },
isLoaderDisplayed() { isLoaderDisplayed() {

View file

@ -418,7 +418,7 @@ describe("shop-question.vue", () => {
}); });
displayedAnswers.forEach( displayedAnswers.forEach(
(answer) => (answer.additionalButtonData = wrapper.vm.additionalButtonData), (answer) => (answer.additionalButtonData = wrapper.vm.additionalButtonData)
); );
// Act // Act

View file

@ -193,7 +193,7 @@ export default {
}, },
getSelectedProviderIndex(providers, selectedProviderNumber) { getSelectedProviderIndex(providers, selectedProviderNumber) {
const index = providers.findIndex( const index = providers.findIndex(
(provider) => provider.providerNumber == selectedProviderNumber, (provider) => provider.providerNumber == selectedProviderNumber
); );
return index; return index;
@ -219,7 +219,7 @@ export default {
await nextTick(); await nextTick();
const selectedShopIndex = this.getSelectedProviderIndex( const selectedShopIndex = this.getSelectedProviderIndex(
newValue, newValue,
this.selectedProviderNumber, this.selectedProviderNumber
); );
if (selectedShopIndex >= 3) { if (selectedShopIndex >= 3) {

Some files were not shown because too many files have changed in this diff Show more