Upgraded eslint and prettier
This commit is contained in:
parent
4475c642a0
commit
c7b19e6c4f
142 changed files with 2022 additions and 1834 deletions
1264
package-lock.json
generated
1264
package-lock.json
generated
File diff suppressed because it is too large
Load diff
16
package.json
16
package.json
|
|
@ -28,22 +28,22 @@
|
|||
"vue-router": "^4.4.3",
|
||||
"vuex": "^4.1.0",
|
||||
"vuex-persistedstate": "^4.1.0",
|
||||
"yup": "^0.32.11"
|
||||
"yup": "^1.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/eslint-parser": "^7.25.1",
|
||||
"@vue/cli-plugin-babel": "~5.0.8",
|
||||
"@vue/cli-plugin-eslint": "~5.0.8",
|
||||
"@vue/cli-plugin-unit-jest": "~5.0.8",
|
||||
"@vue/cli-service": "~5.0.8",
|
||||
"@vue/compiler-sfc": "^3.4.38",
|
||||
"@vue/eslint-config-prettier": "^6.0.0",
|
||||
"@vue/eslint-config-prettier": "^9.0.0",
|
||||
"@vue/test-utils": "^2.4.6",
|
||||
"@vue/vue3-jest": "^27.0.0",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-plugin-prettier": "^3.4.1",
|
||||
"eslint-plugin-vue": "^7.20.0",
|
||||
"prettier": "^2.8.8",
|
||||
"eslint": "8.57",
|
||||
"eslint-plugin-prettier": "^5.2.1",
|
||||
"eslint-plugin-vue": "^9.27.0",
|
||||
"prettier": "^3.3.3",
|
||||
"sass": "^1.77.8",
|
||||
"sass-loader": "^8.0.2",
|
||||
"typescript": "^4.8.4"
|
||||
|
|
@ -58,7 +58,7 @@
|
|||
"eslint:recommended"
|
||||
],
|
||||
"parserOptions": {
|
||||
"parser": "babel-eslint"
|
||||
"parser": "@babel/eslint-parser"
|
||||
},
|
||||
"rules": {
|
||||
"no-unused-vars": "off"
|
||||
|
|
|
|||
|
|
@ -2,5 +2,12 @@ module.exports = {
|
|||
env: {
|
||||
jest: true,
|
||||
},
|
||||
rules: {
|
||||
"vue/multi-word-component-names": "off",
|
||||
"vue/valid-next-tick": "off",
|
||||
"vue/no-v-text-v-html-on-component": "off",
|
||||
"vue/no-reserved-component-names": "off",
|
||||
"vue/require-toggle-inside-transition": "off",
|
||||
},
|
||||
//...
|
||||
};
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ export function getTintImage(glassLocation, colorString) {
|
|||
}
|
||||
|
||||
const tintImageSource = tintMap[glassLocation.toLowerCase()].find(
|
||||
(item) => item.name.toLowerCase() == colorString.toLowerCase()
|
||||
(item) => item.name.toLowerCase() == colorString.toLowerCase(),
|
||||
);
|
||||
|
||||
return tintImageSource;
|
||||
|
|
|
|||
|
|
@ -561,7 +561,7 @@ describe("baseInputButton.vue", () => {
|
|||
|
||||
// Assert
|
||||
expect(wrapper.vm.handleChange).toHaveBeenCalledWith(resultingValueToEmit);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
describe("checkbox", () => {
|
||||
|
|
@ -681,7 +681,7 @@ describe("baseInputButton.vue", () => {
|
|||
// Assert
|
||||
expect(wrapper.vm.valueToEmit).toEqual(["Hello", "Mello"]);
|
||||
expect(wrapper.vm.handleChange).toHaveBeenCalledWith(["Hello", "Mello"]);
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -709,7 +709,7 @@ describe("baseInputButton.vue", () => {
|
|||
// Assert
|
||||
expect(wrapper.vm.valueToEmit).toEqual("Bello");
|
||||
expect(wrapper.vm.handleChange).toHaveBeenCalledWith("Bello");
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
@ -758,7 +758,7 @@ describe("baseInputButton.vue", () => {
|
|||
|
||||
// Assert
|
||||
expect(wrapper.emitted()["update:modelValue"][0][0]).toEqual("HELLO WORLD");
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -994,7 +994,7 @@ describe("baseInputButton.vue", () => {
|
|||
"Clicked",
|
||||
"Bello",
|
||||
true,
|
||||
undefined
|
||||
undefined,
|
||||
);
|
||||
expect(wrapper.vm.setLastValuePushedToGa).toHaveBeenCalledWith("Bello");
|
||||
});
|
||||
|
|
@ -1057,7 +1057,7 @@ describe("baseInputButton.vue", () => {
|
|||
const inputElement = wrapper.find("input");
|
||||
expect(wrapper.vm.isChecked).toEqual(false);
|
||||
expect(inputElement.element.checked).toBe(false);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
test("modelValue doesn't contain this button's value => checkbox isn't checked", async () => {
|
||||
|
|
@ -1119,7 +1119,7 @@ describe("baseInputButton.vue", () => {
|
|||
const inputElement = wrapper.find("input");
|
||||
expect(wrapper.vm.isChecked).toEqual(false);
|
||||
expect(inputElement.element.checked).toBe(false);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
test("modelValue equals this button's value => radio button is checked", () => {
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ export default {
|
|||
this.GaActions.CLICKED,
|
||||
value?.toString() ?? this.value?.toString(),
|
||||
true,
|
||||
this.valueToLogType
|
||||
this.valueToLogType,
|
||||
);
|
||||
|
||||
this.setLastValuePushedToGa(value ?? this.value);
|
||||
|
|
@ -183,7 +183,7 @@ export default {
|
|||
const { handleChange, meta, errors } = useField(
|
||||
toRef(props, "groupName"),
|
||||
toRef(props, "validationRules"),
|
||||
fieldOptions
|
||||
fieldOptions,
|
||||
);
|
||||
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ describe("buttonQuestion.vue", () => {
|
|||
// Arrange
|
||||
const wrapper = shallowMount(
|
||||
buttonQuestion,
|
||||
setupMocks({ propsData: { groupName: "group-name" } })
|
||||
setupMocks({ propsData: { groupName: "group-name" } }),
|
||||
);
|
||||
await wrapper.setProps({
|
||||
answers: ["2022", "2021", "2020"],
|
||||
|
|
@ -87,7 +87,7 @@ describe("buttonQuestion.vue", () => {
|
|||
test("is checkbox => should emit captured value", async () => {
|
||||
const wrapper = shallowMount(
|
||||
buttonQuestion,
|
||||
setupMocks({ propsData: { groupName: "group-name" } })
|
||||
setupMocks({ propsData: { groupName: "group-name" } }),
|
||||
);
|
||||
await wrapper.setProps({
|
||||
answers: ["2022", "2021", "2020"],
|
||||
|
|
@ -125,7 +125,7 @@ describe("buttonQuestion.vue", () => {
|
|||
buttonTypeString: "mockComponent",
|
||||
buttonTypeObject: mockComponent,
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -158,7 +158,7 @@ describe("buttonQuestion.vue", () => {
|
|||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -184,7 +184,7 @@ describe("buttonQuestion.vue", () => {
|
|||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -212,7 +212,7 @@ describe("buttonQuestion.vue", () => {
|
|||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -231,7 +231,7 @@ describe("buttonQuestion.vue", () => {
|
|||
propsData: {
|
||||
answers: ["answer 1", "answer 2"],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -259,7 +259,7 @@ describe("buttonQuestion.vue", () => {
|
|||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -285,7 +285,7 @@ describe("buttonQuestion.vue", () => {
|
|||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -313,7 +313,7 @@ describe("buttonQuestion.vue", () => {
|
|||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -332,7 +332,7 @@ describe("buttonQuestion.vue", () => {
|
|||
propsData: {
|
||||
answers: ["answer 1", "answer 2"],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -360,7 +360,7 @@ describe("buttonQuestion.vue", () => {
|
|||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -386,7 +386,7 @@ describe("buttonQuestion.vue", () => {
|
|||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -414,7 +414,7 @@ describe("buttonQuestion.vue", () => {
|
|||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -433,7 +433,7 @@ describe("buttonQuestion.vue", () => {
|
|||
propsData: {
|
||||
answers: ["answer 1", "answer 2"],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -461,7 +461,7 @@ describe("buttonQuestion.vue", () => {
|
|||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -487,7 +487,7 @@ describe("buttonQuestion.vue", () => {
|
|||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -515,7 +515,7 @@ describe("buttonQuestion.vue", () => {
|
|||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -534,7 +534,7 @@ describe("buttonQuestion.vue", () => {
|
|||
propsData: {
|
||||
answers: ["answer 1", "answer 2"],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -562,7 +562,7 @@ describe("buttonQuestion.vue", () => {
|
|||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -588,7 +588,7 @@ describe("buttonQuestion.vue", () => {
|
|||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -616,7 +616,7 @@ describe("buttonQuestion.vue", () => {
|
|||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -635,7 +635,7 @@ describe("buttonQuestion.vue", () => {
|
|||
propsData: {
|
||||
answers: ["answer 1", "answer 2"],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -660,7 +660,7 @@ describe("buttonQuestion.vue", () => {
|
|||
answers: answerGroup,
|
||||
groupName: "this is my group name",
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -669,7 +669,7 @@ describe("buttonQuestion.vue", () => {
|
|||
// Assert
|
||||
expect(buttonsInfo[0].groupName).toEqual("this-is-my-group-name");
|
||||
expect(buttonsInfo[1].groupName).toEqual("this-is-my-group-name");
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
test.each(answers)(
|
||||
|
|
@ -683,7 +683,7 @@ describe("buttonQuestion.vue", () => {
|
|||
answers: answerGroup,
|
||||
groupName: "this-is-my-group-name",
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -692,7 +692,7 @@ describe("buttonQuestion.vue", () => {
|
|||
// Assert
|
||||
expect(buttonsInfo[0].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
|
||||
|
|
@ -741,7 +741,7 @@ describe("buttonQuestion.vue", () => {
|
|||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -768,7 +768,7 @@ describe("buttonQuestion.vue", () => {
|
|||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -797,7 +797,7 @@ describe("buttonQuestion.vue", () => {
|
|||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -826,7 +826,7 @@ describe("buttonQuestion.vue", () => {
|
|||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -855,7 +855,7 @@ describe("buttonQuestion.vue", () => {
|
|||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -886,7 +886,7 @@ describe("buttonQuestion.vue", () => {
|
|||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -906,7 +906,7 @@ describe("buttonQuestion.vue", () => {
|
|||
useTextForValue: true,
|
||||
answers: ["answer 1", "answer 2"],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -935,7 +935,7 @@ describe("buttonQuestion.vue", () => {
|
|||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -962,7 +962,7 @@ describe("buttonQuestion.vue", () => {
|
|||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -989,7 +989,7 @@ describe("buttonQuestion.vue", () => {
|
|||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -1018,7 +1018,7 @@ describe("buttonQuestion.vue", () => {
|
|||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -1047,7 +1047,7 @@ describe("buttonQuestion.vue", () => {
|
|||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -1076,7 +1076,7 @@ describe("buttonQuestion.vue", () => {
|
|||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -1107,7 +1107,7 @@ describe("buttonQuestion.vue", () => {
|
|||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -1127,7 +1127,7 @@ describe("buttonQuestion.vue", () => {
|
|||
useTextForValue: false,
|
||||
answers: ["answer 1", "answer 2"],
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -1145,7 +1145,7 @@ describe("buttonQuestion.vue", () => {
|
|||
function setupMocks(mountOptionsMockData = {}) {
|
||||
const defaultMountOptions = { route: { query: { fmgPage: "page-name" } } };
|
||||
const baseMountOptions = getMountOptions(
|
||||
Object.assign(defaultMountOptions, mountOptionsMockData)
|
||||
Object.assign(defaultMountOptions, mountOptionsMockData),
|
||||
);
|
||||
|
||||
const allMountOptions = Object.assign(defaultMountOptions, baseMountOptions);
|
||||
|
|
|
|||
|
|
@ -177,8 +177,8 @@ export default {
|
|||
const baseClasses = this.isOverflowScrollable
|
||||
? "container-fluid overflow-scroll position-absolute px-5 pt-1 py-0"
|
||||
: this.buttonTypeString == "listCard"
|
||||
? "w-100"
|
||||
: "";
|
||||
? "w-100"
|
||||
: "";
|
||||
const withSmallQuestionClass = this.isSmallQuestionText
|
||||
? baseClasses + " small-question-text"
|
||||
: baseClasses;
|
||||
|
|
@ -309,7 +309,7 @@ export default {
|
|||
this.$route.query[queryStrings.FMG_PAGE],
|
||||
this.GaActions.DISPLAYED,
|
||||
eventLabel,
|
||||
true
|
||||
true,
|
||||
);
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -442,7 +442,7 @@ describe("date-picker.vue", () => {
|
|||
"2023-07-24",
|
||||
"2023-08-19",
|
||||
"Inshop",
|
||||
"006747"
|
||||
"006747",
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -903,7 +903,7 @@ describe("date-picker.vue", () => {
|
|||
// Assert
|
||||
expect(
|
||||
testResult[0].weekStartDate <= todayString &&
|
||||
todayString <= testResult[0].weekEndDate
|
||||
todayString <= testResult[0].weekEndDate,
|
||||
).toBe(true);
|
||||
|
||||
wrapper.unmount();
|
||||
|
|
@ -938,7 +938,7 @@ describe("date-picker.vue", () => {
|
|||
const testResult = wrapper.vm.getInitialViewWeeks(
|
||||
"2023-07-31",
|
||||
5,
|
||||
mockPreSelectedDate
|
||||
mockPreSelectedDate,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -956,7 +956,7 @@ describe("date-picker.vue", () => {
|
|||
const testResult = wrapper.vm.getInitialViewWeeks(
|
||||
"2023-07-31",
|
||||
5,
|
||||
mockPreSelectedDate
|
||||
mockPreSelectedDate,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -1028,7 +1028,7 @@ describe("date-picker.vue", () => {
|
|||
// Assert
|
||||
expect(wrapper.vm.updateSelectableDates).toHaveBeenCalledWith(
|
||||
"2023-12-31",
|
||||
"2023-12-31"
|
||||
"2023-12-31",
|
||||
);
|
||||
expect(wrapper.vm.scrollToElement).toHaveBeenCalledWith("December-2023");
|
||||
|
||||
|
|
@ -1054,7 +1054,7 @@ describe("date-picker.vue", () => {
|
|||
// Assert
|
||||
expect(wrapper.vm.updateSelectableDates).toHaveBeenCalledWith(
|
||||
"2024-01-01",
|
||||
"2024-01-31"
|
||||
"2024-01-31",
|
||||
);
|
||||
expect(wrapper.vm.scrollToElement).toHaveBeenCalledWith("January-2024");
|
||||
|
||||
|
|
@ -1083,7 +1083,7 @@ describe("date-picker.vue", () => {
|
|||
// Assert
|
||||
expect(wrapper.vm.updateSelectableDates).toHaveBeenCalledWith(
|
||||
"2024-01-01",
|
||||
"2024-01-31"
|
||||
"2024-01-31",
|
||||
);
|
||||
expect(wrapper.vm.scrollToElement).toHaveBeenCalledWith("January-2024");
|
||||
|
||||
|
|
@ -1339,7 +1339,7 @@ function setupMocks(mountOptionsMockData = {}) {
|
|||
},
|
||||
};
|
||||
const mountOptions = getMountOptions(
|
||||
Object.assign(initialMountOptionsMockData, mountOptionsMockData)
|
||||
Object.assign(initialMountOptionsMockData, mountOptionsMockData),
|
||||
);
|
||||
|
||||
const wrapper = shallowMount(datePicker, mountOptions);
|
||||
|
|
|
|||
|
|
@ -288,7 +288,7 @@ export default {
|
|||
|
||||
for (let j = 0; j < 7; j++) {
|
||||
const newDate = convertDateStringToDate(
|
||||
weeks[splitWeekIndex].weekStartDate
|
||||
weeks[splitWeekIndex].weekStartDate,
|
||||
);
|
||||
newDate.setDate(newDate.getDate() + j);
|
||||
if (newDate.getDate() === 1) switchToWeek2 = true;
|
||||
|
|
@ -349,7 +349,7 @@ export default {
|
|||
const initialViewWeeks = this.getInitialViewWeeks(
|
||||
todayDateString,
|
||||
config.initialViewRowsToShow,
|
||||
config.preSelectedDate
|
||||
config.preSelectedDate,
|
||||
);
|
||||
const initialViewStartDate = todayDateString;
|
||||
const initialViewEndDate = initialViewWeeks[initialViewWeeks.length - 1].weekEndDate;
|
||||
|
|
@ -379,7 +379,7 @@ export default {
|
|||
initialViewStartDate,
|
||||
initialViewEndDate,
|
||||
store.getters.order.serviceLocation.appointmentType,
|
||||
store.getters.order.serviceLocation.provider.providerNumber
|
||||
store.getters.order.serviceLocation.provider.providerNumber,
|
||||
);
|
||||
resolve(response);
|
||||
});
|
||||
|
|
@ -442,7 +442,7 @@ export default {
|
|||
this.$nextTick(() => {
|
||||
//Advance to month
|
||||
const monthToShow = this.months.find((month) =>
|
||||
month.monthClass.includes("month-preselected")
|
||||
month.monthClass.includes("month-preselected"),
|
||||
);
|
||||
if (
|
||||
monthToShow.monthClass.includes("month-preselected") &&
|
||||
|
|
@ -604,7 +604,7 @@ export default {
|
|||
if (this.hideSomeDaysForInitialView) {
|
||||
monthToShow = this.months.find(
|
||||
({ isMonthThatHidesSomeDaysForInitialView }) =>
|
||||
isMonthThatHidesSomeDaysForInitialView
|
||||
isMonthThatHidesSomeDaysForInitialView,
|
||||
);
|
||||
// find the first day-hidden to become the next api call start date
|
||||
monthStartDateNum =
|
||||
|
|
@ -613,13 +613,13 @@ export default {
|
|||
} else {
|
||||
if (this.calendarViewDirection === "future") {
|
||||
monthToShow = this.months.find((month) =>
|
||||
month.monthClass.includes("month-hidden")
|
||||
month.monthClass.includes("month-hidden"),
|
||||
);
|
||||
}
|
||||
if (this.calendarViewDirection === "past") {
|
||||
// TODO: UPDATE THIS WITH CORRECT PAST LOOKING LOGIC
|
||||
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
|
||||
await this.updateSelectableDates(
|
||||
monthToShow.dates[monthStartDateNum].inputValue,
|
||||
monthToShow.dates[monthToShow.dates.length - 1].inputValue
|
||||
monthToShow.dates[monthToShow.dates.length - 1].inputValue,
|
||||
);
|
||||
this.isLoading = false;
|
||||
this.hideSomeDaysForInitialView = false; // if hid days on initial partial view, this will reveal those days
|
||||
|
|
@ -643,12 +643,12 @@ export default {
|
|||
monthStart,
|
||||
monthEnd,
|
||||
this.$store.getters.order.serviceLocation.appointmentType,
|
||||
this.$store.getters.order.serviceLocation.provider.providerNumber
|
||||
this.$store.getters.order.serviceLocation.provider.providerNumber,
|
||||
);
|
||||
|
||||
moreSelectableDates.days.forEach((selectableDate) => {
|
||||
const index = this.selectableDatesData.findIndex(
|
||||
(dateObj) => dateObj.date === selectableDate.date
|
||||
(dateObj) => dateObj.date === selectableDate.date,
|
||||
);
|
||||
if (index === -1) this.selectableDatesData.push(selectableDate);
|
||||
this.months.forEach((month) => {
|
||||
|
|
@ -732,7 +732,9 @@ export default {
|
|||
margin: 0 auto 2rem auto;
|
||||
max-width: 414px;
|
||||
position: relative;
|
||||
transition: height ease 2s, opacity ease 2s;
|
||||
transition:
|
||||
height ease 2s,
|
||||
opacity ease 2s;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(7, 1fr);
|
||||
justify-content: center;
|
||||
|
|
@ -805,7 +807,9 @@ export default {
|
|||
outline: none;
|
||||
height: 1.5rem;
|
||||
opacity: 1;
|
||||
transition: height ease 250ms, opacity ease 250ms;
|
||||
transition:
|
||||
height ease 250ms,
|
||||
opacity ease 250ms;
|
||||
|
||||
input[type="radio"] {
|
||||
position: absolute; //override bootstrap
|
||||
|
|
@ -818,7 +822,9 @@ export default {
|
|||
|
||||
&:focus + label,
|
||||
&:checked:focus + label {
|
||||
box-shadow: 0 0 0 3px #fff, 0 0 0 5.5px #1574a1;
|
||||
box-shadow:
|
||||
0 0 0 3px #fff,
|
||||
0 0 0 5.5px #1574a1;
|
||||
background-color: $blue;
|
||||
color: $white;
|
||||
&.current-day {
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ export default {
|
|||
const { errorMessage, handleBlur, handleChange, meta, errors } = useField(
|
||||
dropdownId,
|
||||
props.validationRules,
|
||||
fieldOptions
|
||||
fieldOptions,
|
||||
);
|
||||
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ describe("modal-button-main.vue", () => {
|
|||
propsData: {
|
||||
isPrimary: true,
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
const button = wrapper.find("button");
|
||||
|
||||
|
|
@ -28,7 +28,7 @@ describe("modal-button-main.vue", () => {
|
|||
propsData: {
|
||||
isDisabled: true,
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
const button = wrapper.find("button");
|
||||
|
||||
|
|
@ -45,7 +45,7 @@ describe("modal-button-main.vue", () => {
|
|||
loaderColor: "blue",
|
||||
loaderEnabled: true,
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -66,7 +66,7 @@ describe("modal-button-main.vue", () => {
|
|||
loaderPosition: "right",
|
||||
loaderEnabled: true,
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -87,7 +87,7 @@ describe("modal-button-main.vue", () => {
|
|||
loaderPosition: "right",
|
||||
loaderEnabled: true,
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
wrapper.setData({
|
||||
|
|
@ -112,7 +112,7 @@ describe("modal-button-main.vue", () => {
|
|||
loaderPosition: "right",
|
||||
loaderEnabled: true,
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
wrapper.setData({
|
||||
|
|
@ -137,7 +137,7 @@ describe("modal-button-main.vue", () => {
|
|||
loaderEnabled: true,
|
||||
isDisabled: false,
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
const buttonElement = wrapper.find("button");
|
||||
|
|
@ -161,7 +161,7 @@ describe("modal-button-main.vue", () => {
|
|||
loaderEnabled: true,
|
||||
isDisabled: true,
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
const buttonElement = wrapper.find("button");
|
||||
|
|
@ -179,7 +179,7 @@ describe("modal-button-main.vue", () => {
|
|||
function setupMocks(mountOptionsMockData = {}) {
|
||||
const defaultMountOptions = { route: { query: { fmgPage: "page-name" } } };
|
||||
const baseMountOptions = getMountOptions(
|
||||
Object.assign(defaultMountOptions, mountOptionsMockData)
|
||||
Object.assign(defaultMountOptions, mountOptionsMockData),
|
||||
);
|
||||
const allMountOptions = Object.assign(defaultMountOptions, baseMountOptions);
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ export default {
|
|||
this.$route.query[this.queryStrings.FMG_PAGE],
|
||||
this.GaActions.CLICKED,
|
||||
this.buttonText,
|
||||
true
|
||||
true,
|
||||
);
|
||||
if (!this.isDisabled) {
|
||||
this.isLoaderDisplayed = true;
|
||||
|
|
@ -76,13 +76,17 @@ export default {
|
|||
background: linear-gradient(270deg, $blue 0%, $blue-800 100%);
|
||||
}
|
||||
&:focus {
|
||||
box-shadow: 0 0 0 3px, 0 0 0 5.5px $blue-700;
|
||||
box-shadow:
|
||||
0 0 0 3px,
|
||||
0 0 0 5.5px $blue-700;
|
||||
}
|
||||
&:focus, // Mouse, touch, stylus focus
|
||||
&:focus-visible {
|
||||
// Keyboard focus for accessibility
|
||||
outline: none;
|
||||
box-shadow: 0 0 0 3px, 0 0 0 5.5px $blue-700;
|
||||
box-shadow:
|
||||
0 0 0 3px,
|
||||
0 0 0 5.5px $blue-700;
|
||||
color: $white;
|
||||
background: linear-gradient(270deg, rgba(6, 87, 124, 1) 0%, rgba(6, 87, 124, 1) 100%);
|
||||
}
|
||||
|
|
@ -100,7 +104,9 @@ export default {
|
|||
&.has-loader {
|
||||
color: $white;
|
||||
background: $blue-700;
|
||||
box-shadow: 0 0 0 3px, 0 0 0 5.5px $blue-700;
|
||||
box-shadow:
|
||||
0 0 0 3px,
|
||||
0 0 0 5.5px $blue-700;
|
||||
pointer-events: none;
|
||||
}
|
||||
&.delay {
|
||||
|
|
@ -125,7 +131,9 @@ export default {
|
|||
&:focus-visible {
|
||||
// Keyboard focus for accessibility
|
||||
outline: none;
|
||||
box-shadow: 0 0 0 3px $white, 0 0 0 5.5px $blue-700;
|
||||
box-shadow:
|
||||
0 0 0 3px $white,
|
||||
0 0 0 5.5px $blue-700;
|
||||
color: $white;
|
||||
@include blue-gradient;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ describe("phone-number-question.vue", () => {
|
|||
|
||||
// Assert
|
||||
expect(wrapper.vm.validationRulesForTextBoxQuestion).toEqual(
|
||||
"outsideValidation|phone-number-format"
|
||||
"outsideValidation|phone-number-format",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import { defineRule } from "vee-validate";
|
|||
// Validation
|
||||
defineRule(
|
||||
"phone-number-format",
|
||||
regex(/^(?=(?:.*\d){10})(?=(?:.*-){2})[\d-]{12}$/, errorMessages.PHONE_FORMAT)
|
||||
regex(/^(?=(?:.*\d){10})(?=(?:.*-){2})[\d-]{12}$/, errorMessages.PHONE_FORMAT),
|
||||
);
|
||||
|
||||
export default {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ jest.mock(
|
|||
() => {
|
||||
return {};
|
||||
},
|
||||
{ virtual: true }
|
||||
{ virtual: true },
|
||||
);
|
||||
|
||||
describe("Question Chain component", () => {
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ describe("textboxQuestion.vue", () => {
|
|||
resolve({
|
||||
data: [responseValue],
|
||||
});
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
const wrapper = shallowMount(textboxQuestion, {
|
||||
|
|
@ -248,7 +248,7 @@ describe("textboxQuestion.vue", () => {
|
|||
resolve({
|
||||
data: [responseValue],
|
||||
});
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
const wrapper = shallowMount(textboxQuestion, {
|
||||
|
|
@ -292,7 +292,7 @@ describe("textboxQuestion.vue", () => {
|
|||
() =>
|
||||
new Promise((resolve, reject) => {
|
||||
reject({});
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
const wrapper = shallowMount(textboxQuestion, {
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ export default {
|
|||
const { errorMessage, handleBlur, handleChange, meta, validate, errors } = useField(
|
||||
inputId,
|
||||
props.validationRules,
|
||||
fieldOptions
|
||||
fieldOptions,
|
||||
);
|
||||
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -283,7 +283,7 @@ describe("address-questions.vue", () => {
|
|||
|
||||
// Act
|
||||
autocompleteElement.dispatchEvent(
|
||||
new CustomEvent("place_changed", { detail: selectedPlace })
|
||||
new CustomEvent("place_changed", { detail: selectedPlace }),
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@ export default {
|
|||
// Load the Google Places Autocomplete script
|
||||
const apiKey = applicationConfig.GOOGLE_PLACES_API_KEY;
|
||||
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(() => {
|
||||
// When loaded, trigger the setup
|
||||
this.initializeAutocomplete();
|
||||
|
|
@ -240,7 +240,7 @@ export default {
|
|||
this.autocompleteListener = window.google.maps.event.addListener(
|
||||
this.autocomplete,
|
||||
"place_changed",
|
||||
this.fillInAddress
|
||||
this.fillInAddress,
|
||||
);
|
||||
|
||||
// When the Street Address textbox receives input for the first time,
|
||||
|
|
@ -258,7 +258,7 @@ export default {
|
|||
streetAddressField.appendChild(autocompleteResultsContainer);
|
||||
}
|
||||
},
|
||||
{ once: true }
|
||||
{ once: true },
|
||||
);
|
||||
|
||||
this.addressField1.addEventListener("keydown", (e) => {
|
||||
|
|
@ -274,7 +274,7 @@ export default {
|
|||
});
|
||||
|
||||
const addressFields = document.querySelectorAll(
|
||||
".address-questions input, .address-questions select"
|
||||
".address-questions input, .address-questions select",
|
||||
);
|
||||
|
||||
for (let addressField of addressFields) {
|
||||
|
|
@ -303,7 +303,7 @@ export default {
|
|||
},
|
||||
findAddressComponentByType(place, componentName, componentLength) {
|
||||
const component = place.address_components.find((component) =>
|
||||
component.types.find((type) => type == componentName)
|
||||
component.types.find((type) => type == componentName),
|
||||
);
|
||||
if (component) {
|
||||
return component[componentLength] ?? "";
|
||||
|
|
@ -332,7 +332,7 @@ export default {
|
|||
const streetNumber = this.findAddressComponentByType(
|
||||
place,
|
||||
"street_number",
|
||||
"long_name"
|
||||
"long_name",
|
||||
);
|
||||
const route = this.findAddressComponentByType(place, "route", "short_name");
|
||||
const city = this.findAddressComponentByType(place, "locality", "long_name");
|
||||
|
|
@ -345,7 +345,7 @@ export default {
|
|||
state = this.findAddressComponentByType(
|
||||
place,
|
||||
"administrative_area_level_1",
|
||||
"short_name"
|
||||
"short_name",
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -354,7 +354,7 @@ export default {
|
|||
zipCode = this.findAddressComponentByType(
|
||||
place,
|
||||
"postal_code",
|
||||
"long_name"
|
||||
"long_name",
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -399,7 +399,7 @@ export default {
|
|||
self.displayVerificationWarning = true;
|
||||
self.fillInAddress(results[0]);
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
} else {
|
||||
this.matchFound = false;
|
||||
|
|
@ -475,7 +475,7 @@ export default {
|
|||
this.matchFound = null;
|
||||
this.$nextTick();
|
||||
},
|
||||
{ deep: true, flush: "post" }
|
||||
{ deep: true, flush: "post" },
|
||||
);
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ describe("cart.vue", () => {
|
|||
|
||||
const found =
|
||||
wrapper.vm.cartItems.findIndex(
|
||||
(cartItem) => cartItem == wrapper.vm.frontWipersCartItem
|
||||
(cartItem) => cartItem == wrapper.vm.frontWipersCartItem,
|
||||
) >= 0;
|
||||
expect(found).toBe(true);
|
||||
});
|
||||
|
|
@ -113,7 +113,7 @@ describe("cart.vue", () => {
|
|||
|
||||
const found =
|
||||
wrapper.vm.cartItems.findIndex(
|
||||
(cartItem) => cartItem == wrapper.vm.rearWipersCartItem
|
||||
(cartItem) => cartItem == wrapper.vm.rearWipersCartItem,
|
||||
) >= 0;
|
||||
expect(found).toBe(true);
|
||||
});
|
||||
|
|
@ -156,7 +156,7 @@ describe("cart.vue", () => {
|
|||
|
||||
const found =
|
||||
wrapper.vm.cartItems.findIndex(
|
||||
(cartItem) => cartItem == wrapper.vm.rainDefenseCartItem
|
||||
(cartItem) => cartItem == wrapper.vm.rainDefenseCartItem,
|
||||
) >= 0;
|
||||
expect(found).toBe(true);
|
||||
});
|
||||
|
|
@ -258,7 +258,7 @@ describe("cart.vue", () => {
|
|||
|
||||
const found =
|
||||
wrapper.vm.cartItems.findIndex(
|
||||
(cartItem) => cartItem == wrapper.vm.recycleFeeCartItem
|
||||
(cartItem) => cartItem == wrapper.vm.recycleFeeCartItem,
|
||||
) >= 0;
|
||||
expect(found).toBe(true);
|
||||
});
|
||||
|
|
@ -301,7 +301,7 @@ describe("cart.vue", () => {
|
|||
|
||||
const found =
|
||||
wrapper.vm.cartItems.findIndex(
|
||||
(cartItem) => cartItem == wrapper.vm.mobileFeeCartItem
|
||||
(cartItem) => cartItem == wrapper.vm.mobileFeeCartItem,
|
||||
) >= 0;
|
||||
expect(found).toBe(true);
|
||||
});
|
||||
|
|
@ -344,7 +344,7 @@ describe("cart.vue", () => {
|
|||
|
||||
const found =
|
||||
wrapper.vm.cartItems.findIndex(
|
||||
(cartItem) => cartItem == wrapper.vm.servicePackageDiscountCartItem
|
||||
(cartItem) => cartItem == wrapper.vm.servicePackageDiscountCartItem,
|
||||
) >= 0;
|
||||
expect(found).toBe(true);
|
||||
});
|
||||
|
|
@ -389,7 +389,7 @@ describe("cart.vue", () => {
|
|||
|
||||
const found =
|
||||
wrapper.vm.cartItems.findIndex(
|
||||
(cartItem) => cartItem == wrapper.vm.otherSupportingItemsCartItem
|
||||
(cartItem) => cartItem == wrapper.vm.otherSupportingItemsCartItem,
|
||||
) >= 0;
|
||||
expect(found).toBe(true);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
{{
|
||||
getLineItemAmount(
|
||||
deductibleLineItem.subTotal,
|
||||
showCoverageAsPending
|
||||
showCoverageAsPending,
|
||||
)
|
||||
}}
|
||||
</span>
|
||||
|
|
@ -238,7 +238,7 @@ export default {
|
|||
this.glassToReplace,
|
||||
this.availableLineItems,
|
||||
this.isRepair,
|
||||
packageName
|
||||
packageName,
|
||||
);
|
||||
|
||||
let vapsCartItemsForSelectedPackage = [];
|
||||
|
|
@ -280,7 +280,7 @@ export default {
|
|||
|
||||
removeItem(cartItemType, category) {
|
||||
this.lineItems[category] = this.lineItems[category].filter(
|
||||
(lineItemsToKeep) => lineItemsToKeep.cartItemType != cartItemType
|
||||
(lineItemsToKeep) => lineItemsToKeep.cartItemType != cartItemType,
|
||||
);
|
||||
},
|
||||
getPromoCodeList() {
|
||||
|
|
@ -401,7 +401,7 @@ export default {
|
|||
servicePackageTitleWidget() {
|
||||
const servicePackageNames = this.getCmsContent(
|
||||
this.servicePackageOptionsCmsName,
|
||||
"Answers"
|
||||
"Answers",
|
||||
);
|
||||
|
||||
if (!servicePackageNames) {
|
||||
|
|
@ -409,7 +409,7 @@ export default {
|
|||
}
|
||||
|
||||
const currentPackage = servicePackageNames.find(
|
||||
(entry) => entry.Name === this.packageLevel
|
||||
(entry) => entry.Name === this.packageLevel,
|
||||
);
|
||||
|
||||
return currentPackage.SubWidgetName;
|
||||
|
|
@ -419,7 +419,7 @@ export default {
|
|||
this.glassToReplace,
|
||||
this.availableLineItems,
|
||||
this.isRepair,
|
||||
this.vaps
|
||||
this.vaps,
|
||||
);
|
||||
|
||||
return tier;
|
||||
|
|
@ -429,7 +429,7 @@ export default {
|
|||
|
||||
if (!this.showCoverageAsVerified && !this.showCoverageAsPending) {
|
||||
packagePrice = baseMixin.methods.getTierOnePackagePrice(
|
||||
baseMixin.methods.filterOutFees(this.availableLineItems)
|
||||
baseMixin.methods.filterOutFees(this.availableLineItems),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -518,7 +518,7 @@ export default {
|
|||
let cartItem = null;
|
||||
|
||||
const frontWiperLineItems = this.vaps.filter(
|
||||
(vapsLineItem) => vapsLineItem.partType == partTypeStrings.FRONT_WIPER
|
||||
(vapsLineItem) => vapsLineItem.partType == partTypeStrings.FRONT_WIPER,
|
||||
);
|
||||
|
||||
if (frontWiperLineItems.length > 0) {
|
||||
|
|
@ -532,7 +532,7 @@ export default {
|
|||
salesTax: 0,
|
||||
lineItems: [],
|
||||
isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes(
|
||||
cartItemTypes.FRONT_WIPERS
|
||||
cartItemTypes.FRONT_WIPERS,
|
||||
),
|
||||
};
|
||||
|
||||
|
|
@ -558,7 +558,7 @@ export default {
|
|||
let cartItem = null;
|
||||
|
||||
const rearWiperLineItems = this.vaps.filter(
|
||||
(vapsLineItem) => vapsLineItem.partType == partTypeStrings.REAR_WIPER
|
||||
(vapsLineItem) => vapsLineItem.partType == partTypeStrings.REAR_WIPER,
|
||||
);
|
||||
|
||||
if (rearWiperLineItems.length > 0) {
|
||||
|
|
@ -572,7 +572,7 @@ export default {
|
|||
salesTax: 0,
|
||||
lineItems: [],
|
||||
isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes(
|
||||
cartItemTypes.REAR_WIPERS
|
||||
cartItemTypes.REAR_WIPERS,
|
||||
),
|
||||
};
|
||||
|
||||
|
|
@ -598,7 +598,7 @@ export default {
|
|||
let cartItem = null;
|
||||
|
||||
const rainDefenseLineItem = this.vaps.find(
|
||||
(vapsLineItem) => vapsLineItem.partType == partTypeStrings.RAIN_DEFENSE
|
||||
(vapsLineItem) => vapsLineItem.partType == partTypeStrings.RAIN_DEFENSE,
|
||||
);
|
||||
|
||||
if (rainDefenseLineItem) {
|
||||
|
|
@ -612,7 +612,7 @@ export default {
|
|||
salesTax: 0,
|
||||
lineItems: [],
|
||||
isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes(
|
||||
cartItemTypes.RAIN_DEFENSE
|
||||
cartItemTypes.RAIN_DEFENSE,
|
||||
),
|
||||
};
|
||||
|
||||
|
|
@ -647,7 +647,7 @@ export default {
|
|||
salesTax: lineItem.salesTax ?? 0,
|
||||
lineItems: [],
|
||||
isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes(
|
||||
cartItemTypes.GLASS_PARTS
|
||||
cartItemTypes.GLASS_PARTS,
|
||||
),
|
||||
};
|
||||
|
||||
|
|
@ -678,7 +678,7 @@ export default {
|
|||
let cartItem = null;
|
||||
|
||||
let recycleFeeLineItem = this.supportingItems.find(
|
||||
(supportingItem) => supportingItem.partType == partTypeStrings.REPLACE_FEE
|
||||
(supportingItem) => supportingItem.partType == partTypeStrings.REPLACE_FEE,
|
||||
);
|
||||
|
||||
if (!recycleFeeLineItem && this.requiresRecycleFeeCartItem) {
|
||||
|
|
@ -703,7 +703,7 @@ export default {
|
|||
salesTax: 0,
|
||||
lineItems: [],
|
||||
isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes(
|
||||
cartItemTypes.REPLACE_FEE
|
||||
cartItemTypes.REPLACE_FEE,
|
||||
),
|
||||
};
|
||||
|
||||
|
|
@ -729,7 +729,7 @@ export default {
|
|||
const suppliesRepairLineItem = this.supportingItems.find(
|
||||
(supportingItem) =>
|
||||
supportingItem.partType == partTypeStrings.REPAIR_FEE &&
|
||||
supportingItem.partNumber != "WSREPAIR"
|
||||
supportingItem.partNumber != "WSREPAIR",
|
||||
);
|
||||
|
||||
if (suppliesRepairLineItem) {
|
||||
|
|
@ -743,7 +743,7 @@ export default {
|
|||
salesTax: 0,
|
||||
lineItems: [],
|
||||
isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes(
|
||||
cartItemTypes.SUPPLIES_REPAIR
|
||||
cartItemTypes.SUPPLIES_REPAIR,
|
||||
),
|
||||
};
|
||||
|
||||
|
|
@ -766,7 +766,7 @@ export default {
|
|||
mobileFeeCartItem() {
|
||||
let cartItem = null;
|
||||
const mobileFeeLineItem = this.supportingItems.find(
|
||||
(lineItem) => lineItem.partType == partTypeStrings.MOBILE_FEE
|
||||
(lineItem) => lineItem.partType == partTypeStrings.MOBILE_FEE,
|
||||
);
|
||||
|
||||
if (mobileFeeLineItem) {
|
||||
|
|
@ -780,7 +780,7 @@ export default {
|
|||
salesTax: 0,
|
||||
lineItems: [],
|
||||
isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes(
|
||||
cartItemTypes.MOBILE_FEE
|
||||
cartItemTypes.MOBILE_FEE,
|
||||
),
|
||||
};
|
||||
mobileFeeLineItem.cartItemType = cartItem.cartItemType;
|
||||
|
|
@ -800,7 +800,7 @@ export default {
|
|||
let cartItem = null;
|
||||
|
||||
const servicePackageDiscountLineItem = this.supportingItems.find(
|
||||
(lineItem) => lineItem.partType == partTypeStrings.SERVICE_PACKAGE_DISCOUNT
|
||||
(lineItem) => lineItem.partType == partTypeStrings.SERVICE_PACKAGE_DISCOUNT,
|
||||
);
|
||||
|
||||
if (servicePackageDiscountLineItem) {
|
||||
|
|
@ -808,7 +808,7 @@ export default {
|
|||
name:
|
||||
this.servicePackageDiscountCartItemName +
|
||||
Math.abs(
|
||||
baseMixin.methods.getTotalLineItemPrice(servicePackageDiscountLineItem)
|
||||
baseMixin.methods.getTotalLineItemPrice(servicePackageDiscountLineItem),
|
||||
),
|
||||
category: cartItemCategories.SERVICE_PACKAGE_DISCOUNT,
|
||||
cartItemType: cartItemTypes.SERVICE_PACKAGE_DISCOUNT,
|
||||
|
|
@ -854,7 +854,7 @@ export default {
|
|||
salesTax: 0,
|
||||
lineItems: [],
|
||||
isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes(
|
||||
cartItemTypes.SUPPORTING_ITEMS
|
||||
cartItemTypes.SUPPORTING_ITEMS,
|
||||
),
|
||||
};
|
||||
|
||||
|
|
@ -880,7 +880,7 @@ export default {
|
|||
let cartItem = null;
|
||||
|
||||
const premiumAppointmentDiscountLineItem = this.supportingItems.find(
|
||||
(lineItem) => lineItem.partType == partTypeStrings.EARLY_BIRD
|
||||
(lineItem) => lineItem.partType == partTypeStrings.EARLY_BIRD,
|
||||
);
|
||||
|
||||
if (premiumAppointmentDiscountLineItem) {
|
||||
|
|
@ -894,7 +894,7 @@ export default {
|
|||
salesTax: 0,
|
||||
lineItems: [],
|
||||
isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes(
|
||||
cartItemTypes.EARLY_BIRD
|
||||
cartItemTypes.EARLY_BIRD,
|
||||
),
|
||||
};
|
||||
|
||||
|
|
@ -919,14 +919,16 @@ export default {
|
|||
// get unique promo codes
|
||||
const uniquePromoCodes = [
|
||||
...new Set(
|
||||
this.promos.map((promo) => getPromoCodeWithoutBundleIdentifier(promo.promoCode))
|
||||
this.promos.map((promo) =>
|
||||
getPromoCodeWithoutBundleIdentifier(promo.promoCode),
|
||||
),
|
||||
),
|
||||
];
|
||||
|
||||
uniquePromoCodes.forEach((promoCode) => {
|
||||
// get the codes with the prefix from the promo array
|
||||
const promoLineItems = this.promos.filter(
|
||||
(promo) => getPromoCodeWithoutBundleIdentifier(promo.promoCode) == promoCode
|
||||
(promo) => getPromoCodeWithoutBundleIdentifier(promo.promoCode) == promoCode,
|
||||
);
|
||||
|
||||
// Create a cart item for each promo
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ export default {
|
|||
// Check if alert event is on the bus
|
||||
const alertEvent = eventBus.readAndPopEventFromBus(
|
||||
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 (alertEvent !== undefined) {
|
||||
|
|
@ -76,7 +76,7 @@ export default {
|
|||
//Uknown alerts most likely were added by a failed api call in global-methods
|
||||
const unknownAlertEvent = eventBus.readAndPopEventFromBus(
|
||||
globalEvents.Categories.GLOBAL_ALERT,
|
||||
globalEvents.SubCategories.UNKNOWN_ERROR
|
||||
globalEvents.SubCategories.UNKNOWN_ERROR,
|
||||
);
|
||||
|
||||
if (unknownAlertEvent !== undefined) {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ jest.mock(
|
|||
() => {
|
||||
return {};
|
||||
},
|
||||
{ virtual: true }
|
||||
{ virtual: true },
|
||||
);
|
||||
|
||||
jest.mock("@/assets/img/loader.gif", () => "loader.gif");
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ jest.mock("@/mixins/base-mixin", () => ({
|
|||
dispatchStoreActionWithLogging: jest.fn(
|
||||
(action, { promoCode, addableVaps }, pageNameToLog, someBool) => {
|
||||
return mockReturnsForStoreActions[action];
|
||||
}
|
||||
},
|
||||
),
|
||||
},
|
||||
}));
|
||||
|
|
@ -171,7 +171,7 @@ describe("promo-modal-question.vue", () => {
|
|||
addableVaps,
|
||||
},
|
||||
pageNameToLog,
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -221,7 +221,7 @@ describe("promo-modal-question.vue", () => {
|
|||
|
||||
"payment-method",
|
||||
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -284,7 +284,7 @@ describe("promo-modal-question.vue", () => {
|
|||
cartItemCategories.PROMOS
|
||||
].filter(
|
||||
(lineItemsToKeep) =>
|
||||
getPromoCodeWithoutBundleIdentifier(lineItemsToKeep.promoCode) != promo
|
||||
getPromoCodeWithoutBundleIdentifier(lineItemsToKeep.promoCode) != promo,
|
||||
));
|
||||
|
||||
//Assert
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ export default {
|
|||
},
|
||||
getPromoCodeList() {
|
||||
const promosToDisplay = getPromoCodesFromPromoObjectsWithoutDuplicates(
|
||||
this.lineItems.promos
|
||||
this.lineItems.promos,
|
||||
);
|
||||
return promosToDisplay;
|
||||
},
|
||||
|
|
@ -198,7 +198,7 @@ export default {
|
|||
lineItems,
|
||||
addableVaps,
|
||||
useDefaultCashParentAccount,
|
||||
pageNameToLog = null
|
||||
pageNameToLog = null,
|
||||
) {
|
||||
const pageName = pageNameToLog ?? this.$options?.name;
|
||||
const promoValidationResponse = await baseMixin.methods.dispatchStoreActionWithLogging(
|
||||
|
|
@ -210,7 +210,7 @@ export default {
|
|||
useDefaultCashParentAccount: useDefaultCashParentAccount,
|
||||
},
|
||||
pageName,
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
return {
|
||||
|
|
@ -225,7 +225,7 @@ export default {
|
|||
cartItemCategories.PROMOS
|
||||
].filter(
|
||||
(lineItemsToKeep) =>
|
||||
getPromoCodeWithoutBundleIdentifier(lineItemsToKeep.promoCode) != promo
|
||||
getPromoCodeWithoutBundleIdentifier(lineItemsToKeep.promoCode) != promo,
|
||||
);
|
||||
},
|
||||
getErrorMessage(error, additionalInfo) {
|
||||
|
|
@ -240,27 +240,27 @@ export default {
|
|||
(match, group) =>
|
||||
group === "NEW"
|
||||
? this.promoCode.toUpperCase()
|
||||
: this.getConflictingPromoCode(additionalInfo)
|
||||
: this.getConflictingPromoCode(additionalInfo),
|
||||
)),
|
||||
(this.displayStackingPromoAlert = true));
|
||||
case promoErrorCodes.INVALID_PROMO_ON_ORDER:
|
||||
if (additionalInfo.some((x) => x.toUpperCase() === "APPOINTMENT_TYPE")) {
|
||||
this.errorMessage = this.InShopPromoText?.replaceAll(
|
||||
"{custom:INSHOPPROMOCODE}",
|
||||
this.promoCode.toUpperCase()
|
||||
this.promoCode.toUpperCase(),
|
||||
);
|
||||
return (this.displayInShopPromoAlert = true);
|
||||
} else {
|
||||
this.errorMessage = this.PromoText?.replaceAll(
|
||||
"{custom:PROMOCODE}",
|
||||
this.promoCode.toUpperCase()
|
||||
this.promoCode.toUpperCase(),
|
||||
);
|
||||
return (this.displayInvalidPromoAlert = true);
|
||||
}
|
||||
default:
|
||||
this.errorMessage = this.PromoText?.replaceAll(
|
||||
"{custom:PROMOCODE}",
|
||||
this.promoCode.toUpperCase()
|
||||
this.promoCode.toUpperCase(),
|
||||
);
|
||||
return (this.displayInvalidPromoAlert = true);
|
||||
}
|
||||
|
|
@ -274,7 +274,7 @@ export default {
|
|||
this.lineItems,
|
||||
this.addableVaps,
|
||||
this.useDefaultCashParentAccount,
|
||||
this.pageName
|
||||
this.pageName,
|
||||
);
|
||||
if (promoCodeData.isValid) {
|
||||
if (this.taxPromos) {
|
||||
|
|
@ -297,24 +297,24 @@ export default {
|
|||
pricedLineItems: pricedLineItemsToTax,
|
||||
},
|
||||
"payment-method",
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
// Match all line items to the line items as they are in the store
|
||||
// and rebuild the original structure.
|
||||
this.lineItems = mapTaxedLineItemsToStoreFormat(
|
||||
taxedLineItems,
|
||||
this.lineItems
|
||||
this.lineItems,
|
||||
);
|
||||
const taxedVaps = mapTaxedLineItemsToStoreFormat(
|
||||
taxedLineItems,
|
||||
this.addableVaps
|
||||
this.addableVaps,
|
||||
);
|
||||
|
||||
const getVaps = getVapsThatNeedToBeAddedToSatisfyPromos(
|
||||
promoCodeData.promoCode,
|
||||
taxedVaps,
|
||||
this.lineItems
|
||||
this.lineItems,
|
||||
);
|
||||
|
||||
this.lineItems.vaps?.push(...getVaps);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ jest.mock(
|
|||
() => {
|
||||
return {};
|
||||
},
|
||||
{ virtual: true }
|
||||
{ virtual: true },
|
||||
);
|
||||
|
||||
describe("vehicleBanner", () => {
|
||||
|
|
@ -84,7 +84,7 @@ describe("vehicleBanner", () => {
|
|||
expect(store.getters.vehicle.category).toEqual(category);
|
||||
expect(wrapper.find("img").attributes("class")).toContain("vehicle-image");
|
||||
wrapper.unmount();
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ axios.interceptors.response.use(
|
|||
}
|
||||
|
||||
return Promise.reject(rejectionError);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
export default {
|
||||
|
|
@ -82,7 +82,7 @@ export default {
|
|||
GaCategories.API_RESPONSE,
|
||||
`${pageNameToLog}_${endpointWithoutParams}`,
|
||||
`${GaLabels.SUCCESS}${additionalEventData}`,
|
||||
true
|
||||
true,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -94,7 +94,7 @@ export default {
|
|||
GaCategories.API_RESPONSE,
|
||||
GaActions.RESULT,
|
||||
`${GaLabels.ERROR}_${endpoint}`,
|
||||
true
|
||||
true,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -106,12 +106,12 @@ export default {
|
|||
// when a service doesn't return an object
|
||||
global.$logger.logError(
|
||||
`${method}: ${endpoint}: ${error.message}`,
|
||||
error.response
|
||||
error.response,
|
||||
);
|
||||
}
|
||||
|
||||
return reject(error.response);
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
},
|
||||
|
|
@ -138,7 +138,7 @@ export default {
|
|||
},
|
||||
(error) => {
|
||||
return reject(error.response);
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ export function getCalendarFile(calFile) {
|
|||
'<P DIR=LTR><SPAN LANG="en-us">' +
|
||||
"</SPAN>" +
|
||||
ToCalendarFileString(calFile.Body) +
|
||||
"</BODY></HTML>"
|
||||
"</BODY></HTML>",
|
||||
);
|
||||
} else {
|
||||
calEvent.push("DESCRIPTION:" + ToCalendarFileString(calFile.Body));
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ test("download function", () => {
|
|||
expect(mockElement.setAttribute).toHaveBeenCalledTimes(2);
|
||||
expect(mockElement.setAttribute).toHaveBeenCalledWith(
|
||||
"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.style.display).toBe("none");
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ function processWidgetItemForReplacement(widgetModel, key) {
|
|||
widgetModel[key] = processIfStatements(
|
||||
widgetModel[key],
|
||||
dynamicStrings.GLOBAL_STATE,
|
||||
getStoreValueFromString
|
||||
getStoreValueFromString,
|
||||
);
|
||||
if (widgetModel[key].includes(dynamicStrings.GLOBAL_STATE)) {
|
||||
widgetModel[key] = mapStringToState(widgetModel[key]);
|
||||
|
|
@ -129,7 +129,7 @@ function getStoreValueFromString(str) {
|
|||
*/
|
||||
export function processIfStatements(str, ifConditionKeyword, replacePlaceholderCallback) {
|
||||
const containsRelevantIfStatement = new RegExp("{if:" + ifConditionKeyword + ":.+?}", "g").test(
|
||||
str
|
||||
str,
|
||||
);
|
||||
if (!containsRelevantIfStatement) {
|
||||
return str;
|
||||
|
|
@ -138,17 +138,17 @@ export function processIfStatements(str, ifConditionKeyword, replacePlaceholderC
|
|||
const ifStatementRegexMatches = [...str.matchAll(ifStatementRegexExpression)];
|
||||
const completeIfStatementArray = getAndFlagFirstNonNestedIfStatementWithKeyword(
|
||||
ifStatementRegexMatches,
|
||||
ifConditionKeyword
|
||||
ifConditionKeyword,
|
||||
);
|
||||
executeIfStatementAndSetProcessedStrings(
|
||||
completeIfStatementArray,
|
||||
replacePlaceholderCallback
|
||||
replacePlaceholderCallback,
|
||||
);
|
||||
const reconstructedPostProcessedString = joinProcessedRegexArray(ifStatementRegexMatches);
|
||||
return processIfStatements(
|
||||
reconstructedPostProcessedString,
|
||||
ifConditionKeyword,
|
||||
replacePlaceholderCallback
|
||||
replacePlaceholderCallback,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -275,7 +275,7 @@ function getIfStatementRegexExpression() {
|
|||
matchElseOperator +
|
||||
"|" +
|
||||
matchEndOperator,
|
||||
"g"
|
||||
"g",
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ export function getIsWindshieldOnly() {
|
|||
export function includesWindshieldReplacement() {
|
||||
const windshieldMatches =
|
||||
store.getters.order.damage.glassToReplace?.filter(
|
||||
(glassToReplace) => glassToReplace.glassLocation === glassLocations.WINDSHIELD
|
||||
(glassToReplace) => glassToReplace.glassLocation === glassLocations.WINDSHIELD,
|
||||
) ?? [];
|
||||
return windshieldMatches.length > 0;
|
||||
}
|
||||
|
|
@ -58,7 +58,7 @@ export async function isGlassAvailableForCarId(carId, pageNameToLog) {
|
|||
const newGlassOptions = await baseMixin.methods.dispatchStoreActionWithLogging(
|
||||
storeActions.GET_DAMAGE_OPTIONS,
|
||||
{ carId: carId },
|
||||
pageNameToLog
|
||||
pageNameToLog,
|
||||
);
|
||||
|
||||
const currentGlassOptions = store.getters.damage.glassToReplace;
|
||||
|
|
|
|||
|
|
@ -15,15 +15,15 @@ describe("event-bus.js", () => {
|
|||
eventBus.addEventToBus(
|
||||
globalEvents.Categories.GLOBAL_ALERT,
|
||||
globalEvents.SubCategories.PAGE_NOT_FOUND,
|
||||
event
|
||||
event,
|
||||
);
|
||||
|
||||
// Assert
|
||||
expect(
|
||||
store.getters.eventBusItem(
|
||||
globalEvents.Categories.GLOBAL_ALERT,
|
||||
globalEvents.SubCategories.PAGE_NOT_FOUND
|
||||
)
|
||||
globalEvents.SubCategories.PAGE_NOT_FOUND,
|
||||
),
|
||||
).toEqual(event);
|
||||
|
||||
expect(store.state.applicationUser.eventBus.length).toEqual(1);
|
||||
|
|
@ -31,7 +31,7 @@ describe("event-bus.js", () => {
|
|||
// Arrange / Act
|
||||
const eventValue = eventBus.readAndPopEventFromBus(
|
||||
globalEvents.Categories.GLOBAL_ALERT,
|
||||
globalEvents.SubCategories.PAGE_NOT_FOUND
|
||||
globalEvents.SubCategories.PAGE_NOT_FOUND,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -45,15 +45,15 @@ describe("event-bus.js", () => {
|
|||
eventBus.addEventToBus(
|
||||
globalEvents.Categories.GLOBAL_ALERT,
|
||||
globalEvents.SubCategories.PAGE_NOT_FOUND,
|
||||
event
|
||||
event,
|
||||
);
|
||||
|
||||
// Assert
|
||||
expect(
|
||||
eventBus.readEventFromBus(
|
||||
globalEvents.Categories.GLOBAL_ALERT,
|
||||
globalEvents.SubCategories.PAGE_NOT_FOUND
|
||||
)
|
||||
globalEvents.SubCategories.PAGE_NOT_FOUND,
|
||||
),
|
||||
).toEqual(event);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ export function regenerateDeviceId() {
|
|||
{
|
||||
[cookieNames.DXDEV]: `did=${crypto.randomUUID()}`,
|
||||
},
|
||||
{ maxAge: cookieExpirations.DXDEV }
|
||||
{ maxAge: cookieExpirations.DXDEV },
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -105,7 +105,7 @@ export function regenerateUserId() {
|
|||
{
|
||||
[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,
|
||||
},
|
||||
{ maxAge: cookieExpirations.FUNNEL_SESSION_KEY }
|
||||
{ maxAge: cookieExpirations.FUNNEL_SESSION_KEY },
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -153,7 +153,7 @@ export function setSessionIdIfUnset(value) {
|
|||
{
|
||||
[cookieNames.SESSION_ID]: value,
|
||||
},
|
||||
{ maxAge: cookieExpirations.SESSION_ID }
|
||||
{ maxAge: cookieExpirations.SESSION_ID },
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -169,7 +169,7 @@ export function updateSessionIdCookie() {
|
|||
|
||||
export function setCookieProperties(
|
||||
properties,
|
||||
{ useDefaultFunnelCookieAttributes = true, maxAge, isSecure }
|
||||
{ useDefaultFunnelCookieAttributes = true, maxAge, isSecure },
|
||||
) {
|
||||
if (typeof properties == "object") {
|
||||
Object.keys(properties).forEach((key) => {
|
||||
|
|
@ -253,7 +253,7 @@ function setFunnelCookieProperties(properties) {
|
|||
function createOrUpdateCookie(
|
||||
key,
|
||||
value = "",
|
||||
{ useDefaultFunnelCookieAttributes = true, maxAge, isSecure = true }
|
||||
{ useDefaultFunnelCookieAttributes = true, maxAge, isSecure = true },
|
||||
) {
|
||||
let cookieToAdd = `${key}=${value}; `;
|
||||
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ describe("cookies", () => {
|
|||
[cookieNames.DXDEV]:
|
||||
"did=f4a1a9e8-b3f3-4936-8c30-2f06a98644af&tz=-300&tzd=1",
|
||||
},
|
||||
{}
|
||||
{},
|
||||
);
|
||||
|
||||
//Act
|
||||
|
|
@ -403,7 +403,7 @@ describe("cookies", () => {
|
|||
{
|
||||
[cookieNames.SESSION_ID]: "test",
|
||||
},
|
||||
{ maxAge: 0 }
|
||||
{ maxAge: 0 },
|
||||
);
|
||||
const result = isCookieSet(cookieNames.SESSION_ID);
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ export async function getImplicitNavigation(toRoute) {
|
|||
const vehiclePartsComponent = await getLazyLoadedComponent(fmgPageValues.VEHICLE_PARTS);
|
||||
const moldingQuestionsComponent = await getLazyLoadedComponent(fmgPageValues.MOLDING_QUESTIONS);
|
||||
const capabilityQuestionsComponent = await getLazyLoadedComponent(
|
||||
fmgPageValues.CAPABILITY_QUESTIONS
|
||||
fmgPageValues.CAPABILITY_QUESTIONS,
|
||||
);
|
||||
const quoteComponent = await getLazyLoadedComponent(fmgPageValues.QUOTE);
|
||||
|
||||
|
|
|
|||
|
|
@ -545,7 +545,7 @@ describe("navigateToHeritageFunnel", () => {
|
|||
mockReferralDate,
|
||||
mockParentAccountNumber,
|
||||
mockSavedSessionId,
|
||||
mockCrmCustomerId
|
||||
mockCrmCustomerId,
|
||||
);
|
||||
|
||||
const mockData = {
|
||||
|
|
@ -590,7 +590,7 @@ describe("navigateToHeritageFunnel", () => {
|
|||
mockReferralDate,
|
||||
mockParentAccountNumber,
|
||||
mockSavedSessionId,
|
||||
mockCrmCustomerId
|
||||
mockCrmCustomerId,
|
||||
);
|
||||
|
||||
const mockData = {
|
||||
|
|
@ -617,7 +617,7 @@ describe("navigateToHeritageFunnel", () => {
|
|||
externalUrls.HERITAGE_FUNNEL,
|
||||
expect.objectContaining({
|
||||
corid: mockCorrelationId,
|
||||
})
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -630,7 +630,7 @@ describe("navigateToHeritageFunnel", () => {
|
|||
const mockOrderInfo = getMockOrderInfo(
|
||||
mockReferralNumber,
|
||||
mockCorrelationId,
|
||||
mockReferralDate
|
||||
mockReferralDate,
|
||||
);
|
||||
|
||||
const mockData = {
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ export async function loadSessionIfPresent(isConceptInsurance, pageNameToLog) {
|
|||
funnelCookie.ReferralParentAccountNumber,
|
||||
funnelCookie.ReferralCorrelationId,
|
||||
isConceptInsurance,
|
||||
pageNameToLog
|
||||
pageNameToLog,
|
||||
)
|
||||
)?.data;
|
||||
}
|
||||
|
|
@ -67,7 +67,7 @@ export async function saveSession({
|
|||
return saveSessionHelper(
|
||||
pageNameToLog,
|
||||
submitAfterSave,
|
||||
createDeleteStatusWorkOrderForPia
|
||||
createDeleteStatusWorkOrderForPia,
|
||||
);
|
||||
});
|
||||
} else {
|
||||
|
|
@ -75,7 +75,7 @@ export async function saveSession({
|
|||
saveSessionPromise = saveSessionHelper(
|
||||
pageNameToLog,
|
||||
submitAfterSave,
|
||||
createDeleteStatusWorkOrderForPia
|
||||
createDeleteStatusWorkOrderForPia,
|
||||
);
|
||||
}
|
||||
store.commit(storeMutations.UPDATE_SAVE_SESSION_PROMISE, saveSessionPromise);
|
||||
|
|
@ -111,7 +111,7 @@ async function loadSession(
|
|||
parentAccountNumber,
|
||||
referralCorrelationId,
|
||||
isConceptInsurance,
|
||||
pageNameToLog
|
||||
pageNameToLog,
|
||||
) {
|
||||
// await the saveSessionPromise in the store to make sure we're loading up to date information
|
||||
await store.getters.applicationUser.saveSessionPromise;
|
||||
|
|
@ -127,7 +127,7 @@ async function loadSession(
|
|||
isConceptInsurance,
|
||||
},
|
||||
pageNameToLog,
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
return response;
|
||||
|
|
@ -139,7 +139,7 @@ async function loadSession(
|
|||
async function saveSessionHelper(
|
||||
pageNameToLog,
|
||||
submitAfterSave = false,
|
||||
createDeleteStatusWorkOrderForPia = false
|
||||
createDeleteStatusWorkOrderForPia = false,
|
||||
) {
|
||||
const savedSessionInfo = await baseMixin.methods.dispatchStoreActionWithLogging(
|
||||
storeActions.SAVE_SESSION,
|
||||
|
|
@ -147,7 +147,7 @@ async function saveSessionHelper(
|
|||
submitAfterSave: submitAfterSave,
|
||||
createDeleteStatusWorkOrderForPia: createDeleteStatusWorkOrderForPia,
|
||||
},
|
||||
pageNameToLog
|
||||
pageNameToLog,
|
||||
);
|
||||
// Update the store with information received from the saveSession response
|
||||
await baseMixin.methods.dispatchStoreAction(
|
||||
|
|
@ -168,7 +168,7 @@ async function saveSessionHelper(
|
|||
settledTenderAmount: savedSessionInfo.data.settledTenderAmount,
|
||||
billToAccountNumber: savedSessionInfo.data.billToAccountNumber,
|
||||
},
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
// Update the cookie with the referral information when saved.
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ describe("loadSessionIfPresent", () => {
|
|||
};
|
||||
|
||||
document.cookie = `${cookieNames.FUNNEL_SESSION_INFO}=${JSON.stringify(
|
||||
testCookieValue
|
||||
testCookieValue,
|
||||
)}; path=/; ${cookieHelper.getCookieDomainValue()}`;
|
||||
|
||||
// Act
|
||||
|
|
@ -70,7 +70,7 @@ describe("loadSessionIfPresent", () => {
|
|||
// Assert
|
||||
expect(cookieHelper.getFunnelCookie).toHaveBeenCalled();
|
||||
expect(mocks.baseMixin.methods.dispatchStoreAction).toHaveBeenCalledWith(
|
||||
storeActions.RESET_STATE
|
||||
storeActions.RESET_STATE,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -96,7 +96,7 @@ describe("loadSessionIfPresent", () => {
|
|||
// Assert
|
||||
expect(cookieHelper.getFunnelCookie).toHaveBeenCalled();
|
||||
expect(mocks.baseMixin.methods.dispatchStoreAction).not.toHaveBeenCalledWith(
|
||||
storeActions.RESET_STATE
|
||||
storeActions.RESET_STATE,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -129,7 +129,7 @@ describe("loadSessionIfPresent", () => {
|
|||
// Assert
|
||||
expect(cookieHelper.getFunnelCookie).toHaveBeenCalled();
|
||||
expect(mocks.baseMixin.methods.dispatchStoreAction).not.toHaveBeenCalledWith(
|
||||
storeActions.LOAD_SESSION
|
||||
storeActions.LOAD_SESSION,
|
||||
);
|
||||
expect(result.ReferralNumber).toBe(123456);
|
||||
expect(result.vehicle.year).toBe(2010);
|
||||
|
|
@ -156,7 +156,7 @@ describe("saveSession", () => {
|
|||
mockReferralDate,
|
||||
mockParentAccountNumber,
|
||||
mockSavedSessionId,
|
||||
mockCrmCustomerId
|
||||
mockCrmCustomerId,
|
||||
);
|
||||
|
||||
const mockData = {
|
||||
|
|
@ -180,7 +180,7 @@ describe("saveSession", () => {
|
|||
expect(mocks.baseMixin.methods.dispatchStoreActionWithLogging).toHaveBeenCalledWith(
|
||||
storeActions.SAVE_SESSION,
|
||||
{ createDeleteStatusWorkOrderForPia: false, submitAfterSave: false },
|
||||
"test"
|
||||
"test",
|
||||
);
|
||||
expect(mocks.baseMixin.methods.dispatchStoreAction).toHaveBeenCalledWith(
|
||||
storeActions.UPDATE_STORE_WITH_SAVE_SESSION_RESPONSE,
|
||||
|
|
@ -192,7 +192,7 @@ describe("saveSession", () => {
|
|||
savedSessionId: mockSavedSessionId,
|
||||
crmCustomerId: mockCrmCustomerId,
|
||||
},
|
||||
false
|
||||
false,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -211,7 +211,7 @@ describe("saveSession", () => {
|
|||
mockReferralDate,
|
||||
mockParentAccountNumber,
|
||||
mockSavedSessionId,
|
||||
mockCrmCustomerId
|
||||
mockCrmCustomerId,
|
||||
);
|
||||
|
||||
const mockData = {
|
||||
|
|
@ -264,7 +264,7 @@ describe("submitWorkOrder", () => {
|
|||
mockReferralDate,
|
||||
mockParentAccountNumber,
|
||||
mockSavedSessionId,
|
||||
mockCrmCustomerId
|
||||
mockCrmCustomerId,
|
||||
);
|
||||
|
||||
const mockData = {
|
||||
|
|
@ -288,7 +288,7 @@ describe("submitWorkOrder", () => {
|
|||
expect(mocks.baseMixin.methods.dispatchStoreActionWithLogging).toHaveBeenCalledWith(
|
||||
storeActions.SAVE_SESSION,
|
||||
{ createDeleteStatusWorkOrderForPia: false, submitAfterSave: true },
|
||||
"test"
|
||||
"test",
|
||||
);
|
||||
expect(mocks.baseMixin.methods.dispatchStoreAction).toHaveBeenCalledWith(
|
||||
storeActions.UPDATE_STORE_WITH_SAVE_SESSION_RESPONSE,
|
||||
|
|
@ -300,7 +300,7 @@ describe("submitWorkOrder", () => {
|
|||
savedSessionId: mockSavedSessionId,
|
||||
crmCustomerId: mockCrmCustomerId,
|
||||
},
|
||||
false
|
||||
false,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -319,7 +319,7 @@ describe("submitWorkOrder", () => {
|
|||
mockReferralDate,
|
||||
mockParentAccountNumber,
|
||||
mockSavedSessionId,
|
||||
mockCrmCustomerId
|
||||
mockCrmCustomerId,
|
||||
);
|
||||
|
||||
const mockData = {
|
||||
|
|
|
|||
|
|
@ -22,6 +22,6 @@ export function settleAllPromises(promiseResultMap) {
|
|||
}
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,14 +9,14 @@ export class Logger {
|
|||
logInformation(message, details) {
|
||||
this.writeLogEntry(
|
||||
loggingEndpointMethods.LOG_INFORMATION,
|
||||
this.formatLogEntry(message, details)
|
||||
this.formatLogEntry(message, details),
|
||||
);
|
||||
}
|
||||
|
||||
logWarning(message, details) {
|
||||
this.writeLogEntry(
|
||||
loggingEndpointMethods.LOG_WARNING,
|
||||
this.formatLogEntry(message, details)
|
||||
this.formatLogEntry(message, details),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -27,7 +27,7 @@ export class Logger {
|
|||
logCritical(message, details) {
|
||||
this.writeLogEntry(
|
||||
loggingEndpointMethods.LOG_CRITICAL,
|
||||
this.formatLogEntry(message, details)
|
||||
this.formatLogEntry(message, details),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -82,7 +82,7 @@ export class Logger {
|
|||
},
|
||||
(error) => {
|
||||
return reject(error);
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ export function deepClone(object) {
|
|||
let clone = Object.assign({}, object);
|
||||
Object.keys(clone).forEach(
|
||||
(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)) {
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ export function getLineItemsThatMatchPromos(promos, availableLineItems) {
|
|||
}
|
||||
promo.discountedLineItemIds.forEach((discountedLineItemId) => {
|
||||
matchingLineItems.push(
|
||||
...availableLineItems.filter((lineItem) => lineItem.id === discountedLineItemId)
|
||||
...availableLineItems.filter((lineItem) => lineItem.id === discountedLineItemId),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
@ -76,7 +76,7 @@ export function getAddableVapsFromAvailableLineItems(availableLineItems) {
|
|||
const addableVaps = [];
|
||||
addableVaps.push(...findLineItemsWithPartType(partTypeStrings.FRONT_WIPER, availableLineItems));
|
||||
addableVaps.push(
|
||||
...findLineItemsWithPartType(partTypeStrings.RAIN_DEFENSE, availableLineItems)
|
||||
...findLineItemsWithPartType(partTypeStrings.RAIN_DEFENSE, availableLineItems),
|
||||
);
|
||||
return addableVaps;
|
||||
}
|
||||
|
|
@ -99,7 +99,7 @@ export async function revalidatePromosAndValidateQueryStringPromo(
|
|||
newPromo,
|
||||
pricedLineItems,
|
||||
pageNameToLog,
|
||||
useDefaultCashParentAccount = false
|
||||
useDefaultCashParentAccount = false,
|
||||
) {
|
||||
const hasActivePromos = store.getters.order.lineItems.promos;
|
||||
const hasInactivePromos = store.getters.payment.inactivePromos;
|
||||
|
|
@ -117,7 +117,7 @@ export async function revalidatePromosAndValidateQueryStringPromo(
|
|||
storeActions.REVALIDATE_ORDER_PROMOS_AND_SAVE_SERVER_DATA,
|
||||
{ useDefaultCashParentAccount },
|
||||
pageNameToLog,
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
const revalidationErrorPromoCodes = revalidatePromoResponse.errors.map((x) => x.promoCode);
|
||||
|
|
@ -127,7 +127,7 @@ export async function revalidatePromosAndValidateQueryStringPromo(
|
|||
activePromos: revalidatePromoResponse.promoLineItems,
|
||||
inactivePromos: revalidationErrorPromoCodes,
|
||||
},
|
||||
false
|
||||
false,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -139,7 +139,7 @@ export async function revalidatePromosAndValidateQueryStringPromo(
|
|||
addableVaps: addableVaps,
|
||||
},
|
||||
pageNameToLog,
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
if (validatePromoResponse.errorCode == null) {
|
||||
|
|
@ -151,7 +151,7 @@ export async function revalidatePromosAndValidateQueryStringPromo(
|
|||
{
|
||||
activePromos: activePromos,
|
||||
},
|
||||
false
|
||||
false,
|
||||
);
|
||||
} else if (!excludeFromInactivePromoErrorCodes.includes(validatePromoResponse.errorCode)) {
|
||||
// Save any valid query string promoCode (not applied) to inactivePromos
|
||||
|
|
@ -161,7 +161,7 @@ export async function revalidatePromosAndValidateQueryStringPromo(
|
|||
return promoObject.promoCode.toUpperCase();
|
||||
}) ?? [];
|
||||
const isErrorPromoAlreadyOnOrder = activePromoCodes.includes(
|
||||
validatePromoResponse.promoCode.toUpperCase()
|
||||
validatePromoResponse.promoCode.toUpperCase(),
|
||||
);
|
||||
// Do not save an inactivePromo if it is already active on the order
|
||||
if (!isErrorPromoAlreadyOnOrder) {
|
||||
|
|
@ -173,7 +173,7 @@ export async function revalidatePromosAndValidateQueryStringPromo(
|
|||
{
|
||||
inactivePromos: inactivePromoCodes,
|
||||
},
|
||||
false
|
||||
false,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -185,7 +185,7 @@ export async function revalidatePromosAndValidateQueryStringPromo(
|
|||
export function buildToastMessagesFromRevalidateOrValidatePromoResponse(
|
||||
promoResponse,
|
||||
oldActivePromos = [],
|
||||
oldInactivePromos = []
|
||||
oldInactivePromos = [],
|
||||
) {
|
||||
if (promoResponse == null) {
|
||||
return [];
|
||||
|
|
@ -194,13 +194,13 @@ export function buildToastMessagesFromRevalidateOrValidatePromoResponse(
|
|||
// Revalidate always has an "errors" array
|
||||
if (promoResponse.errors) {
|
||||
const oldPromoCodes = oldActivePromos.map((promo) =>
|
||||
getPromoCodeWithoutBundleIdentifier(promo.promoCode)
|
||||
getPromoCodeWithoutBundleIdentifier(promo.promoCode),
|
||||
);
|
||||
const activePromoCodesFromResponse = getPromoCodesFromPromoObjectsWithoutDuplicates(
|
||||
promoResponse.promoLineItems
|
||||
promoResponse.promoLineItems,
|
||||
);
|
||||
const newlyActivatedPromoCodes = activePromoCodesFromResponse.filter(
|
||||
(newPromoCode) => !oldPromoCodes.includes(newPromoCode)
|
||||
(newPromoCode) => !oldPromoCodes.includes(newPromoCode),
|
||||
);
|
||||
|
||||
newlyActivatedPromoCodes.forEach((newlyActivatedPromoCode) => {
|
||||
|
|
@ -209,7 +209,7 @@ export function buildToastMessagesFromRevalidateOrValidatePromoResponse(
|
|||
|
||||
const newlyInactivatedPromos = getNewlyInactivatedPromos(
|
||||
oldInactivePromos,
|
||||
promoResponse.errors
|
||||
promoResponse.errors,
|
||||
);
|
||||
newlyInactivatedPromos.forEach((newlyInactivatedPromo) => {
|
||||
alerts.push(createPromoErrorAlert(newlyInactivatedPromo));
|
||||
|
|
@ -219,7 +219,7 @@ export function buildToastMessagesFromRevalidateOrValidatePromoResponse(
|
|||
else {
|
||||
if (promoResponse.orderPromos) {
|
||||
const promoCodeToDisplay = getPromoCodeWithoutBundleIdentifier(
|
||||
promoResponse.orderPromos[0].promoCode
|
||||
promoResponse.orderPromos[0].promoCode,
|
||||
);
|
||||
alerts.push(createPromoSuccessAlert(promoCodeToDisplay));
|
||||
} else {
|
||||
|
|
@ -228,8 +228,8 @@ export function buildToastMessagesFromRevalidateOrValidatePromoResponse(
|
|||
createPromoErrorAlert(
|
||||
promoResponse.promoCode,
|
||||
promoResponse.errorCode,
|
||||
promoResponse.additionalInfo
|
||||
)
|
||||
promoResponse.additionalInfo,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -279,19 +279,19 @@ export function getPromosThatMatchLineItemsOnOrder(promos, lineItemsOnOrder) {
|
|||
export function getVapsThatNeedToBeAddedToSatisfyPromos(
|
||||
promos,
|
||||
availableLineItems,
|
||||
lineItemsOnOrder
|
||||
lineItemsOnOrder,
|
||||
) {
|
||||
const clonedVaps = deepClone(lineItemsOnOrder?.vaps ?? []);
|
||||
const promosWithAddableVaps = getPromosWithAddableVaps(promos);
|
||||
if (promosWithAddableVaps.length) {
|
||||
const matchingLineItems = getLineItemsThatMatchPromos(
|
||||
promosWithAddableVaps,
|
||||
availableLineItems
|
||||
availableLineItems,
|
||||
);
|
||||
// Check if matching items are already in the order
|
||||
const idsOfVapsAlreadyInOrder = clonedVaps.map((lineItem) => lineItem.id);
|
||||
const vapsToAddToCart = matchingLineItems.filter(
|
||||
(lineItem) => !idsOfVapsAlreadyInOrder.includes(lineItem.id)
|
||||
(lineItem) => !idsOfVapsAlreadyInOrder.includes(lineItem.id),
|
||||
);
|
||||
return vapsToAddToCart;
|
||||
} else {
|
||||
|
|
@ -301,12 +301,12 @@ export function getVapsThatNeedToBeAddedToSatisfyPromos(
|
|||
|
||||
export function removeCurrentlyActivePromoCodesFromInactivePromos(
|
||||
activePromoObjects,
|
||||
inactivePromos
|
||||
inactivePromos,
|
||||
) {
|
||||
activePromoObjects = activePromoObjects ?? [];
|
||||
inactivePromos = inactivePromos ?? [];
|
||||
const activePromoCodes = activePromoObjects.map((promoObject) =>
|
||||
getPromoCodeWithoutBundleIdentifier(promoObject.promoCode).toUpperCase()
|
||||
getPromoCodeWithoutBundleIdentifier(promoObject.promoCode).toUpperCase(),
|
||||
);
|
||||
return inactivePromos.filter((inactivePromo) => {
|
||||
return !activePromoCodes.includes(inactivePromo.toUpperCase());
|
||||
|
|
@ -326,7 +326,7 @@ export function getNewlyInactivatedPromos(oldInactivePromos, newInactivePromos)
|
|||
const inactivePromoCodesFromResponse =
|
||||
getPromoCodesFromPromoObjectsWithoutDuplicates(newInactivePromos);
|
||||
return inactivePromoCodesFromResponse.filter(
|
||||
(errorPromoCode) => !oldInactivePromos?.includes(errorPromoCode)
|
||||
(errorPromoCode) => !oldInactivePromos?.includes(errorPromoCode),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -334,7 +334,7 @@ export function createPromoSuccessAlert(promoCode) {
|
|||
return {
|
||||
messageHeadline: "Promo code applied!",
|
||||
messageCopy: `Promo code ${getPromoCodeWithoutBundleIdentifier(
|
||||
promoCode.toUpperCase()
|
||||
promoCode.toUpperCase(),
|
||||
)} was successfully applied to your cart.`,
|
||||
type: "alert-success",
|
||||
isDismissible: true,
|
||||
|
|
@ -351,11 +351,11 @@ export function createPromoErrorAlert(promoCode, errorCode = null, additionalInf
|
|||
};
|
||||
if (stackingPromoErrorCodes.includes(errorCode)) {
|
||||
alert.messageCopy = `Sorry, promo code ${getPromoCodeWithoutBundleIdentifier(
|
||||
promoCode.toUpperCase()
|
||||
promoCode.toUpperCase(),
|
||||
)} cannot be combined with ${additionalInfo[0].toUpperCase()}`;
|
||||
} else {
|
||||
alert.messageCopy = `Sorry, promo code ${getPromoCodeWithoutBundleIdentifier(
|
||||
promoCode.toUpperCase()
|
||||
promoCode.toUpperCase(),
|
||||
)} is not valid`;
|
||||
}
|
||||
return alert;
|
||||
|
|
@ -382,7 +382,7 @@ export function getPromoCodesFromPromoObjectsWithoutDuplicates(promos) {
|
|||
function findLineItemsWithPartType(typeToFind, itemsToSearch) {
|
||||
const partTypeMatches =
|
||||
itemsToSearch?.filter(
|
||||
(lineItem) => lineItem.partType.toUpperCase() === typeToFind.toUpperCase()
|
||||
(lineItem) => lineItem.partType.toUpperCase() === typeToFind.toUpperCase(),
|
||||
) ?? [];
|
||||
return partTypeMatches;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ jest.mock("@/mixins/base-mixin", () => ({
|
|||
dispatchStoreActionWithLogging: jest.fn(
|
||||
(action, { promoCode, addableVaps }, pageNameToLog, someBool) => {
|
||||
return mockReturnsForStoreActions[action];
|
||||
}
|
||||
},
|
||||
),
|
||||
},
|
||||
}));
|
||||
|
|
@ -76,7 +76,7 @@ describe("promotions-helper.js", () => {
|
|||
|
||||
// Assert
|
||||
expect(promoListWithAddableVapsPromoReturn[0].promoIdentifier).toEqual(
|
||||
promoIdentifier
|
||||
promoIdentifier,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
@ -101,29 +101,29 @@ describe("promotions-helper.js", () => {
|
|||
// Null or Empty <promos> scenarios
|
||||
const nullPromosReturn = promotionsHelper.getLineItemsThatMatchPromos(
|
||||
nullPromos,
|
||||
validAvailableLineItemsWithOneItem
|
||||
validAvailableLineItemsWithOneItem,
|
||||
);
|
||||
const emptyPromosReturn = promotionsHelper.getLineItemsThatMatchPromos(
|
||||
emptyPromos,
|
||||
validAvailableLineItemsWithOneItem
|
||||
validAvailableLineItemsWithOneItem,
|
||||
);
|
||||
const nullDiscountedLineItemsReturn = promotionsHelper.getLineItemsThatMatchPromos(
|
||||
promosWithNullDiscountedLineItemIds,
|
||||
validAvailableLineItemsWithOneItem
|
||||
validAvailableLineItemsWithOneItem,
|
||||
);
|
||||
const emptyDiscountedLineItemsReturn = promotionsHelper.getLineItemsThatMatchPromos(
|
||||
promosWithEmptyDiscountedLineItemIds,
|
||||
validAvailableLineItemsWithOneItem
|
||||
validAvailableLineItemsWithOneItem,
|
||||
);
|
||||
|
||||
// Null or Empty <availableLineItems> scenarios
|
||||
const nullAvailableLineItemsReturn = promotionsHelper.getLineItemsThatMatchPromos(
|
||||
validPromosWithOnePromo,
|
||||
nullAvailableLineItems
|
||||
nullAvailableLineItems,
|
||||
);
|
||||
const emptyAvailableLineItemsReturn = promotionsHelper.getLineItemsThatMatchPromos(
|
||||
validPromosWithOnePromo,
|
||||
emptyAvailableLineItems
|
||||
emptyAvailableLineItems,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -168,7 +168,7 @@ describe("promotions-helper.js", () => {
|
|||
},
|
||||
];
|
||||
expect(
|
||||
promotionsHelper.getLineItemsThatMatchPromos(promos, availableLineItems)
|
||||
promotionsHelper.getLineItemsThatMatchPromos(promos, availableLineItems),
|
||||
).toEqual(expected);
|
||||
});
|
||||
});
|
||||
|
|
@ -202,15 +202,15 @@ describe("promotions-helper.js", () => {
|
|||
// Act
|
||||
const addableVapsFromAvailableLineItems =
|
||||
promotionsHelper.getAddableVapsFromAvailableLineItems(
|
||||
availableLineItemsWithFrontWipersAndRainDefense
|
||||
availableLineItemsWithFrontWipersAndRainDefense,
|
||||
);
|
||||
|
||||
// Assert
|
||||
const frontWiperParts = addableVapsFromAvailableLineItems.filter(
|
||||
(lineItem) => lineItem.partType == partTypeStrings.FRONT_WIPER
|
||||
(lineItem) => lineItem.partType == partTypeStrings.FRONT_WIPER,
|
||||
);
|
||||
const rainDefenseParts = addableVapsFromAvailableLineItems.filter(
|
||||
(lineItem) => lineItem.partType == partTypeStrings.RAIN_DEFENSE
|
||||
(lineItem) => lineItem.partType == partTypeStrings.RAIN_DEFENSE,
|
||||
);
|
||||
expect(addableVapsFromAvailableLineItems.length).toEqual(2);
|
||||
expect(frontWiperParts.length).toEqual(1);
|
||||
|
|
@ -264,7 +264,7 @@ describe("promotions-helper.js", () => {
|
|||
const glassPromoArray = promosWithoutVapsPromos.filter(
|
||||
(promo) =>
|
||||
promo.partNumber ==
|
||||
promotionsHelper.promoPartNumberStrings.GLASS_DISCOUNT_PART_NUMBER
|
||||
promotionsHelper.promoPartNumberStrings.GLASS_DISCOUNT_PART_NUMBER,
|
||||
);
|
||||
expect(promosWithoutVapsPromos.length).toEqual(1);
|
||||
expect(glassPromoArray.length).toEqual(1);
|
||||
|
|
@ -284,7 +284,7 @@ describe("promotions-helper.js", () => {
|
|||
await promotionsHelper.revalidatePromosAndValidateQueryStringPromo(
|
||||
newPromo,
|
||||
pricedLineItems,
|
||||
pageNameToLog
|
||||
pageNameToLog,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -304,7 +304,7 @@ describe("promotions-helper.js", () => {
|
|||
await promotionsHelper.revalidatePromosAndValidateQueryStringPromo(
|
||||
newPromo,
|
||||
pricedLineItems,
|
||||
pageNameToLog
|
||||
pageNameToLog,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -328,7 +328,7 @@ describe("promotions-helper.js", () => {
|
|||
await promotionsHelper.revalidatePromosAndValidateQueryStringPromo(
|
||||
newPromo,
|
||||
pricedLineItems,
|
||||
pageNameToLog
|
||||
pageNameToLog,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -352,7 +352,7 @@ describe("promotions-helper.js", () => {
|
|||
await promotionsHelper.revalidatePromosAndValidateQueryStringPromo(
|
||||
newPromo,
|
||||
pricedLineItems,
|
||||
pageNameToLog
|
||||
pageNameToLog,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -373,7 +373,7 @@ describe("promotions-helper.js", () => {
|
|||
await promotionsHelper.revalidatePromosAndValidateQueryStringPromo(
|
||||
newPromo,
|
||||
pricedLineItems,
|
||||
pageNameToLog
|
||||
pageNameToLog,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -400,7 +400,7 @@ describe("promotions-helper.js", () => {
|
|||
await promotionsHelper.revalidatePromosAndValidateQueryStringPromo(
|
||||
newPromo,
|
||||
pricedLineItems,
|
||||
pageNameToLog
|
||||
pageNameToLog,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -417,11 +417,11 @@ describe("promotions-helper.js", () => {
|
|||
// Act
|
||||
const nullPromoResponseReturn =
|
||||
promotionsHelper.buildToastMessagesFromRevalidateOrValidatePromoResponse(
|
||||
nullPromoResponse
|
||||
nullPromoResponse,
|
||||
);
|
||||
const unexpectedPromoResponseReturn =
|
||||
promotionsHelper.buildToastMessagesFromRevalidateOrValidatePromoResponse(
|
||||
unexpectedPromoResponse
|
||||
unexpectedPromoResponse,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -437,11 +437,11 @@ describe("promotions-helper.js", () => {
|
|||
// Act
|
||||
const successPromoResponseReturn =
|
||||
promotionsHelper.buildToastMessagesFromRevalidateOrValidatePromoResponse(
|
||||
successPromoResponse
|
||||
successPromoResponse,
|
||||
);
|
||||
const errorPromoResponseReturn =
|
||||
promotionsHelper.buildToastMessagesFromRevalidateOrValidatePromoResponse(
|
||||
errorPromoResponse
|
||||
errorPromoResponse,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -461,7 +461,7 @@ describe("promotions-helper.js", () => {
|
|||
// Act
|
||||
const bundlePromoResponseReturn =
|
||||
promotionsHelper.buildToastMessagesFromRevalidateOrValidatePromoResponse(
|
||||
bundlePromoResponse
|
||||
bundlePromoResponse,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -481,18 +481,18 @@ describe("promotions-helper.js", () => {
|
|||
// Act
|
||||
const successAndErrorPromoResponseReturn =
|
||||
promotionsHelper.buildToastMessagesFromRevalidateOrValidatePromoResponse(
|
||||
successAndErrorPromoResponse
|
||||
successAndErrorPromoResponse,
|
||||
);
|
||||
|
||||
// Assert
|
||||
// This depends on "createPromoSuccessAlert" implementation, which is bad practice
|
||||
// but jest has trouble mocking same file dependencies
|
||||
const successAlert = successAndErrorPromoResponseReturn.filter((alert) =>
|
||||
alert.messageCopy.toLowerCase().includes("successpromo")
|
||||
alert.messageCopy.toLowerCase().includes("successpromo"),
|
||||
);
|
||||
expect(successAlert[0]).toHaveProperty("type", "alert-success");
|
||||
const errorAlert = successAndErrorPromoResponseReturn.filter((alert) =>
|
||||
alert.messageCopy.toLowerCase().includes("errorpromo")
|
||||
alert.messageCopy.toLowerCase().includes("errorpromo"),
|
||||
);
|
||||
expect(errorAlert[0]).toHaveProperty("type", "alert-danger");
|
||||
});
|
||||
|
|
@ -515,18 +515,18 @@ describe("promotions-helper.js", () => {
|
|||
promotionsHelper.buildToastMessagesFromRevalidateOrValidatePromoResponse(
|
||||
successAndErrorPromoResponse,
|
||||
oldActivePromos,
|
||||
oldInactivePromos
|
||||
oldInactivePromos,
|
||||
);
|
||||
|
||||
// Assert
|
||||
// This depends on "createPromoSuccessAlert" implementation, which is bad practice
|
||||
// but jest has trouble mocking same file dependencies
|
||||
const successAlert = successAndErrorPromoResponseReturn.filter((alert) =>
|
||||
alert.messageCopy.toLowerCase().includes("successpromo")
|
||||
alert.messageCopy.toLowerCase().includes("successpromo"),
|
||||
);
|
||||
expect(successAlert[0]).toHaveProperty("type", "alert-success");
|
||||
const errorAlert = successAndErrorPromoResponseReturn.filter((alert) =>
|
||||
alert.messageCopy.toLowerCase().includes("errorpromo")
|
||||
alert.messageCopy.toLowerCase().includes("errorpromo"),
|
||||
);
|
||||
expect(errorAlert[0]).toHaveProperty("type", "alert-danger");
|
||||
});
|
||||
|
|
@ -547,33 +547,33 @@ describe("promotions-helper.js", () => {
|
|||
// Bad promos
|
||||
const nullPromosReturn = promotionsHelper.getPromosThatMatchLineItemsOnOrder(
|
||||
nullPromos,
|
||||
validLineItemsOnOrder
|
||||
validLineItemsOnOrder,
|
||||
);
|
||||
const emptyPromosReturn = promotionsHelper.getPromosThatMatchLineItemsOnOrder(
|
||||
emptyPromos,
|
||||
validLineItemsOnOrder
|
||||
validLineItemsOnOrder,
|
||||
);
|
||||
|
||||
// Bad lineItemsOnOrder
|
||||
const nullLineItemsOnOrderReturn =
|
||||
promotionsHelper.getPromosThatMatchLineItemsOnOrder(
|
||||
validPromos,
|
||||
nullLineItemsOnOrder
|
||||
nullLineItemsOnOrder,
|
||||
);
|
||||
const emptyLineItemsOnOrderReturn =
|
||||
promotionsHelper.getPromosThatMatchLineItemsOnOrder(
|
||||
validPromos,
|
||||
emptyLineItemsOnOrder
|
||||
emptyLineItemsOnOrder,
|
||||
);
|
||||
|
||||
// Bad both
|
||||
const nullBothReturn = promotionsHelper.getPromosThatMatchLineItemsOnOrder(
|
||||
nullPromos,
|
||||
nullLineItemsOnOrder
|
||||
nullLineItemsOnOrder,
|
||||
);
|
||||
const emptyBothReturn = promotionsHelper.getPromosThatMatchLineItemsOnOrder(
|
||||
emptyPromos,
|
||||
emptyLineItemsOnOrder
|
||||
emptyLineItemsOnOrder,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -599,7 +599,7 @@ describe("promotions-helper.js", () => {
|
|||
// Act
|
||||
const returnedItems = promotionsHelper.getPromosThatMatchLineItemsOnOrder(
|
||||
promos,
|
||||
lineItemsOnOrder
|
||||
lineItemsOnOrder,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -632,7 +632,7 @@ describe("promotions-helper.js", () => {
|
|||
// Act
|
||||
const returnedItems = promotionsHelper.getPromosThatMatchLineItemsOnOrder(
|
||||
promos,
|
||||
lineItemsOnOrder
|
||||
lineItemsOnOrder,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -665,12 +665,12 @@ describe("promotions-helper.js", () => {
|
|||
const nullPromosReturn = promotionsHelper.getVapsThatNeedToBeAddedToSatisfyPromos(
|
||||
nullPromos,
|
||||
validAvailableLineItems,
|
||||
validLineItemsOnOrder
|
||||
validLineItemsOnOrder,
|
||||
);
|
||||
const emptyPromosReturn = promotionsHelper.getVapsThatNeedToBeAddedToSatisfyPromos(
|
||||
emptyPromos,
|
||||
validAvailableLineItems,
|
||||
validLineItemsOnOrder
|
||||
validLineItemsOnOrder,
|
||||
);
|
||||
|
||||
// Bad availableLineItems
|
||||
|
|
@ -678,25 +678,25 @@ describe("promotions-helper.js", () => {
|
|||
promotionsHelper.getVapsThatNeedToBeAddedToSatisfyPromos(
|
||||
validPromos,
|
||||
nullAvailableLineItems,
|
||||
validLineItemsOnOrder
|
||||
validLineItemsOnOrder,
|
||||
);
|
||||
const emptyAvailableLineItemsReturn =
|
||||
promotionsHelper.getVapsThatNeedToBeAddedToSatisfyPromos(
|
||||
validPromos,
|
||||
emptyAvailableLineItems,
|
||||
validLineItemsOnOrder
|
||||
validLineItemsOnOrder,
|
||||
);
|
||||
|
||||
// Bad all
|
||||
const nullAllReturn = promotionsHelper.getVapsThatNeedToBeAddedToSatisfyPromos(
|
||||
nullPromos,
|
||||
nullAvailableLineItems,
|
||||
nullLineItemsOnOrder
|
||||
nullLineItemsOnOrder,
|
||||
);
|
||||
const emptyAllReturn = promotionsHelper.getVapsThatNeedToBeAddedToSatisfyPromos(
|
||||
emptyPromos,
|
||||
emptyAvailableLineItems,
|
||||
emptyLineItemsOnOrder
|
||||
emptyLineItemsOnOrder,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -730,7 +730,7 @@ describe("promotions-helper.js", () => {
|
|||
const actualReturn = promotionsHelper.getVapsThatNeedToBeAddedToSatisfyPromos(
|
||||
promos,
|
||||
availableLineItems,
|
||||
lineItemsOnOrder
|
||||
lineItemsOnOrder,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -759,7 +759,7 @@ describe("promotions-helper.js", () => {
|
|||
const actualReturn = promotionsHelper.getVapsThatNeedToBeAddedToSatisfyPromos(
|
||||
promos,
|
||||
availableLineItems,
|
||||
lineItemsOnOrder
|
||||
lineItemsOnOrder,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -779,23 +779,23 @@ describe("promotions-helper.js", () => {
|
|||
const nullInactivePromosReturn =
|
||||
promotionsHelper.removeCurrentlyActivePromoCodesFromInactivePromos(
|
||||
validActivePromoObjects,
|
||||
nullInactivePromos
|
||||
nullInactivePromos,
|
||||
);
|
||||
const emptyInactivePromosReturn =
|
||||
promotionsHelper.removeCurrentlyActivePromoCodesFromInactivePromos(
|
||||
validActivePromoObjects,
|
||||
emptyInactivePromos
|
||||
emptyInactivePromos,
|
||||
);
|
||||
|
||||
const allNullReturn =
|
||||
promotionsHelper.removeCurrentlyActivePromoCodesFromInactivePromos(
|
||||
nullActivePromoObjects,
|
||||
nullInactivePromos
|
||||
nullInactivePromos,
|
||||
);
|
||||
const allEmptyReturn =
|
||||
promotionsHelper.removeCurrentlyActivePromoCodesFromInactivePromos(
|
||||
emptyActivePromoObjects,
|
||||
emptyInactivePromos
|
||||
emptyInactivePromos,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -815,7 +815,7 @@ describe("promotions-helper.js", () => {
|
|||
const actualReturn =
|
||||
promotionsHelper.removeCurrentlyActivePromoCodesFromInactivePromos(
|
||||
activePromoObjects,
|
||||
inactivePromos
|
||||
inactivePromos,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -835,7 +835,7 @@ describe("promotions-helper.js", () => {
|
|||
const actualReturn =
|
||||
promotionsHelper.removeCurrentlyActivePromoCodesFromInactivePromos(
|
||||
activePromoObjects,
|
||||
inactivePromos
|
||||
inactivePromos,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -850,7 +850,7 @@ describe("promotions-helper.js", () => {
|
|||
const actualReturn =
|
||||
promotionsHelper.removeCurrentlyActivePromoCodesFromInactivePromos(
|
||||
activePromoObjects,
|
||||
inactivePromos
|
||||
inactivePromos,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -894,21 +894,21 @@ describe("promotions-helper.js", () => {
|
|||
// Act
|
||||
const nullNewInactivePromosReturn = promotionsHelper.getNewlyInactivatedPromos(
|
||||
validOldInactivePromos,
|
||||
nullNewInactivePromos
|
||||
nullNewInactivePromos,
|
||||
);
|
||||
const emptyNewInactivePromosReturn = promotionsHelper.getNewlyInactivatedPromos(
|
||||
validOldInactivePromos,
|
||||
emptyNewInactivePromos
|
||||
emptyNewInactivePromos,
|
||||
);
|
||||
|
||||
const nullOldInactivePromosReturn = promotionsHelper.getNewlyInactivatedPromos(
|
||||
nullOldInactivePromos,
|
||||
validNewInactivePromos
|
||||
validNewInactivePromos,
|
||||
);
|
||||
|
||||
const allNullReturn = promotionsHelper.getNewlyInactivatedPromos(
|
||||
nullOldInactivePromos,
|
||||
nullNewInactivePromos
|
||||
nullNewInactivePromos,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -931,7 +931,7 @@ describe("promotions-helper.js", () => {
|
|||
// Act
|
||||
const actualReturn = promotionsHelper.getNewlyInactivatedPromos(
|
||||
oldInactivePromos,
|
||||
newInactivePromos
|
||||
newInactivePromos,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -950,7 +950,7 @@ describe("promotions-helper.js", () => {
|
|||
// Act
|
||||
const actualReturn = promotionsHelper.getNewlyInactivatedPromos(
|
||||
oldInactivePromos,
|
||||
newInactivePromos
|
||||
newInactivePromos,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -971,12 +971,12 @@ describe("promotions-helper.js", () => {
|
|||
const stackingReturn = promotionsHelper.createPromoErrorAlert(
|
||||
promoCode,
|
||||
stackingErrorCode,
|
||||
additionalInfo
|
||||
additionalInfo,
|
||||
);
|
||||
const nonStackingReturn = promotionsHelper.createPromoErrorAlert(
|
||||
promoCode,
|
||||
nonStackingErrorCode,
|
||||
additionalInfo
|
||||
additionalInfo,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -1040,14 +1040,14 @@ describe("promotions-helper.js", () => {
|
|||
await promotionsHelper.revalidatePromosAndValidateQueryStringPromo(
|
||||
newPromo,
|
||||
pricedLineItems,
|
||||
pageNameToLog
|
||||
pageNameToLog,
|
||||
);
|
||||
|
||||
// Assert
|
||||
expect(baseMixin.methods.dispatchStoreAction).toBeCalledWith(
|
||||
storeActions.SAVE_ACTIVE_AND_OR_INACTIVE_PROMOS,
|
||||
expect.anything(),
|
||||
expect.anything()
|
||||
expect.anything(),
|
||||
);
|
||||
expect(baseMixin.methods.dispatchStoreAction).toBeCalledTimes(2);
|
||||
});
|
||||
|
|
@ -1072,14 +1072,14 @@ describe("promotions-helper.js", () => {
|
|||
await promotionsHelper.revalidatePromosAndValidateQueryStringPromo(
|
||||
newPromo,
|
||||
pricedLineItems,
|
||||
pageNameToLog
|
||||
pageNameToLog,
|
||||
);
|
||||
|
||||
// Assert
|
||||
expect(baseMixin.methods.dispatchStoreAction).toBeCalledWith(
|
||||
storeActions.SAVE_ACTIVE_AND_OR_INACTIVE_PROMOS,
|
||||
{ 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 () => {
|
||||
|
|
@ -1109,14 +1109,14 @@ describe("promotions-helper.js", () => {
|
|||
await promotionsHelper.revalidatePromosAndValidateQueryStringPromo(
|
||||
newPromo,
|
||||
pricedLineItems,
|
||||
pageNameToLog
|
||||
pageNameToLog,
|
||||
);
|
||||
|
||||
// Assert
|
||||
expect(baseMixin.methods.dispatchStoreAction).not.toBeCalledWith(
|
||||
storeActions.SAVE_ACTIVE_AND_OR_INACTIVE_PROMOS,
|
||||
{ inactivePromos: ["testPromo"] },
|
||||
expect.anything()
|
||||
expect.anything(),
|
||||
);
|
||||
});
|
||||
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(
|
||||
newPromo,
|
||||
pricedLineItems,
|
||||
pageNameToLog
|
||||
pageNameToLog,
|
||||
);
|
||||
|
||||
// Assert
|
||||
expect(baseMixin.methods.dispatchStoreAction).not.toBeCalledWith(
|
||||
storeActions.SAVE_ACTIVE_AND_OR_INACTIVE_PROMOS,
|
||||
expect.anything(),
|
||||
expect.anything()
|
||||
expect.anything(),
|
||||
);
|
||||
});
|
||||
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(
|
||||
newPromo,
|
||||
pricedLineItems,
|
||||
pageNameToLog
|
||||
pageNameToLog,
|
||||
);
|
||||
|
||||
// Assert
|
||||
expect(baseMixin.methods.dispatchStoreAction).not.toBeCalledWith(
|
||||
storeActions.SAVE_ACTIVE_AND_OR_INACTIVE_PROMOS,
|
||||
{ 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 () => {
|
||||
|
|
@ -1197,7 +1197,7 @@ describe("promotions-helper.js", () => {
|
|||
await promotionsHelper.revalidatePromosAndValidateQueryStringPromo(
|
||||
null,
|
||||
null,
|
||||
null
|
||||
null,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -1207,7 +1207,7 @@ describe("promotions-helper.js", () => {
|
|||
activePromos: expect.anything(),
|
||||
inactivePromos: ["testPromo1", "testPromo2"],
|
||||
},
|
||||
false
|
||||
false,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ export function containsLineItemWithPartType(typeToFind, itemsToSearch) {
|
|||
|
||||
export function findLineItemsWithPartType(typeToFind, itemsToSearch) {
|
||||
const partTypeMatches = itemsToSearch?.filter(
|
||||
(lineItem) => lineItem.partType.toUpperCase() === typeToFind.toUpperCase()
|
||||
(lineItem) => lineItem.partType.toUpperCase() === typeToFind.toUpperCase(),
|
||||
);
|
||||
return partTypeMatches;
|
||||
}
|
||||
|
|
@ -26,7 +26,7 @@ export function getVapsLineItems(availableLineItems, vapTypes) {
|
|||
|
||||
export function containsGlassPieceWithLocation(locationToFind, glassPiecesToSearch) {
|
||||
const glassLocationMatches = glassPiecesToSearch?.filter(
|
||||
(glassPiece) => glassPiece.glassLocation.toUpperCase() === locationToFind.toUpperCase()
|
||||
(glassPiece) => glassPiece.glassLocation.toUpperCase() === locationToFind.toUpperCase(),
|
||||
);
|
||||
|
||||
return !!glassLocationMatches?.length;
|
||||
|
|
@ -37,21 +37,21 @@ export function getAvailablePackages(glassToReplace, availableLineItems, isRepai
|
|||
glassToReplace,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
packageNames.TIER_ONE
|
||||
packageNames.TIER_ONE,
|
||||
);
|
||||
|
||||
let tierTwoVaps = getPackageContents(
|
||||
glassToReplace,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
packageNames.TIER_TWO
|
||||
packageNames.TIER_TWO,
|
||||
);
|
||||
|
||||
let tierThreeVaps = getPackageContents(
|
||||
glassToReplace,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
packageNames.TIER_THREE
|
||||
packageNames.TIER_THREE,
|
||||
);
|
||||
|
||||
if (tierTwoVaps.length === 0) {
|
||||
|
|
@ -105,11 +105,11 @@ export function shouldFrontWipersBeAvailable(
|
|||
glassToReplace,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
targetTier
|
||||
targetTier,
|
||||
) {
|
||||
const frontWiperIsAvailable = containsLineItemWithPartType(
|
||||
partTypeStrings.FRONT_WIPER,
|
||||
availableLineItems
|
||||
availableLineItems,
|
||||
);
|
||||
|
||||
const isFrontWindshieldTask =
|
||||
|
|
@ -129,19 +129,19 @@ export function shouldRearWipersBeAvailable(
|
|||
glassToReplace,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
targetTier
|
||||
targetTier,
|
||||
) {
|
||||
const rearWiperIsAvailable = containsLineItemWithPartType(
|
||||
partTypeStrings.REAR_WIPER,
|
||||
availableLineItems
|
||||
availableLineItems,
|
||||
);
|
||||
const frontWiperIsAvailable = containsLineItemWithPartType(
|
||||
partTypeStrings.FRONT_WIPER,
|
||||
availableLineItems
|
||||
availableLineItems,
|
||||
);
|
||||
const isRearWindshieldTask = containsGlassPieceWithLocation(
|
||||
glassLocations.REAR,
|
||||
glassToReplace
|
||||
glassToReplace,
|
||||
);
|
||||
|
||||
switch (targetTier) {
|
||||
|
|
@ -158,26 +158,26 @@ export function shouldRainDefenseBeAvailable(
|
|||
glassToReplace,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
targetTier
|
||||
targetTier,
|
||||
) {
|
||||
const isTierThree = targetTier === packageNames.TIER_THREE;
|
||||
const frontWipersInTierTwo = shouldFrontWipersBeAvailable(
|
||||
glassToReplace,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
packageNames.TIER_TWO
|
||||
packageNames.TIER_TWO,
|
||||
);
|
||||
const frontWipersInTierThree = shouldFrontWipersBeAvailable(
|
||||
glassToReplace,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
packageNames.TIER_THREE
|
||||
packageNames.TIER_THREE,
|
||||
);
|
||||
const rearWipersInTierTwo = shouldRearWipersBeAvailable(
|
||||
glassToReplace,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
packageNames.TIER_TWO
|
||||
packageNames.TIER_TWO,
|
||||
);
|
||||
|
||||
return isTierThree && !(rearWipersInTierTwo && !frontWipersInTierTwo && frontWipersInTierThree);
|
||||
|
|
@ -203,7 +203,7 @@ export function getHighestRequiredTier(glassToReplace, availableLineItems, isRep
|
|||
glassToReplace,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
vaps[i].partType
|
||||
vaps[i].partType,
|
||||
);
|
||||
|
||||
currentHighestTier = maxTier(currentHighestTier, lowestTierForItem);
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ describe("service-package-helper.js", () => {
|
|||
// Act
|
||||
const result = servicePackageHelper.containsGlassPieceWithLocation(
|
||||
locationName,
|
||||
locations
|
||||
locations,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -239,7 +239,7 @@ describe("service-package-helper.js", () => {
|
|||
// Act
|
||||
const result = servicePackageHelper.containsGlassPieceWithLocation(
|
||||
locationName,
|
||||
locations
|
||||
locations,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -255,7 +255,7 @@ describe("service-package-helper.js", () => {
|
|||
// Act
|
||||
const result = servicePackageHelper.containsGlassPieceWithLocation(
|
||||
locationName,
|
||||
locations
|
||||
locations,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -271,7 +271,7 @@ describe("service-package-helper.js", () => {
|
|||
// Act
|
||||
const result = servicePackageHelper.containsGlassPieceWithLocation(
|
||||
locationName,
|
||||
locations
|
||||
locations,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -287,7 +287,7 @@ describe("service-package-helper.js", () => {
|
|||
// Act
|
||||
const result = servicePackageHelper.containsGlassPieceWithLocation(
|
||||
locationName,
|
||||
locations
|
||||
locations,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -306,7 +306,7 @@ describe("service-package-helper.js", () => {
|
|||
const results = servicePackageHelper.getAvailablePackages(
|
||||
damageLocations,
|
||||
availableLineItems,
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -329,7 +329,7 @@ describe("service-package-helper.js", () => {
|
|||
const results = servicePackageHelper.getAvailablePackages(
|
||||
damageLocations,
|
||||
availableLineItems,
|
||||
true
|
||||
true,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -358,13 +358,13 @@ describe("service-package-helper.js", () => {
|
|||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
packageNames.TIER_TWO
|
||||
packageNames.TIER_TWO,
|
||||
);
|
||||
const resultThree = servicePackageHelper.shouldFrontWipersBeAvailable(
|
||||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
packageNames.TIER_THREE
|
||||
packageNames.TIER_THREE,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -383,13 +383,13 @@ describe("service-package-helper.js", () => {
|
|||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
packageNames.TIER_TWO
|
||||
packageNames.TIER_TWO,
|
||||
);
|
||||
const resultThree = servicePackageHelper.shouldFrontWipersBeAvailable(
|
||||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
packageNames.TIER_THREE
|
||||
packageNames.TIER_THREE,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -408,7 +408,7 @@ describe("service-package-helper.js", () => {
|
|||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
packageNames.TIER_TWO
|
||||
packageNames.TIER_TWO,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -426,7 +426,7 @@ describe("service-package-helper.js", () => {
|
|||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
packageNames.TIER_THREE
|
||||
packageNames.TIER_THREE,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -444,19 +444,19 @@ describe("service-package-helper.js", () => {
|
|||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
packageNames.TIER_ONE
|
||||
packageNames.TIER_ONE,
|
||||
);
|
||||
const resultTwo = servicePackageHelper.shouldFrontWipersBeAvailable(
|
||||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
packageNames.TIER_TWO
|
||||
packageNames.TIER_TWO,
|
||||
);
|
||||
const resultThree = servicePackageHelper.shouldFrontWipersBeAvailable(
|
||||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
packageNames.TIER_THREE
|
||||
packageNames.TIER_THREE,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -476,7 +476,7 @@ describe("service-package-helper.js", () => {
|
|||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
packageNames.TIER_ONE
|
||||
packageNames.TIER_ONE,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -496,13 +496,13 @@ describe("service-package-helper.js", () => {
|
|||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
packageNames.TIER_TWO
|
||||
packageNames.TIER_TWO,
|
||||
);
|
||||
const resultThree = servicePackageHelper.shouldRearWipersBeAvailable(
|
||||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
packageNames.TIER_THREE
|
||||
packageNames.TIER_THREE,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -521,7 +521,7 @@ describe("service-package-helper.js", () => {
|
|||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
packageNames.TIER_TWO
|
||||
packageNames.TIER_TWO,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -539,7 +539,7 @@ describe("service-package-helper.js", () => {
|
|||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
packageNames.TIER_THREE
|
||||
packageNames.TIER_THREE,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -561,7 +561,7 @@ describe("service-package-helper.js", () => {
|
|||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
packageNames.TIER_THREE
|
||||
packageNames.TIER_THREE,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -579,19 +579,19 @@ describe("service-package-helper.js", () => {
|
|||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
packageNames.TIER_ONE
|
||||
packageNames.TIER_ONE,
|
||||
);
|
||||
const resultTwo = servicePackageHelper.shouldRearWipersBeAvailable(
|
||||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
packageNames.TIER_TWO
|
||||
packageNames.TIER_TWO,
|
||||
);
|
||||
const resultThree = servicePackageHelper.shouldRearWipersBeAvailable(
|
||||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
packageNames.TIER_THREE
|
||||
packageNames.TIER_THREE,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -611,7 +611,7 @@ describe("service-package-helper.js", () => {
|
|||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
packageNames.TIER_ONE
|
||||
packageNames.TIER_ONE,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -636,19 +636,19 @@ describe("service-package-helper.js", () => {
|
|||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
packageNames.TIER_ONE
|
||||
packageNames.TIER_ONE,
|
||||
);
|
||||
const resultTwo = servicePackageHelper.shouldRainDefenseBeAvailable(
|
||||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
packageNames.TIER_TWO
|
||||
packageNames.TIER_TWO,
|
||||
);
|
||||
const resultThree = servicePackageHelper.shouldRainDefenseBeAvailable(
|
||||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
packageNames.TIER_THREE
|
||||
packageNames.TIER_THREE,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -675,7 +675,7 @@ describe("service-package-helper.js", () => {
|
|||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
packageNames.TIER_THREE
|
||||
packageNames.TIER_THREE,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -702,7 +702,7 @@ describe("service-package-helper.js", () => {
|
|||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
partTypeStrings.RAIN_DEFENSE
|
||||
partTypeStrings.RAIN_DEFENSE,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -727,13 +727,13 @@ describe("service-package-helper.js", () => {
|
|||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
partTypeStrings.FRONT_WIPER
|
||||
partTypeStrings.FRONT_WIPER,
|
||||
);
|
||||
const resultRear = servicePackageHelper.getLowestTierForType(
|
||||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
partTypeStrings.REAR_WIPER
|
||||
partTypeStrings.REAR_WIPER,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -758,7 +758,7 @@ describe("service-package-helper.js", () => {
|
|||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
partTypeStrings.RAIN_DEFENSE
|
||||
partTypeStrings.RAIN_DEFENSE,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -788,7 +788,7 @@ describe("service-package-helper.js", () => {
|
|||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
vaps
|
||||
vaps,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -812,7 +812,7 @@ describe("service-package-helper.js", () => {
|
|||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
vaps
|
||||
vaps,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -836,7 +836,7 @@ describe("service-package-helper.js", () => {
|
|||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
vaps
|
||||
vaps,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -860,7 +860,7 @@ describe("service-package-helper.js", () => {
|
|||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
vaps
|
||||
vaps,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -891,7 +891,7 @@ describe("service-package-helper.js", () => {
|
|||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
vaps
|
||||
vaps,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -915,7 +915,7 @@ describe("service-package-helper.js", () => {
|
|||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
vaps
|
||||
vaps,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -939,7 +939,7 @@ describe("service-package-helper.js", () => {
|
|||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
vaps
|
||||
vaps,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -963,7 +963,7 @@ describe("service-package-helper.js", () => {
|
|||
damageLocations,
|
||||
availableLineItems,
|
||||
isRepair,
|
||||
vaps
|
||||
vaps,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ export function getMockOrderInfo(
|
|||
mockReferralDate,
|
||||
parentAccountNumber = "0",
|
||||
savedSessionId,
|
||||
crmCustomerId
|
||||
crmCustomerId,
|
||||
) {
|
||||
return {
|
||||
referralNumber: mockReferralNumber,
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ describe("address-lookup.vue", () => {
|
|||
|
||||
// Assert
|
||||
expect(wrapper.findComponent({ ref: "alertMatchedDifferentVehicle" }).isVisible()).toBe(
|
||||
true
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -145,7 +145,9 @@ describe("address-lookup.vue", () => {
|
|||
|
||||
// Assert
|
||||
expect(
|
||||
wrapper.findComponent({ ref: "alertVinLookupsByHomeAddressNotAllowed" }).isVisible()
|
||||
wrapper
|
||||
.findComponent({ ref: "alertVinLookupsByHomeAddressNotAllowed" })
|
||||
.isVisible(),
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
|
|
@ -296,7 +298,7 @@ describe("address-lookup.vue", () => {
|
|||
undefined,
|
||||
{},
|
||||
{},
|
||||
carsFound
|
||||
carsFound,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -384,7 +386,7 @@ describe("address-lookup.vue", () => {
|
|||
navigationScenarios.SELECTED_VIN_WITH_MISMATCHED_GLASS,
|
||||
undefined,
|
||||
{},
|
||||
{ displayVehicleChangeAlert: true }
|
||||
{ displayVehicleChangeAlert: true },
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -480,7 +482,7 @@ describe("address-lookup.vue", () => {
|
|||
licenseZip: "43215",
|
||||
},
|
||||
"address-lookup",
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
expect(wrapper.vm.dispatchStoreActionWithLogging).toHaveBeenCalledWith(
|
||||
|
|
@ -488,7 +490,7 @@ describe("address-lookup.vue", () => {
|
|||
{
|
||||
zip: "43215",
|
||||
},
|
||||
"address-lookup"
|
||||
"address-lookup",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
@ -525,7 +527,7 @@ describe("address-lookup.vue", () => {
|
|||
});
|
||||
|
||||
expect(wrapper.findComponent({ ref: "alertNonServiceableZip" }).exists()).toBe(
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -534,10 +536,10 @@ describe("address-lookup.vue", () => {
|
|||
// Assert
|
||||
expect(wrapper.vm.displayNonServiceableZipAlert).toBe(true);
|
||||
expect(wrapper.findComponent({ ref: "alertNonServiceableZip" }).exists()).toBe(
|
||||
true
|
||||
true,
|
||||
);
|
||||
expect(wrapper.findComponent({ ref: "alertNonServiceableZip" }).isVisible()).toBe(
|
||||
true
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -568,7 +570,7 @@ describe("address-lookup.vue", () => {
|
|||
//FIX THIS
|
||||
// Assert
|
||||
expect(wrapper.vm.dispatchStoreAction).not.toHaveBeenCalledWith(
|
||||
storeActions.UPDATE_SERVICE_LOCATION_WITH_VEHICLE_REGISTRATION
|
||||
storeActions.UPDATE_SERVICE_LOCATION_WITH_VEHICLE_REGISTRATION,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -632,7 +634,7 @@ describe("address-lookup.vue", () => {
|
|||
|
||||
// // Assert
|
||||
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.order.serviceLocation.zipCode).toEqual("11111");
|
||||
|
|
@ -721,7 +723,7 @@ function setupMocks({
|
|||
},
|
||||
},
|
||||
mixins: [mockMixin],
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
const apiResponses = {
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ import vinPagesMixin from "@/mixins/vin-pages-mixin";
|
|||
defineRule("service-zip-required", required(errorMessages.SERVICE_ZIP_REQUIRED));
|
||||
defineRule(
|
||||
"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 {
|
||||
|
|
@ -196,7 +196,7 @@ export default {
|
|||
this.$route.query[this.queryStrings.FMG_PAGE],
|
||||
this.GaActions.SUBMITTED,
|
||||
this.GaLabels.ADDRESS_LOOKUP,
|
||||
true
|
||||
true,
|
||||
);
|
||||
});
|
||||
},
|
||||
|
|
@ -239,7 +239,7 @@ export default {
|
|||
licenseState: this.customerQuestions.addressQuestions.state,
|
||||
},
|
||||
"address-lookup",
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
// Settle promises and get results
|
||||
|
|
@ -256,14 +256,14 @@ export default {
|
|||
{
|
||||
zip: this.serviceZipCode,
|
||||
},
|
||||
"address-lookup"
|
||||
"address-lookup",
|
||||
)
|
||||
: this.dispatchStoreActionWithLogging(
|
||||
storeActions.VALIDATE_ZIP,
|
||||
{
|
||||
zip: this.customerQuestions.addressQuestions.zipCode,
|
||||
},
|
||||
"address-lookup"
|
||||
"address-lookup",
|
||||
),
|
||||
},
|
||||
];
|
||||
|
|
@ -300,12 +300,12 @@ export default {
|
|||
|
||||
this.isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId(
|
||||
carFound.carId,
|
||||
"address-lookup"
|
||||
"address-lookup",
|
||||
);
|
||||
|
||||
// Update button "Continue with..."
|
||||
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();
|
||||
}
|
||||
|
|
@ -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
|
||||
// so we can go to the Heritage Funnel directly
|
||||
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) {
|
||||
|
|
@ -358,13 +358,13 @@ export default {
|
|||
lastName: this.customerQuestions.lastName,
|
||||
},
|
||||
},
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
await this.dispatchStoreAction(
|
||||
storeActions.SAVE_EMAIL,
|
||||
this.customerQuestions.emailAddress,
|
||||
false
|
||||
false,
|
||||
);
|
||||
await this.dispatchStoreAction(
|
||||
storeActions.SAVE_SERVICE_ZIP_CODE_INFO,
|
||||
|
|
@ -373,7 +373,7 @@ export default {
|
|||
zipCode: this.serviceZipCode,
|
||||
zipCodeCtu: resultMap.serviceZipValidationResponse.zipCodeCtu,
|
||||
},
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
return await this.navigateForward(carsFound);
|
||||
|
|
@ -381,7 +381,7 @@ export default {
|
|||
async navigateForward(carsFound) {
|
||||
// Match vehicles found to vehicles in state.
|
||||
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"
|
||||
|
|
@ -395,7 +395,7 @@ export default {
|
|||
this.navigationScenarios.SELECTED_VIN_WITH_MISMATCHED_GLASS,
|
||||
this.$route,
|
||||
{},
|
||||
{ [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: true }
|
||||
{ [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: true },
|
||||
);
|
||||
} else if (matchingCars.length === 1) {
|
||||
await this.navigateForwardWithSingleCarMatch();
|
||||
|
|
@ -405,7 +405,7 @@ export default {
|
|||
this.$route,
|
||||
{},
|
||||
{},
|
||||
carsFound
|
||||
carsFound,
|
||||
);
|
||||
}
|
||||
},
|
||||
|
|
@ -426,7 +426,7 @@ export default {
|
|||
: this.customerQuestions.addressQuestions.zipCode;
|
||||
const text = this.getCmsContent(
|
||||
"AlertNonServiceableZipWidget",
|
||||
"HeadlineText"
|
||||
"HeadlineText",
|
||||
).replaceAll("{custom:serviceZip}", zipCode);
|
||||
return text;
|
||||
},
|
||||
|
|
@ -436,7 +436,7 @@ export default {
|
|||
AlertMatchedDifferentVehicleHeader() {
|
||||
return this.getCmsContent(
|
||||
"AlertMatchedDifferentVehicleWidget",
|
||||
"HeadlineText"
|
||||
"HeadlineText",
|
||||
).replaceAll("{custom:glassText}", getDamageString());
|
||||
},
|
||||
AlertMatchedDifferentVehicleBody() {
|
||||
|
|
@ -454,7 +454,7 @@ export default {
|
|||
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"
|
||||
this.$refs.navbar.updateButtonText(
|
||||
this.getCmsContent("FunnelFooterWidget", "ForwardButtonText")
|
||||
this.getCmsContent("FunnelFooterWidget", "ForwardButtonText"),
|
||||
);
|
||||
this.showServiceZipField = false;
|
||||
this.resetWarningsAndErrors();
|
||||
|
|
|
|||
|
|
@ -61,8 +61,8 @@ defineRule(
|
|||
"email-address-format",
|
||||
regex(
|
||||
/^([a-zA-Z0-9_\-.+]+)@([a-zA-Z0-9-]+)\.([a-zA-Z]{2,})$/,
|
||||
errorMessages.EMAIL_ADDRESS_FORMAT
|
||||
)
|
||||
errorMessages.EMAIL_ADDRESS_FORMAT,
|
||||
),
|
||||
);
|
||||
|
||||
export default {
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ export default {
|
|||
differentVehicleAlertHeader() {
|
||||
return this.getCmsContent("FoundWindshield", "HeadlineText").replaceAll(
|
||||
"{custom:damage}",
|
||||
getDamageString()
|
||||
getDamageString(),
|
||||
);
|
||||
},
|
||||
differentVehicleAlertBody() {
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ export default {
|
|||
AlertFoundMultipleVehiclesHeader() {
|
||||
return this.getCmsContent("FoundMultipleVehicles", "HeadlineText").replaceAll(
|
||||
"{custom:vehicleCount}",
|
||||
this.vehicleCount
|
||||
this.vehicleCount,
|
||||
);
|
||||
},
|
||||
AlertProvideVinBody() {
|
||||
|
|
@ -179,7 +179,7 @@ export default {
|
|||
{
|
||||
vin: this.selectedVehicle.vin,
|
||||
},
|
||||
"address-vehicles"
|
||||
"address-vehicles",
|
||||
).catch(() => {
|
||||
this.$refs.navbar.removeLoader();
|
||||
});
|
||||
|
|
@ -190,7 +190,7 @@ export default {
|
|||
|
||||
this.isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId(
|
||||
vinLookup.data.carId,
|
||||
"address-vehicles"
|
||||
"address-vehicles",
|
||||
);
|
||||
|
||||
await this.dispatchStoreAction(
|
||||
|
|
@ -201,7 +201,7 @@ export default {
|
|||
}),
|
||||
isSelectedGlassAvailableForVehicle: this.isSelectedGlassAvailableForVehicle,
|
||||
},
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
return await this.navigateForward();
|
||||
|
|
@ -212,7 +212,7 @@ export default {
|
|||
this.navigationScenarios.CLICKED_FORWARD,
|
||||
this.$route,
|
||||
{},
|
||||
{ [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: true }
|
||||
{ [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: true },
|
||||
);
|
||||
} else {
|
||||
await this.navigateForwardWithSingleCarMatch();
|
||||
|
|
@ -228,11 +228,11 @@ export default {
|
|||
this.selectedVehicle?.vehicle.carId !== store.getters.vehicle.carId;
|
||||
if (this.isCarIdDifferent) {
|
||||
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 {
|
||||
this.$refs.navbar.updateButtonText(
|
||||
this.getCmsContent("FunnelFooterWidget", "ForwardButtonText")
|
||||
this.getCmsContent("FunnelFooterWidget", "ForwardButtonText"),
|
||||
);
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ jest.mock(
|
|||
() => {
|
||||
return {};
|
||||
},
|
||||
{ virtual: true }
|
||||
{ virtual: true },
|
||||
);
|
||||
|
||||
jest.mock("@/helpers/heritage-integration/navigation-helper", () => ({
|
||||
|
|
@ -305,7 +305,7 @@ describe("capabilityQuestions.vue", () => {
|
|||
result2: undefined,
|
||||
},
|
||||
],
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
wrapper.unmount();
|
||||
|
|
@ -354,7 +354,7 @@ describe("capabilityQuestions.vue", () => {
|
|||
"getPartFromCapabilityQuestionAnswer",
|
||||
"Windshield",
|
||||
"capability-questions",
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
wrapper.unmount();
|
||||
|
|
|
|||
|
|
@ -84,13 +84,13 @@ export default {
|
|||
methods: {
|
||||
arePagePrerequisitesValid() {
|
||||
const capabilityQuestionsPageData = store.getters.pageData(
|
||||
fmgPageValues.CAPABILITY_QUESTIONS
|
||||
fmgPageValues.CAPABILITY_QUESTIONS,
|
||||
);
|
||||
return (
|
||||
// has capabilityQuestions array and has glassName not null
|
||||
capabilityQuestionsPageData?.partsOrQuestions?.some((part) => part?.glassName) &&
|
||||
capabilityQuestionsPageData?.partsOrQuestions?.some(
|
||||
(part) => part?.capabilityQuestions?.length > 0
|
||||
(part) => part?.capabilityQuestions?.length > 0,
|
||||
)
|
||||
);
|
||||
},
|
||||
|
|
@ -110,7 +110,7 @@ export default {
|
|||
const updatedGlass = this.setupInitialData(
|
||||
glass,
|
||||
index,
|
||||
alreadyAnsweredQuestions
|
||||
alreadyAnsweredQuestions,
|
||||
);
|
||||
|
||||
// Set up watch for each set of glass questions
|
||||
|
|
@ -121,7 +121,7 @@ export default {
|
|||
this.handleCompletedQuestionChainAnswers(newValue, glass.answerKey);
|
||||
}
|
||||
},
|
||||
{ deep: true }
|
||||
{ deep: true },
|
||||
);
|
||||
|
||||
return updatedGlass;
|
||||
|
|
@ -130,7 +130,7 @@ export default {
|
|||
// if no preanswered questions then make sure index starts with the correct value
|
||||
this.currentGlassIndex = this.calculateQuestionIndex(
|
||||
this.currentGlassIndex,
|
||||
this.questionsData
|
||||
this.questionsData,
|
||||
);
|
||||
},
|
||||
async forwardButtonAction() {
|
||||
|
|
@ -139,7 +139,7 @@ export default {
|
|||
let selectedAnswerResult2;
|
||||
glass.questions.forEach((q) => {
|
||||
const idx = q.answers.findIndex(
|
||||
(a) => a.answerResult === glass.answerData.answerResult
|
||||
(a) => a.answerResult === glass.answerData.answerResult,
|
||||
);
|
||||
if (idx !== -1) {
|
||||
selectedAnswerResult2 = q.answers[idx].answerResult2;
|
||||
|
|
@ -167,7 +167,7 @@ export default {
|
|||
await this.dispatchStoreAction(
|
||||
this.storeActions.SAVE_CAPABILITY_QUESTION_ANSWERS,
|
||||
questionAnswersArray,
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
// get parts from the capabilityQuestionAnswers
|
||||
|
|
@ -178,12 +178,12 @@ export default {
|
|||
this.storeActions.GET_PART_FROM_CAPABILITY_QUESTION_ANSWER,
|
||||
answer.glassLocation,
|
||||
"capability-questions",
|
||||
false
|
||||
false,
|
||||
)
|
||||
).data;
|
||||
|
||||
partsOrQuestions.find(
|
||||
(partOrQuestion) => partOrQuestion.glassLocation === answer.glassLocation
|
||||
(partOrQuestion) => partOrQuestion.glassLocation === answer.glassLocation,
|
||||
).parts = partFromCapabilityQuestionAnswer;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ export default {
|
|||
location = this.serviceLocationFullAddress?.replace("<br/>", "");
|
||||
subject = this.AddToCalendar_Mobile_Subject?.replace(
|
||||
"{custom:SERVICETYPE}",
|
||||
this.ServiceType
|
||||
this.ServiceType,
|
||||
);
|
||||
body = this.AddToCalendar_Mobile_Body;
|
||||
} else {
|
||||
|
|
@ -158,28 +158,28 @@ export default {
|
|||
endDateTime = addMinutes(startDateTime, 120);
|
||||
subject = this.AddToCalendar_AllDayDropOff_Subject?.replace(
|
||||
"{custom:STARTDATETIME}",
|
||||
shortTimeString(startDateTime)
|
||||
shortTimeString(startDateTime),
|
||||
).replace("{custom:ENDDATETIME}", shortTimeString(endDateTime));
|
||||
body = this.AddToCalendar_AllDayDropOff_Body?.replace(
|
||||
"{custom:ENDDATETIME}",
|
||||
shortTimeString(endDateTime)
|
||||
shortTimeString(endDateTime),
|
||||
);
|
||||
}
|
||||
} //normal time slot
|
||||
else {
|
||||
subject = this.AddToCalendar_DropOff_Subject?.replace(
|
||||
"{custom:SERVICETYPE}",
|
||||
this.ServiceType
|
||||
this.ServiceType,
|
||||
);
|
||||
body = this.AddToCalendar_DropOff_Body?.replace(
|
||||
"{custom:ADDRESS}",
|
||||
location
|
||||
location,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
subject = this.AddToCalendar_InShop_Subject?.replace(
|
||||
"{custom:SERVICETYPE}",
|
||||
this.ServiceType
|
||||
this.ServiceType,
|
||||
);
|
||||
body = this.AddToCalendar_InShop_Body?.replace("{custom:ADDRESS}", location);
|
||||
}
|
||||
|
|
@ -229,33 +229,33 @@ export default {
|
|||
const outlookComTimeSpanFormat = "yyyy-MM-ddTHH:mm:ss";
|
||||
if (type == calendarOptions.OUTLOOKCOM) {
|
||||
URL = `${applicationConfig.OUTLOOK_CALENDAR}&startdt=${encodeURIComponent(
|
||||
getDateFormat(this.Appointment.StartDate, outlookComTimeSpanFormat)
|
||||
getDateFormat(this.Appointment.StartDate, outlookComTimeSpanFormat),
|
||||
)}&enddt=${encodeURIComponent(
|
||||
getDateFormat(this.Appointment.EndDate, outlookComTimeSpanFormat)
|
||||
getDateFormat(this.Appointment.EndDate, outlookComTimeSpanFormat),
|
||||
)}&subject=${encodeURIComponent(
|
||||
this.Appointment.Subject
|
||||
this.Appointment.Subject,
|
||||
)}&body=${encodeURIComponent(this.Appointment.Body)}&location=${encodeURIComponent(
|
||||
this.Appointment.Location
|
||||
this.Appointment.Location,
|
||||
)}`;
|
||||
}
|
||||
if (type == calendarOptions.GOOGLE) {
|
||||
URL = `${applicationConfig.GOOGLE_CALENDAR}&text=${encodeURIComponent(
|
||||
this.Appointment.Subject
|
||||
this.Appointment.Subject,
|
||||
)}&dates=${encodeURIComponent(
|
||||
getDateFormat(this.Appointment.StartDate, dateFormat)
|
||||
getDateFormat(this.Appointment.StartDate, dateFormat),
|
||||
)}/${encodeURIComponent(
|
||||
getDateFormat(this.Appointment.EndDate, dateFormat)
|
||||
getDateFormat(this.Appointment.EndDate, dateFormat),
|
||||
)}&details=${encodeURIComponent(
|
||||
this.Appointment.Body
|
||||
this.Appointment.Body,
|
||||
)}&location=${encodeURIComponent(this.Appointment.Location)}&sf=true&output=xml`;
|
||||
}
|
||||
if (type == calendarOptions.YAHOO) {
|
||||
URL = `${applicationConfig.YAHOO_CALENDAR}&TITLE=${encodeURIComponent(
|
||||
this.Appointment.Subject
|
||||
this.Appointment.Subject,
|
||||
)}&DESC=${encodeURIComponent(this.Appointment.Body)}&ST=${encodeURIComponent(
|
||||
getDateFormat(this.Appointment.StartDate, dateFormat)
|
||||
getDateFormat(this.Appointment.StartDate, dateFormat),
|
||||
)}&DUR=${this.Appointment.Duration}&in_loc=${encodeURIComponent(
|
||||
this.Appointment.Location
|
||||
this.Appointment.Location,
|
||||
)}`;
|
||||
}
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ export default {
|
|||
const { errorMessage, handleChange, meta, validate, errors } = useField(
|
||||
componentId,
|
||||
props.validationRules,
|
||||
fieldOptions
|
||||
fieldOptions,
|
||||
);
|
||||
|
||||
return {
|
||||
|
|
@ -146,7 +146,7 @@ export default {
|
|||
|
||||
getSelectedCalendarObject(calendarOptionId) {
|
||||
const calendarOption = this.calendarOptionsData?.find(
|
||||
(calendarOption) => calendarOption.name == calendarOptionId
|
||||
(calendarOption) => calendarOption.name == calendarOptionId,
|
||||
);
|
||||
|
||||
if (calendarOption) {
|
||||
|
|
|
|||
|
|
@ -120,13 +120,13 @@ export default {
|
|||
serviceZipCode: store.getters.submittedOrder.serviceLocation.zipCode,
|
||||
carId: store.getters.submittedOrder.vehicle.carId,
|
||||
},
|
||||
"confirmation"
|
||||
"confirmation",
|
||||
);
|
||||
|
||||
const rainDefensePromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
||||
storeActions.GET_RAIN_DEFENSE,
|
||||
null,
|
||||
"confirmation"
|
||||
"confirmation",
|
||||
);
|
||||
|
||||
// Settle promises and get results
|
||||
|
|
@ -240,17 +240,17 @@ export default {
|
|||
if (this.AppointmentType == AppointmentTypeStrings.MOBILE) {
|
||||
return this.MobileWordingText?.replaceAll(
|
||||
"{custom:ADDRESS}",
|
||||
this.ServiceLocationFullAddress
|
||||
this.ServiceLocationFullAddress,
|
||||
);
|
||||
} else if (this.AppointmentType == AppointmentTypeStrings.DROP_OFF) {
|
||||
return this.DropOffWordingText?.replaceAll(
|
||||
"{custom:ADDRESS}",
|
||||
this.ProviderFullAddress
|
||||
this.ProviderFullAddress,
|
||||
);
|
||||
} else {
|
||||
return this.InShopWordingText?.replaceAll(
|
||||
"{custom:ADDRESS}",
|
||||
this.ProviderFullAddress
|
||||
this.ProviderFullAddress,
|
||||
);
|
||||
}
|
||||
},
|
||||
|
|
@ -277,7 +277,7 @@ export default {
|
|||
ScheduleTimeFormatted() {
|
||||
if (this.AppointmentType == AppointmentTypeStrings.MOBILE) {
|
||||
return `Between ${get12HourTimeMobileFormat(
|
||||
this.ScheduleStartTime
|
||||
this.ScheduleStartTime,
|
||||
)} - ${get12HourTimeMobileFormat(this.ScheduleEndTime)}`;
|
||||
} else if (this.AppointmentType == AppointmentTypeStrings.DROP_OFF) {
|
||||
return `Drop off before 9:30 AM`;
|
||||
|
|
@ -329,19 +329,19 @@ export default {
|
|||
const durationLengthString = "Duration: ";
|
||||
if (
|
||||
store.getters.submittedOrder?.schedule?.routeCode.includes(
|
||||
RouteCodeFlags.ALL_DAY_DROP_OFF
|
||||
RouteCodeFlags.ALL_DAY_DROP_OFF,
|
||||
)
|
||||
) {
|
||||
return durationLengthString.concat("All Day");
|
||||
} else if (
|
||||
store.getters.submittedOrder?.schedule?.routeCode.includes(
|
||||
RouteCodeFlags.OVERNIGHT_DROP_OFF
|
||||
RouteCodeFlags.OVERNIGHT_DROP_OFF,
|
||||
)
|
||||
) {
|
||||
return durationLengthString.concat("Overnight");
|
||||
} else {
|
||||
return durationLengthString.concat(
|
||||
getDisplayTextForDurationLength(durationMinimum, durationMaximum)
|
||||
getDisplayTextForDurationLength(durationMinimum, durationMaximum),
|
||||
);
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ function setupMocks() {
|
|||
navigateWithSaving: jest.fn(),
|
||||
navigateWithoutSaving: jest.fn(),
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
return { wrapper };
|
||||
|
|
|
|||
|
|
@ -97,8 +97,8 @@ defineRule(
|
|||
"email-address-format",
|
||||
regex(
|
||||
/^([a-zA-Z0-9_\-.+]+)@([a-zA-Z0-9-]+)\.([a-zA-Z]{2,})$/,
|
||||
errorMessages.EMAIL_ADDRESS_FORMAT
|
||||
)
|
||||
errorMessages.EMAIL_ADDRESS_FORMAT,
|
||||
),
|
||||
);
|
||||
|
||||
export default {
|
||||
|
|
@ -172,13 +172,13 @@ export default {
|
|||
phoneNumber: this.phoneNumber,
|
||||
isSmsOptIn: this.isSmsOptIn,
|
||||
},
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
this.dispatchStoreAction(
|
||||
this.storeActions.SAVE_SERVICE_LOCATION_TECH_NOTES,
|
||||
this.techNotes,
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
this.$router.navigateWithSaving(this.navigationScenarios.CLICKED_FORWARD, this.$route);
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ describe("estimate.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "estimate" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
wrapper.vm.backButtonAction();
|
||||
|
|
@ -232,7 +232,7 @@ describe("estimate.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "estimate" } },
|
||||
undefined,
|
||||
nextFunction
|
||||
nextFunction,
|
||||
);
|
||||
await wrapper.vm.$nextTick();
|
||||
|
||||
|
|
|
|||
|
|
@ -73,8 +73,8 @@ defineRule(
|
|||
"email-address-format",
|
||||
regex(
|
||||
/^([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));
|
||||
|
||||
|
|
@ -110,7 +110,7 @@ export default {
|
|||
storeActions.IS_VIN_BY_ADDRESS_PERMISSIBLE,
|
||||
{ zip: zip },
|
||||
"estimate",
|
||||
false
|
||||
false,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -138,7 +138,7 @@ export default {
|
|||
|
||||
if (!zip || resultMap.vinByAddress === false) {
|
||||
var indexToRemove = resultMap.cmsContent.VinLookupMethod.Answers.findIndex(
|
||||
(answer) => answer.Name === "HomeAddress"
|
||||
(answer) => answer.Name === "HomeAddress",
|
||||
);
|
||||
if (indexToRemove) {
|
||||
resultMap.cmsContent.VinLookupMethod.Answers.splice(indexToRemove, 1);
|
||||
|
|
@ -149,7 +149,7 @@ export default {
|
|||
if (store.getters.isExternalParameter) {
|
||||
if (store.getters.externalParameterEstimate.vinSelection) {
|
||||
vm.selectedVinLookupMethod = vinPagesMixin.methods.getVinlookupMethod(
|
||||
store.getters.externalParameterEstimate.vinSelection
|
||||
store.getters.externalParameterEstimate.vinSelection,
|
||||
);
|
||||
await nextTick();
|
||||
const isValid = await baseMixin.methods.isFormValid(vm.$refs.theForm);
|
||||
|
|
@ -179,25 +179,25 @@ export default {
|
|||
await this.dispatchStoreAction(storeActions.CLEAR_VIN);
|
||||
return this.$router.navigateWithSaving(
|
||||
this.navigationScenarios.SELECTED_MANUAL_VIN,
|
||||
this.$route
|
||||
this.$route,
|
||||
);
|
||||
}
|
||||
if (this.selectedVinLookupMethod === vinLookupMethodSelections.LICENSEPLATE) {
|
||||
return this.$router.navigateWithSaving(
|
||||
this.navigationScenarios.SELECTED_LICENSE_PLATE,
|
||||
this.$route
|
||||
this.$route,
|
||||
);
|
||||
}
|
||||
if (this.selectedVinLookupMethod === vinLookupMethodSelections.HOMEADDRESS) {
|
||||
return this.$router.navigateWithSaving(
|
||||
this.navigationScenarios.SELECTED_HOME_ADDRESS,
|
||||
this.$route
|
||||
this.$route,
|
||||
);
|
||||
}
|
||||
if (this.selectedVinLookupMethod === vinLookupMethodSelections.DECLINE) {
|
||||
return this.$router.navigateWithSaving(
|
||||
this.navigationScenarios.SELECTED_NO_VIN,
|
||||
this.$route
|
||||
this.$route,
|
||||
);
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ export default {
|
|||
const insuranceCompanyListPromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
||||
storeActions.GET_INSURANCE_COMPANY_LIST,
|
||||
{},
|
||||
"insurance-company"
|
||||
"insurance-company",
|
||||
);
|
||||
|
||||
// Settle promises and get results
|
||||
|
|
@ -119,7 +119,7 @@ export default {
|
|||
await this.dispatchStoreAction(
|
||||
this.storeActions.SAVE_PARENT_ACCOUNT_NUMBER,
|
||||
this.parentAccountNumber.toString(),
|
||||
false
|
||||
false,
|
||||
);
|
||||
navigateToHeritageFunnel({
|
||||
shouldSaveSession: true,
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ describe("license-plate-lookup.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "license-plate-lookup" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
wrapper.vm.backButtonAction();
|
||||
|
|
@ -128,7 +128,7 @@ describe("license-plate-lookup.vue", () => {
|
|||
carId: mockCarId,
|
||||
},
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
//Act
|
||||
|
|
@ -136,7 +136,7 @@ describe("license-plate-lookup.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "license-plate-lookup" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
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.
|
||||
},
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
//Act
|
||||
|
|
@ -173,7 +173,7 @@ describe("license-plate-lookup.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "license-plate-lookup" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
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.
|
||||
},
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
//Act
|
||||
|
|
@ -217,7 +217,7 @@ describe("license-plate-lookup.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "license-plate-lookup" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
await wrapper.vm.forwardButtonAction();
|
||||
|
|
@ -387,7 +387,7 @@ describe("license-plate-lookup.vue", () => {
|
|||
carId: "C00000",
|
||||
},
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Act
|
||||
|
|
@ -395,7 +395,7 @@ describe("license-plate-lookup.vue", () => {
|
|||
|
||||
// Assert
|
||||
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");
|
||||
|
|
@ -425,7 +425,7 @@ describe("license-plate-lookup.vue", () => {
|
|||
carId: "C00000",
|
||||
},
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
//TODO FIX - test succeeds even if comment out the Act section
|
||||
|
|
@ -434,7 +434,7 @@ describe("license-plate-lookup.vue", () => {
|
|||
|
||||
// Assert
|
||||
const serviceZipField = wrapper.findComponent(
|
||||
"[cmsWidgetName='ServiceZipQuestionWidget']"
|
||||
"[cmsWidgetName='ServiceZipQuestionWidget']",
|
||||
);
|
||||
expect(serviceZipField.exists()).toBe(true);
|
||||
expect(serviceZipField.isVisible()).toBe(true);
|
||||
|
|
@ -457,7 +457,7 @@ describe("license-plate-lookup.vue", () => {
|
|||
carId: "C00000",
|
||||
},
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
await wrapper.vm.forwardButtonAction();
|
||||
|
|
@ -470,7 +470,7 @@ describe("license-plate-lookup.vue", () => {
|
|||
|
||||
// Assert
|
||||
const serviceZipField = wrapper.findComponent(
|
||||
"[cmsWidgetName='ServiceZipQuestionWidget']"
|
||||
"[cmsWidgetName='ServiceZipQuestionWidget']",
|
||||
);
|
||||
expect(serviceZipField.exists()).toBe(true);
|
||||
expect(serviceZipField.isVisible()).toBe(true);
|
||||
|
|
@ -507,7 +507,7 @@ describe("license-plate-lookup.vue", () => {
|
|||
|
||||
// Assert
|
||||
const serviceZipField = wrapper.findComponent(
|
||||
"[cmsWidgetName='ServiceZipQuestionWidget']"
|
||||
"[cmsWidgetName='ServiceZipQuestionWidget']",
|
||||
);
|
||||
expect(serviceZipField.exists()).toBe(true);
|
||||
expect(serviceZipField.isVisible()).toBe(true);
|
||||
|
|
@ -582,7 +582,7 @@ describe("license-plate-lookup.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "license-plate-lookup" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
let arePagePrerequisitesValid = wrapper.vm.arePagePrerequisitesValid();
|
||||
|
|
@ -601,7 +601,7 @@ describe("license-plate-lookup.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "license-plate-lookup" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
let arePagePrerequisitesValid = wrapper.vm.arePagePrerequisitesValid();
|
||||
|
|
|
|||
|
|
@ -125,8 +125,8 @@ defineRule(
|
|||
"email-address-format",
|
||||
regex(
|
||||
/^([a-zA-Z0-9_\-.+]+)@([a-zA-Z0-9-]+)\.([a-zA-Z]{2,})$/,
|
||||
errorMessages.EMAIL_ADDRESS_FORMAT
|
||||
)
|
||||
errorMessages.EMAIL_ADDRESS_FORMAT,
|
||||
),
|
||||
);
|
||||
|
||||
export default {
|
||||
|
|
@ -188,7 +188,7 @@ export default {
|
|||
this.$route.query[this.queryStrings.FMG_PAGE],
|
||||
this.GaActions.SUBMITTED,
|
||||
this.GaLabels.LICENSE_PLATE_LOOKUP,
|
||||
true
|
||||
true,
|
||||
);
|
||||
});
|
||||
},
|
||||
|
|
@ -210,7 +210,7 @@ export default {
|
|||
const registrationZipValidationResponse = this.dispatchStoreActionWithLogging(
|
||||
storeActions.VALIDATE_ZIP,
|
||||
{ zip: this.registrationZipCode },
|
||||
"license-plate-lookup"
|
||||
"license-plate-lookup",
|
||||
);
|
||||
|
||||
// Settle promises and get results
|
||||
|
|
@ -228,7 +228,7 @@ export default {
|
|||
{
|
||||
zip: this.serviceZipCode,
|
||||
},
|
||||
"license-plate-lookup"
|
||||
"license-plate-lookup",
|
||||
)
|
||||
: registrationZipValidationResponse,
|
||||
},
|
||||
|
|
@ -239,7 +239,7 @@ export default {
|
|||
// Lookup vin
|
||||
const vinLookup = await this.lookupVin(
|
||||
this.licensePlate,
|
||||
resultMap.registrationZipValidationResponse.state
|
||||
resultMap.registrationZipValidationResponse.state,
|
||||
).catch(() => {
|
||||
// No VIN found.
|
||||
this.displayVinNotFoundAlert = true;
|
||||
|
|
@ -274,12 +274,12 @@ export default {
|
|||
|
||||
this.isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId(
|
||||
vinLookup.data.vehicle.carId,
|
||||
"license-plate-lookup"
|
||||
"license-plate-lookup",
|
||||
);
|
||||
|
||||
// Update button "Continue with..."
|
||||
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();
|
||||
}
|
||||
|
|
@ -308,7 +308,7 @@ export default {
|
|||
licensePlate: this.licensePlate,
|
||||
},
|
||||
},
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.email, false);
|
||||
|
|
@ -320,7 +320,7 @@ export default {
|
|||
zipCode: this.serviceZipCode,
|
||||
zipCodeCtu: resultMap.serviceZipValidationResponse.zipCodeCtu,
|
||||
},
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
return await this.navigateForward();
|
||||
|
|
@ -330,7 +330,7 @@ export default {
|
|||
storeActions.LOOKUP_VIN_BY_PLATE,
|
||||
{ licensePlate: plate, licenseState: state },
|
||||
"license-plate-lookup",
|
||||
false
|
||||
false,
|
||||
);
|
||||
},
|
||||
async navigateForward() {
|
||||
|
|
@ -339,7 +339,7 @@ export default {
|
|||
this.navigationScenarios.CLICKED_FORWARD,
|
||||
this.$route,
|
||||
{},
|
||||
{ [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: true }
|
||||
{ [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: true },
|
||||
);
|
||||
} else {
|
||||
await this.navigateForwardWithSingleCarMatch();
|
||||
|
|
@ -360,7 +360,7 @@ export default {
|
|||
const zipCode = this.serviceZipCode ? this.serviceZipCode : this.registrationZipCode;
|
||||
return this.getCmsContent("AlertNonServiceableZipWidget", "HeadlineText").replaceAll(
|
||||
"{custom:serviceZip}",
|
||||
zipCode
|
||||
zipCode,
|
||||
);
|
||||
},
|
||||
AlertNonServiceableZipBody() {
|
||||
|
|
@ -369,7 +369,7 @@ export default {
|
|||
AlertMatchedDifferentVehicleHeader() {
|
||||
return this.getCmsContent(
|
||||
"AlertMatchedDifferentVehicleWidget",
|
||||
"HeadlineText"
|
||||
"HeadlineText",
|
||||
).replaceAll("{custom:damage}", getDamageString());
|
||||
},
|
||||
AlertMatchedDifferentVehicleBody() {
|
||||
|
|
@ -383,19 +383,19 @@ export default {
|
|||
watch: {
|
||||
licensePlate() {
|
||||
this.$refs.navbar.updateButtonText(
|
||||
this.getCmsContent("FunnelFooterWidget", "ForwardButtonText")
|
||||
this.getCmsContent("FunnelFooterWidget", "ForwardButtonText"),
|
||||
);
|
||||
},
|
||||
registrationZipCode() {
|
||||
this.$refs.navbar.updateButtonText(
|
||||
this.getCmsContent("FunnelFooterWidget", "ForwardButtonText")
|
||||
this.getCmsContent("FunnelFooterWidget", "ForwardButtonText"),
|
||||
);
|
||||
},
|
||||
serviceZipCode() {
|
||||
// If they modify the service zip code, then hide the error message.
|
||||
this.displayNonServiceableZipAlert = false;
|
||||
this.$refs.navbar.updateButtonText(
|
||||
this.getCmsContent("FunnelFooterWidget", "ForwardButtonText")
|
||||
this.getCmsContent("FunnelFooterWidget", "ForwardButtonText"),
|
||||
);
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ jest.mock(
|
|||
() => {
|
||||
return {};
|
||||
},
|
||||
{ virtual: true }
|
||||
{ virtual: true },
|
||||
);
|
||||
|
||||
jest.mock("@/helpers/heritage-integration/navigation-helper", () => ({
|
||||
|
|
@ -290,7 +290,7 @@ describe("moldingQuestions.vue", () => {
|
|||
partNum: "FW04848",
|
||||
},
|
||||
],
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
wrapper.unmount();
|
||||
|
|
|
|||
|
|
@ -83,13 +83,13 @@ export default {
|
|||
methods: {
|
||||
arePagePrerequisitesValid() {
|
||||
const moldingQuestionsFromPageData = store.getters.pageData(
|
||||
fmgPageValues.MOLDING_QUESTIONS
|
||||
fmgPageValues.MOLDING_QUESTIONS,
|
||||
);
|
||||
return (
|
||||
// has childPartQuestions array and has glassName not null
|
||||
moldingQuestionsFromPageData?.partsOrQuestions?.some((part) => part?.glassName) &&
|
||||
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(
|
||||
glass,
|
||||
index,
|
||||
alreadyAnsweredQuestions
|
||||
alreadyAnsweredQuestions,
|
||||
);
|
||||
|
||||
// Set up watch for each set of glass questions
|
||||
|
|
@ -120,7 +120,7 @@ export default {
|
|||
this.handleCompletedQuestionChainAnswers(newValue, glass.answerKey);
|
||||
}
|
||||
},
|
||||
{ deep: true }
|
||||
{ deep: true },
|
||||
);
|
||||
|
||||
return updatedGlass;
|
||||
|
|
@ -129,7 +129,7 @@ export default {
|
|||
// if no preanswered questions then make sure index starts with the correct value
|
||||
this.currentGlassIndex = this.calculateQuestionIndex(
|
||||
this.currentGlassIndex,
|
||||
this.questionsData
|
||||
this.questionsData,
|
||||
);
|
||||
},
|
||||
async forwardButtonAction() {
|
||||
|
|
@ -152,7 +152,7 @@ export default {
|
|||
await this.dispatchStoreAction(
|
||||
this.storeActions.SAVE_MOLDING_QUESTION_ANSWERS,
|
||||
questionAnswersArray,
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
// get parts from the questionAnswers
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ jest.mock(
|
|||
() => {
|
||||
return {};
|
||||
},
|
||||
{ virtual: true }
|
||||
{ virtual: true },
|
||||
);
|
||||
|
||||
jest.mock("@/helpers/heritage-integration/navigation-helper", () => ({
|
||||
|
|
@ -316,7 +316,7 @@ describe("partQuestions.vue...", () => {
|
|||
result: "FW04848",
|
||||
},
|
||||
],
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
wrapper.unmount();
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ export default {
|
|||
// has .partQuestions array and has glassName not null
|
||||
partQuestionsFromPageData?.partsOrQuestions?.some((part) => part?.glassName) &&
|
||||
partQuestionsFromPageData?.partsOrQuestions?.some(
|
||||
(part) => part?.partQuestions?.length > 0
|
||||
(part) => part?.partQuestions?.length > 0,
|
||||
)
|
||||
);
|
||||
},
|
||||
|
|
@ -107,7 +107,7 @@ export default {
|
|||
const updatedGlass = this.setupInitialData(
|
||||
glass,
|
||||
index,
|
||||
alreadyAnsweredQuestions
|
||||
alreadyAnsweredQuestions,
|
||||
);
|
||||
|
||||
// Set up watch for each set of glass questions
|
||||
|
|
@ -118,7 +118,7 @@ export default {
|
|||
this.handleCompletedQuestionChainAnswers(newValue, glass.answerKey);
|
||||
}
|
||||
},
|
||||
{ deep: true }
|
||||
{ deep: true },
|
||||
);
|
||||
|
||||
return updatedGlass;
|
||||
|
|
@ -127,7 +127,7 @@ export default {
|
|||
// if no preanswered questions then make sure index starts with the correct value
|
||||
this.currentGlassIndex = this.calculateQuestionIndex(
|
||||
this.currentGlassIndex,
|
||||
this.questionsData
|
||||
this.questionsData,
|
||||
);
|
||||
},
|
||||
async forwardButtonAction() {
|
||||
|
|
@ -153,14 +153,14 @@ export default {
|
|||
await this.dispatchStoreAction(
|
||||
this.storeActions.SAVE_PART_QUESTION_ANSWERS,
|
||||
questionAnswersArray,
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
// call API parts method
|
||||
const partsLookup = await this.dispatchStoreActionWithLogging(
|
||||
this.storeActions.GET_PARTS,
|
||||
null,
|
||||
"part-questions"
|
||||
"part-questions",
|
||||
);
|
||||
|
||||
const glassPartsForStore = partsLookup.data.glassPieceParts;
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ export default {
|
|||
if (this.isInsurance) {
|
||||
tempItems.splice(
|
||||
tempItems.findIndex((a) => a.value === "Insurance"),
|
||||
1
|
||||
1,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -164,12 +164,12 @@ export default {
|
|||
|
||||
const frontWipersOnOrder =
|
||||
lineItemsFromStore.vaps.filter(
|
||||
(wiper) => wiper.partType == partTypeStrings.FRONT_WIPER
|
||||
(wiper) => wiper.partType == partTypeStrings.FRONT_WIPER,
|
||||
) ?? [];
|
||||
|
||||
const rearWipersOnOrder =
|
||||
lineItemsFromStore.vaps.filter(
|
||||
(wiper) => wiper.partType == partTypeStrings.REAR_WIPER
|
||||
(wiper) => wiper.partType == partTypeStrings.REAR_WIPER,
|
||||
) ?? [];
|
||||
|
||||
const orderHasFrontWipers = frontWipersOnOrder.length > 0;
|
||||
|
|
@ -183,14 +183,14 @@ export default {
|
|||
serviceZipCode: store.getters.order.serviceLocation.zipCode,
|
||||
carId: store.getters.vehicle.carId,
|
||||
},
|
||||
"payment-method"
|
||||
"payment-method",
|
||||
)
|
||||
: Promise.resolve([]);
|
||||
|
||||
const rainDefensePromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
||||
storeActions.GET_RAIN_DEFENSE,
|
||||
null,
|
||||
"payment-method"
|
||||
"payment-method",
|
||||
);
|
||||
|
||||
const reviewDropdownPromise = reviewDropdown.methods.loadInitialData();
|
||||
|
|
@ -224,12 +224,12 @@ export default {
|
|||
// instead of what comes from the backend. This is to prevent issues with part interchange.
|
||||
const availableFrontWipers = orderHasFrontWipers
|
||||
? frontWipersOnOrder
|
||||
: resultMap.wipers.filter((wiper) => wiper.partType == partTypeStrings.FRONT_WIPER) ??
|
||||
[];
|
||||
: (resultMap.wipers.filter((wiper) => wiper.partType == partTypeStrings.FRONT_WIPER) ??
|
||||
[]);
|
||||
const availableRearWipers = orderHasRearWipers
|
||||
? rearWipersOnOrder
|
||||
: resultMap.wipers.filter((wiper) => wiper.partType == partTypeStrings.REAR_WIPER) ??
|
||||
[];
|
||||
: (resultMap.wipers.filter((wiper) => wiper.partType == partTypeStrings.REAR_WIPER) ??
|
||||
[]);
|
||||
|
||||
const lineItemsToTax = [
|
||||
resultMap.rainDefense,
|
||||
|
|
@ -252,7 +252,7 @@ export default {
|
|||
availableLineItems: lineItemsToTax,
|
||||
},
|
||||
"payment-method",
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
// Promo logic
|
||||
|
|
@ -265,13 +265,13 @@ export default {
|
|||
await revalidatePromosAndValidateQueryStringPromo(
|
||||
promoCodeFromQueryString,
|
||||
pricedLineItemsToTax,
|
||||
"payment-method"
|
||||
"payment-method",
|
||||
);
|
||||
|
||||
// Add newly validated promos to the array to get taxed
|
||||
const newValidatedPromos = validatePromoResponse?.orderPromos ?? [];
|
||||
newValidatedPromos.push(
|
||||
...(revalidatePromoResponse ? revalidatePromoResponse.promoLineItems : [])
|
||||
...(revalidatePromoResponse ? revalidatePromoResponse.promoLineItems : []),
|
||||
);
|
||||
pricedLineItemsToTax.push(...newValidatedPromos);
|
||||
// End of promo logic
|
||||
|
|
@ -288,7 +288,7 @@ export default {
|
|||
pricedLineItems: pricedLineItemsToTax,
|
||||
},
|
||||
"payment-method",
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
// Match all line items to the line items as they are in the store
|
||||
|
|
@ -300,7 +300,7 @@ export default {
|
|||
const vapsToAddToCart = getVapsThatNeedToBeAddedToSatisfyPromos(
|
||||
newValidatedPromos,
|
||||
taxedVaps,
|
||||
lineItems
|
||||
lineItems,
|
||||
);
|
||||
lineItems.vaps = lineItems.vaps ?? [];
|
||||
lineItems.vaps.push(...vapsToAddToCart);
|
||||
|
|
@ -312,7 +312,7 @@ export default {
|
|||
vm.lineItems = lineItems;
|
||||
vm.inactivePromos = removeCurrentlyActivePromoCodesFromInactivePromos(
|
||||
vm.lineItems.promos,
|
||||
vm.inactivePromos
|
||||
vm.inactivePromos,
|
||||
);
|
||||
vm.updateFooterButtonText(vm.customCtaCopy);
|
||||
|
||||
|
|
@ -322,7 +322,7 @@ export default {
|
|||
const revalidateAlerts = buildToastMessagesFromRevalidateOrValidatePromoResponse(
|
||||
revalidatePromoResponse,
|
||||
oldActivePromos,
|
||||
oldInactivePromos
|
||||
oldInactivePromos,
|
||||
);
|
||||
|
||||
revalidateAlerts.forEach((alert) => {
|
||||
|
|
@ -334,7 +334,7 @@ export default {
|
|||
buildToastMessagesFromRevalidateOrValidatePromoResponse(validatePromoResponse);
|
||||
vm.$refs.funnelHeader.pushGlobalAlert(
|
||||
validateAlerts[0],
|
||||
validateAlerts[0].shouldAutoFade
|
||||
validateAlerts[0].shouldAutoFade,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
|
@ -438,14 +438,14 @@ export default {
|
|||
lineItemsToUse: this.lineItems,
|
||||
},
|
||||
"payment-method",
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
// Handle error alerts here, success alerts are handled in the watcher
|
||||
if (revalidatePromoResponse.errors.length) {
|
||||
getNewlyInactivatedPromos(
|
||||
this.inactivePromos,
|
||||
revalidatePromoResponse.errors
|
||||
revalidatePromoResponse.errors,
|
||||
).forEach((promoCode) => {
|
||||
const errorAlert = createPromoErrorAlert(promoCode);
|
||||
this.$refs.funnelHeader.pushGlobalAlert(errorAlert, errorAlert.shouldAutoFade);
|
||||
|
|
@ -466,21 +466,21 @@ export default {
|
|||
pricedLineItems: revalidatePromoResponse.promoLineItems,
|
||||
},
|
||||
"payment-method",
|
||||
false
|
||||
false,
|
||||
);
|
||||
}
|
||||
|
||||
const vapsToAddToCart = getVapsThatNeedToBeAddedToSatisfyPromos(
|
||||
revalidatePromoResponse.promoLineItems,
|
||||
this.availableVaps,
|
||||
this.lineItems
|
||||
this.lineItems,
|
||||
);
|
||||
|
||||
this.lineItems.vaps.push(...vapsToAddToCart);
|
||||
|
||||
this.lineItems.promos = revalidatePromoResponse.promoLineItems;
|
||||
this.inactivePromos = revalidatePromoResponse.errors.map((x) =>
|
||||
getPromoCodeWithoutBundleIdentifier(x.promoCode)
|
||||
getPromoCodeWithoutBundleIdentifier(x.promoCode),
|
||||
);
|
||||
|
||||
this.$refs.loadingModal.hideModal();
|
||||
|
|
@ -497,18 +497,18 @@ export default {
|
|||
await this.dispatchStoreAction(
|
||||
storeActions.SAVE_PAYMENT_METHOD_CHOICE,
|
||||
this.paymentMethod,
|
||||
false
|
||||
false,
|
||||
);
|
||||
// save lineitems as they now have salestax added
|
||||
await this.dispatchStoreAction(
|
||||
storeActions.SAVE_GLASS_PARTS_SUPPRESSING_STATE_RESETTING,
|
||||
this.lineItems.glassParts,
|
||||
false
|
||||
false,
|
||||
);
|
||||
await this.dispatchStoreAction(
|
||||
storeActions.SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING,
|
||||
this.lineItems.supportingItems,
|
||||
false
|
||||
false,
|
||||
);
|
||||
await this.dispatchStoreAction(storeActions.SAVE_VAPS, this.lineItems.vaps, false);
|
||||
this.dispatchStoreAction(
|
||||
|
|
@ -517,7 +517,7 @@ export default {
|
|||
activePromos: this.lineItems.promos,
|
||||
inactivePromos: this.inactivePromos,
|
||||
},
|
||||
false
|
||||
false,
|
||||
);
|
||||
this.dispatchStoreAction(storeActions.SAVE_IS_RECAL_ACK_OPT_IN, this.isRecalAckOptIn);
|
||||
if (this.paymentMethod == paymentMethods.LATER) {
|
||||
|
|
@ -525,14 +525,14 @@ export default {
|
|||
await submitWorkOrder({ pageNameToLog: "payment-method", submitAfterSave: true });
|
||||
this.$router.navigateWithoutSaving(
|
||||
this.navigationScenarios.CLICKED_FORWARD,
|
||||
this.$route
|
||||
this.$route,
|
||||
);
|
||||
} else {
|
||||
if (this.paymentMethod == paymentMethods.INSURANCE) {
|
||||
this.dispatchStoreAction(this.storeActions.SAVE_PAYMENT_TYPE, true, false);
|
||||
this.$router.navigateWithoutSaving(
|
||||
this.navigationScenarios.CLICKED_INSURANCE,
|
||||
this.$route
|
||||
this.$route,
|
||||
);
|
||||
} else {
|
||||
this.setupPia();
|
||||
|
|
@ -561,7 +561,7 @@ export default {
|
|||
this.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE);
|
||||
this.$router.navigateWithoutSaving(
|
||||
this.navigationScenarios.CLICKED_PAY_NOW,
|
||||
this.$route
|
||||
this.$route,
|
||||
);
|
||||
},
|
||||
hasSubmittedOrder() {
|
||||
|
|
@ -574,7 +574,7 @@ export default {
|
|||
computed: {
|
||||
hasRecal() {
|
||||
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) {
|
||||
|
|
@ -711,11 +711,11 @@ export default {
|
|||
|
||||
if (oldValue.promos.length < newValue.promos.length) {
|
||||
const oldPromoCodes = oldValue.promos.map(
|
||||
(promoObject) => promoObject.promoCode
|
||||
(promoObject) => promoObject.promoCode,
|
||||
);
|
||||
|
||||
const newlyActivatedPromoCodes = newValue.promos.filter(
|
||||
(newPromo) => !oldPromoCodes.includes(newPromo.promoCode)
|
||||
(newPromo) => !oldPromoCodes.includes(newPromo.promoCode),
|
||||
);
|
||||
|
||||
const alert = createPromoSuccessAlert(newlyActivatedPromoCodes[0].promoCode);
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ export default {
|
|||
},
|
||||
getGlassPieces(damageLocation) {
|
||||
return this.damage?.glassToReplace?.filter(
|
||||
(item) => item.glassLocation === damageLocation
|
||||
(item) => item.glassLocation === damageLocation,
|
||||
);
|
||||
},
|
||||
generateBulletedListFromAnswers(answers) {
|
||||
|
|
@ -91,7 +91,7 @@ export default {
|
|||
const damageAnswers = this.getAnswersNullSafe(answerContent?.SubWidgetName);
|
||||
const driverSideItems = this.getGlassPieces(damageLocationsSelected.DRIVER);
|
||||
const damageAnswersOnOrder = damageAnswers?.filter((answer) =>
|
||||
driverSideItems?.some((glassPiece) => answer.Name === glassPiece.glassName)
|
||||
driverSideItems?.some((glassPiece) => answer.Name === glassPiece.glassName),
|
||||
);
|
||||
|
||||
if (this.hasDriverSideDamage) {
|
||||
|
|
@ -108,7 +108,7 @@ export default {
|
|||
const damageAnswers = this.getAnswersNullSafe(answerContent?.SubWidgetName);
|
||||
const passengerSideItems = this.getGlassPieces(damageLocationsSelected.PASSENGER);
|
||||
const damageAnswersOnOrder = damageAnswers?.filter((answer) =>
|
||||
passengerSideItems?.some((glassPiece) => answer.Name === glassPiece.glassName)
|
||||
passengerSideItems?.some((glassPiece) => answer.Name === glassPiece.glassName),
|
||||
);
|
||||
|
||||
if (this.hasPassengerSideDamage) {
|
||||
|
|
|
|||
|
|
@ -811,7 +811,7 @@ describe("Service Package Review Block", () => {
|
|||
expect(wrapper.vm.packageNameWidget).toEqual(testConstants.widgetNames.tierOneTitle);
|
||||
|
||||
let containsRainDefenseCopy = wrapper.vm.displayContent.includes(
|
||||
testConstants.vapsCopy.rainDefenseCopy
|
||||
testConstants.vapsCopy.rainDefenseCopy,
|
||||
);
|
||||
expect(containsRainDefenseCopy).toBe(true);
|
||||
});
|
||||
|
|
@ -863,10 +863,10 @@ describe("Service Package Review Block", () => {
|
|||
|
||||
// Assert
|
||||
const includesFrontWiperCopy = wrapper.vm.displayContent.includes(
|
||||
testConstants.vapsCopy.frontWiperCopy
|
||||
testConstants.vapsCopy.frontWiperCopy,
|
||||
);
|
||||
const includesRainDefenseCopy = wrapper.vm.displayContent.includes(
|
||||
testConstants.vapsCopy.rainDefenseCopy
|
||||
testConstants.vapsCopy.rainDefenseCopy,
|
||||
);
|
||||
expect(includesFrontWiperCopy).toBe(true);
|
||||
expect(includesRainDefenseCopy).toBe(false);
|
||||
|
|
@ -916,7 +916,7 @@ describe("Service Package Review Block", () => {
|
|||
|
||||
// Assert
|
||||
expect(wrapper.vm.packageNameWidget).toEqual(
|
||||
iteration.expected.packageNameWidget
|
||||
iteration.expected.packageNameWidget,
|
||||
);
|
||||
expect(wrapper.vm.displayContent).toEqual(iteration.expected.displayContent);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -38,12 +38,12 @@ export default {
|
|||
serviceZipCode: store.getters.order.serviceLocation.zipCode,
|
||||
carId: store.getters.vehicle.carId,
|
||||
},
|
||||
"review"
|
||||
"review",
|
||||
);
|
||||
const rainDefensePromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
||||
storeActions.GET_RAIN_DEFENSE,
|
||||
null,
|
||||
"review"
|
||||
"review",
|
||||
);
|
||||
|
||||
const promiseResultMap = [
|
||||
|
|
@ -75,7 +75,7 @@ export default {
|
|||
packageNameWidget() {
|
||||
const servicePackageNames = this.getCmsContent(
|
||||
this.servicePackageOptionsCmsName,
|
||||
"Answers"
|
||||
"Answers",
|
||||
);
|
||||
|
||||
if (!servicePackageNames) {
|
||||
|
|
@ -83,7 +83,7 @@ export default {
|
|||
}
|
||||
|
||||
const currentPackage = servicePackageNames.find(
|
||||
(entry) => entry.Name === this.packageLevel
|
||||
(entry) => entry.Name === this.packageLevel,
|
||||
);
|
||||
|
||||
return currentPackage.SubWidgetName;
|
||||
|
|
@ -105,7 +105,7 @@ export default {
|
|||
}
|
||||
|
||||
const vapsDescriptionsOnOrder = vapsDescriptions.filter((answer) =>
|
||||
containsLineItemWithPartType(answer.Name, this.vaps)
|
||||
containsLineItemWithPartType(answer.Name, this.vaps),
|
||||
);
|
||||
|
||||
return vapsDescriptionsOnOrder.map((answer) => answer.Text);
|
||||
|
|
@ -115,7 +115,7 @@ export default {
|
|||
this.glassToReplace,
|
||||
this.availableLineItems,
|
||||
this.isRepair,
|
||||
this.vaps
|
||||
this.vaps,
|
||||
);
|
||||
},
|
||||
glassToReplace() {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ export default {
|
|||
this.$route,
|
||||
{
|
||||
[queryStrings.DISPLAY_PIA_ALERT]: store.getters.order.payment.piaType,
|
||||
}
|
||||
},
|
||||
);
|
||||
} else {
|
||||
this.$router.navigateWithoutSaving(
|
||||
|
|
@ -42,7 +42,7 @@ export default {
|
|||
this.$route,
|
||||
{
|
||||
[queryStrings.DISPLAY_PIA_ALERT]: true,
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -63,12 +63,12 @@ export default {
|
|||
const lastFour = getQuerystringParameter(queryStrings.LAST_FOUR);
|
||||
if (lastFour) {
|
||||
console.log(
|
||||
new Date() + ": Payment method credit card selected by default"
|
||||
new Date() + ": Payment method credit card selected by default",
|
||||
);
|
||||
this.dispatchStoreAction(
|
||||
storeActions.SAVE_PAYMENT_METHOD_CHOICE,
|
||||
paymentMethods.CREDIT_CARD,
|
||||
false
|
||||
false,
|
||||
);
|
||||
await this.processCreditCardResponse();
|
||||
} else {
|
||||
|
|
@ -78,7 +78,7 @@ export default {
|
|||
this.navigationScenarios.PIA_ERROR,
|
||||
this.$route,
|
||||
{},
|
||||
{ [routerParams.DISPLAY_PIA_ALERT]: true }
|
||||
{ [routerParams.DISPLAY_PIA_ALERT]: true },
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -97,7 +97,7 @@ export default {
|
|||
baseMixin.methods.dispatchStoreAction(
|
||||
storeActions.SAVE_NEXTGEN_SETTLED_AMOUNT,
|
||||
this.getAmountDue(),
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
await this.saveAndSubmitWorkOrder();
|
||||
|
|
@ -111,13 +111,13 @@ export default {
|
|||
"error: unknown ref:" +
|
||||
referralSeqNum +
|
||||
" " +
|
||||
store.getters.order.referralSequenceNumber
|
||||
store.getters.order.referralSequenceNumber,
|
||||
);
|
||||
this.$router.navigateWithoutSaving(
|
||||
this.navigationScenarios.PIA_ERROR,
|
||||
this.$route,
|
||||
{},
|
||||
{ [routerParams.DISPLAY_PIA_ALERT]: true }
|
||||
{ [routerParams.DISPLAY_PIA_ALERT]: true },
|
||||
);
|
||||
} else {
|
||||
const expMonth = getQuerystringParameter(queryStrings.CARD_EXPIRATION_MONTH);
|
||||
|
|
@ -130,7 +130,7 @@ export default {
|
|||
const authCode = getQuerystringParameter(queryStrings.AUTH_CODE);
|
||||
const transactionId = getQuerystringParameter(queryStrings.TRANSACTION_ID);
|
||||
const transReferenceNumber = getQuerystringParameter(
|
||||
queryStrings.TRANS_REFERENCE_NUMBER
|
||||
queryStrings.TRANS_REFERENCE_NUMBER,
|
||||
);
|
||||
const lastFour = getQuerystringParameter(queryStrings.LAST_FOUR);
|
||||
|
||||
|
|
@ -153,7 +153,7 @@ export default {
|
|||
baseMixin.methods.dispatchStoreAction(
|
||||
storeActions.SAVE_NEXTGEN_SETTLED_AMOUNT,
|
||||
this.getAmountDue(),
|
||||
false
|
||||
false,
|
||||
);
|
||||
await this.saveAndSubmitWorkOrder();
|
||||
}
|
||||
|
|
@ -175,7 +175,7 @@ export default {
|
|||
this.navigationScenarios.PIA_ERROR,
|
||||
this.$route,
|
||||
{},
|
||||
{ [routerParams.DISPLAY_PIA_ALERT]: true }
|
||||
{ [routerParams.DISPLAY_PIA_ALERT]: true },
|
||||
);
|
||||
this.$refs.loadingModal.isModalVisible = false;
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ export default {
|
|||
this.$route.query[this.queryStrings.FMG_PAGE],
|
||||
this.GaActions.CLICKED,
|
||||
this.buttonText,
|
||||
true
|
||||
true,
|
||||
);
|
||||
this.$emit("click-event", clickValue);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -308,7 +308,7 @@ describe("payment.vue", () => {
|
|||
vmMock,
|
||||
{ query: { fmgPage: "payment" } },
|
||||
undefined,
|
||||
nextF
|
||||
nextF,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ export default {
|
|||
const signaturePromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
||||
storeActions.GET_SIGNATURE,
|
||||
null,
|
||||
"payment"
|
||||
"payment",
|
||||
);
|
||||
|
||||
const wipersPromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
||||
|
|
@ -289,13 +289,13 @@ export default {
|
|||
serviceZipCode: store.getters.order.serviceLocation.zipCode,
|
||||
carId: store.getters.vehicle.carId,
|
||||
},
|
||||
"payment"
|
||||
"payment",
|
||||
);
|
||||
|
||||
const rainDefensePromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
||||
storeActions.GET_RAIN_DEFENSE,
|
||||
null,
|
||||
"payment"
|
||||
"payment",
|
||||
);
|
||||
|
||||
const promiseResultMap = [
|
||||
|
|
@ -336,7 +336,7 @@ export default {
|
|||
availableLineItems: lineItemsToTax,
|
||||
},
|
||||
"payment",
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
// Promo logic
|
||||
|
|
@ -346,12 +346,12 @@ export default {
|
|||
await revalidatePromosAndValidateQueryStringPromo(
|
||||
promoCodeFromQueryString,
|
||||
pricedLineItemsToTax,
|
||||
"payment"
|
||||
"payment",
|
||||
);
|
||||
|
||||
const newValidatedPromos = validatePromoResponse?.orderPromos ?? [];
|
||||
newValidatedPromos.push(
|
||||
...(revalidatePromoResponse ? revalidatePromoResponse.promoLineItems : [])
|
||||
...(revalidatePromoResponse ? revalidatePromoResponse.promoLineItems : []),
|
||||
);
|
||||
|
||||
pricedLineItemsToTax.push(...newValidatedPromos);
|
||||
|
|
@ -369,7 +369,7 @@ export default {
|
|||
pricedLineItems: pricedLineItemsToTax,
|
||||
},
|
||||
"payment",
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
// Match all line items to the line items as they are in the store
|
||||
|
|
@ -383,7 +383,7 @@ export default {
|
|||
const vapsToAddToCart = getVapsThatNeedToBeAddedToSatisfyPromos(
|
||||
newValidatedPromos,
|
||||
taxedVaps,
|
||||
lineItems
|
||||
lineItems,
|
||||
);
|
||||
lineItems.vaps = lineItems.vaps ?? [];
|
||||
lineItems.vaps.push(...vapsToAddToCart);
|
||||
|
|
@ -614,7 +614,7 @@ export default {
|
|||
await this.dispatchStoreAction(
|
||||
storeActions.SAVE_PAYMENT_METHOD_CHOICE,
|
||||
paymentMethods.LATER,
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
await this.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE);
|
||||
|
|
@ -632,7 +632,7 @@ export default {
|
|||
this.navigationScenarios.PIA_ERROR,
|
||||
this.$route,
|
||||
{},
|
||||
{ [routerParams.DISPLAY_PIA_ALERT]: true }
|
||||
{ [routerParams.DISPLAY_PIA_ALERT]: true },
|
||||
);
|
||||
this.$refs.loadingModal.isModalVisible = false;
|
||||
return;
|
||||
|
|
@ -727,13 +727,13 @@ export default {
|
|||
this.dispatchStoreAction(
|
||||
storeActions.SAVE_PAYMENT_METHOD_CHOICE,
|
||||
paymentMethod,
|
||||
false
|
||||
false,
|
||||
);
|
||||
}
|
||||
},
|
||||
setIFrameListener() {
|
||||
window.addEventListener("message", (event) =>
|
||||
this.handleIFrameContentWindowMessage(event)
|
||||
this.handleIFrameContentWindowMessage(event),
|
||||
);
|
||||
},
|
||||
setUIBlock(val) {
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ export default {
|
|||
}
|
||||
|
||||
let price = baseMixin.methods.getTierOnePackagePrice(
|
||||
baseMixin.methods.filterOutFees(allLineItems)
|
||||
baseMixin.methods.filterOutFees(allLineItems),
|
||||
);
|
||||
|
||||
let vapsLineItemsForSelectedPackage = this.lineItems.vaps;
|
||||
|
|
@ -94,7 +94,7 @@ export default {
|
|||
let allLineItems = getArrayOfAllLineItems(this.lineItems);
|
||||
const promos = getPromosThatMatchLineItemsOnOrder(
|
||||
this.lineItems.promos,
|
||||
allLineItems
|
||||
allLineItems,
|
||||
);
|
||||
promos.forEach((promo) => {
|
||||
price += baseMixin.methods.getTotalLineItemPrice(promo);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ export default {
|
|||
const answers = this.getCmsContent(this.cmsWidgetName, "Answers");
|
||||
if (answers) {
|
||||
answers.forEach(
|
||||
(answer) => (answer.additionalButtonData = this.additionalButtonData)
|
||||
(answer) => (answer.additionalButtonData = this.additionalButtonData),
|
||||
);
|
||||
}
|
||||
return answers;
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ jest.mock(
|
|||
() => {
|
||||
return {};
|
||||
},
|
||||
{ virtual: true }
|
||||
{ virtual: true },
|
||||
);
|
||||
|
||||
// START beforeRouteEnter mock arranging //
|
||||
|
|
@ -265,7 +265,7 @@ describe("quote.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "quote" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
//Assert
|
||||
|
|
@ -303,7 +303,7 @@ describe("quote.vue", () => {
|
|||
wrapper.vm.$route = { query: { isInsurance: "false" } };
|
||||
|
||||
const isServicePackageDiscount = mockMixin.methods.getSettingValue(
|
||||
experimentSettings.SERVICE_PACKAGE_DISCOUNT
|
||||
experimentSettings.SERVICE_PACKAGE_DISCOUNT,
|
||||
);
|
||||
|
||||
//Act
|
||||
|
|
@ -311,7 +311,7 @@ describe("quote.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "quote" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
//Assert
|
||||
expect(isServicePackageDiscount).toBe(true);
|
||||
|
|
@ -348,7 +348,7 @@ describe("quote.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "quote" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
//Assert
|
||||
|
|
@ -386,7 +386,7 @@ describe("quote.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "quote" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
//Assert
|
||||
|
|
@ -426,7 +426,7 @@ describe("quote.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "quote" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
//Assert
|
||||
|
|
@ -465,7 +465,7 @@ describe("quote.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "quote" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
//Assert
|
||||
|
|
@ -506,7 +506,7 @@ describe("quote.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "quote" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
//Assert
|
||||
|
|
@ -548,7 +548,7 @@ describe("quote.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "quote" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
//Assert
|
||||
|
|
@ -586,7 +586,7 @@ describe("quote.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "quote" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
//Assert
|
||||
expect(wrapper.vm.isInsuranceSelected).toBe(true);
|
||||
|
|
@ -642,7 +642,7 @@ describe("quote.vue", () => {
|
|||
expect(wrapper.vm.dispatchStoreAction).toHaveBeenCalledWith(
|
||||
"saveSupportingItems",
|
||||
wrapper.vm.lineItems.supportingItems,
|
||||
false
|
||||
false,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
@ -701,7 +701,7 @@ describe("quote.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "quote" } },
|
||||
undefined,
|
||||
nextFunction
|
||||
nextFunction,
|
||||
);
|
||||
await nextTick();
|
||||
expect(nextFunction).toHaveBeenCalled();
|
||||
|
|
|
|||
|
|
@ -138,17 +138,17 @@ export default {
|
|||
serviceZipCode: store.getters.order.serviceLocation.zipCode,
|
||||
carId: store.getters.vehicle.carId,
|
||||
},
|
||||
"quote"
|
||||
"quote",
|
||||
);
|
||||
const rainDefensePromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
||||
storeActions.GET_RAIN_DEFENSE,
|
||||
null,
|
||||
"quote"
|
||||
"quote",
|
||||
);
|
||||
const supportingItemsPromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
||||
storeActions.GET_SUPPORTING_ITEMS,
|
||||
null,
|
||||
"quote"
|
||||
"quote",
|
||||
);
|
||||
|
||||
const promiseResultMap = [
|
||||
|
|
@ -175,7 +175,7 @@ export default {
|
|||
lineItems.vaps = lineItems.vaps ?? [];
|
||||
const nullSafeGlassParts = lineItems.glassParts ?? [];
|
||||
const servicePackageDiscountSettingValue = experimentMixin.methods.getSettingValue(
|
||||
experimentSettings.SERVICE_PACKAGE_DISCOUNT
|
||||
experimentSettings.SERVICE_PACKAGE_DISCOUNT,
|
||||
);
|
||||
const isServicePackageDiscount = servicePackageDiscountSettingValue === "True";
|
||||
//Service package cash discount api call when experiment is active
|
||||
|
|
@ -185,7 +185,7 @@ export default {
|
|||
await baseMixin.methods.dispatchStoreActionWithLogging(
|
||||
storeActions.GET_SERVICE_PACKAGE_DISCOUNT_PART,
|
||||
null,
|
||||
"quote"
|
||||
"quote",
|
||||
);
|
||||
if (servicePackageDiscountPartResponse.data) {
|
||||
servicePackageDiscountPart.push(servicePackageDiscountPartResponse.data);
|
||||
|
|
@ -203,12 +203,12 @@ export default {
|
|||
baseMixin.methods.dispatchStoreAction(
|
||||
storeActions.SAVE_PARENT_ACCOUNT_NUMBER,
|
||||
applicationConfig.CASH_PARENT_ACCOUNT_NUMBER,
|
||||
false
|
||||
false,
|
||||
);
|
||||
baseMixin.methods.dispatchStoreAction(
|
||||
storeActions.SAVE_BILL_TO_ACCOUNT_NUMBER,
|
||||
applicationConfig.CASH_DEFAULT_BILL_TO_ACCOUNT_NUMBER,
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
const pricingResults = await baseMixin.methods.dispatchStoreActionWithLogging(
|
||||
|
|
@ -217,13 +217,13 @@ export default {
|
|||
availableLineItems: availableLineItems,
|
||||
},
|
||||
"quote",
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
baseMixin.methods.dispatchStoreAction(
|
||||
storeActions.SAVE_SUPPORTING_ITEMS,
|
||||
resultMap.supportingItems,
|
||||
false
|
||||
false,
|
||||
);
|
||||
lineItems.supportingItems = resultMap.supportingItems;
|
||||
const addableVaps = [...resultMap.wipers, resultMap.rainDefense];
|
||||
|
|
@ -239,7 +239,7 @@ export default {
|
|||
promoCodeFromQueryString,
|
||||
pricingResults,
|
||||
"quote",
|
||||
true
|
||||
true,
|
||||
);
|
||||
// Sync local promos with any new promos added by validate/revalidate
|
||||
lineItems.promos = store.getters.lineItems.promos ?? [];
|
||||
|
|
@ -257,7 +257,7 @@ export default {
|
|||
const revalidateAlerts = buildToastMessagesFromRevalidateOrValidatePromoResponse(
|
||||
revalidatePromoResponse,
|
||||
oldActivePromos,
|
||||
oldInactivePromos
|
||||
oldInactivePromos,
|
||||
);
|
||||
revalidateAlerts.forEach((alert) => {
|
||||
vm.$refs.funnelHeader.pushGlobalAlert(alert, alert.shouldAutoFade);
|
||||
|
|
@ -268,7 +268,7 @@ export default {
|
|||
buildToastMessagesFromRevalidateOrValidatePromoResponse(validatePromoResponse);
|
||||
vm.$refs.funnelHeader.pushGlobalAlert(
|
||||
validateAlerts[0],
|
||||
validateAlerts[0].shouldAutoFade
|
||||
validateAlerts[0].shouldAutoFade,
|
||||
);
|
||||
}
|
||||
if (store.getters.isExternalParameter) {
|
||||
|
|
@ -306,7 +306,7 @@ export default {
|
|||
isRecalibrationOnOrder() {
|
||||
return containsLineItemWithPartType(
|
||||
partTypeStrings.RECALIBRATION,
|
||||
this?.availableLineItems
|
||||
this?.availableLineItems,
|
||||
);
|
||||
},
|
||||
},
|
||||
|
|
@ -343,7 +343,7 @@ export default {
|
|||
} else {
|
||||
return availableLineItems
|
||||
? baseMixin.methods.getTierOnePackagePrice(
|
||||
baseMixin.methods.filterOutFees(availableLineItems)
|
||||
baseMixin.methods.filterOutFees(availableLineItems),
|
||||
) > 300
|
||||
: null;
|
||||
}
|
||||
|
|
@ -361,19 +361,19 @@ export default {
|
|||
this.dispatchStoreAction(
|
||||
this.storeActions.SAVE_PAYMENT_TYPE,
|
||||
this.isInsuranceSelected,
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
if (!this.isInsuranceSelected) {
|
||||
this.dispatchStoreAction(
|
||||
this.storeActions.SAVE_PARENT_ACCOUNT_NUMBER,
|
||||
applicationConfig.CASH_PARENT_ACCOUNT_NUMBER,
|
||||
false
|
||||
false,
|
||||
);
|
||||
this.dispatchStoreAction(
|
||||
this.storeActions.SAVE_BILL_TO_ACCOUNT_NUMBER,
|
||||
applicationConfig.CASH_DEFAULT_BILL_TO_ACCOUNT_NUMBER,
|
||||
false
|
||||
false,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -388,13 +388,13 @@ export default {
|
|||
this.dispatchStoreAction(
|
||||
this.storeActions.SAVE_GLASS_PARTS_SUPPRESSING_STATE_RESETTING,
|
||||
this.lineItems.glassParts,
|
||||
false
|
||||
false,
|
||||
);
|
||||
}
|
||||
this.dispatchStoreAction(
|
||||
this.storeActions.SAVE_SUPPORTING_ITEMS,
|
||||
this.lineItems.supportingItems,
|
||||
false
|
||||
false,
|
||||
);
|
||||
this.dispatchStoreAction(this.storeActions.SAVE_VAPS, this.lineItems.vaps, false);
|
||||
this.dispatchStoreAction(
|
||||
|
|
@ -402,19 +402,19 @@ export default {
|
|||
{
|
||||
activePromos: this.lineItems.promos,
|
||||
},
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
const payment = this.$store.getters.payment;
|
||||
if (payment.isInsurance) {
|
||||
this.$router.navigateWithSaving(
|
||||
this.navigationScenarios.CLICKED_FORWARD_WITH_INSURANCE,
|
||||
this.$route
|
||||
this.$route,
|
||||
);
|
||||
} else {
|
||||
this.$router.navigateWithSaving(
|
||||
this.navigationScenarios.CLICKED_FORWARD_WITH_CASH,
|
||||
this.$route
|
||||
this.$route,
|
||||
);
|
||||
}
|
||||
},
|
||||
|
|
@ -425,16 +425,16 @@ export default {
|
|||
this.lineItems.promos?.length > 0
|
||||
? this.$refs.servicePackage.getDiscountedPackagePriceString(
|
||||
packageNames.TIER_ONE,
|
||||
false
|
||||
false,
|
||||
)
|
||||
: this.$refs.servicePackage.getPackagePriceString(
|
||||
packageNames.TIER_ONE
|
||||
packageNames.TIER_ONE,
|
||||
);
|
||||
this.pushEventToGA(
|
||||
this.$route.query[this.queryStrings.FMG_PAGE],
|
||||
this.GaActions.CASH_QUOTE_DISPLAYED,
|
||||
tierOnePrice,
|
||||
true
|
||||
true,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
|
@ -457,10 +457,10 @@ export default {
|
|||
}
|
||||
if (oldValue.promos.length < newValue.promos.length) {
|
||||
const oldPromoCodes = oldValue.promos.map(
|
||||
(promoObject) => promoObject.promoCode
|
||||
(promoObject) => promoObject.promoCode,
|
||||
);
|
||||
const newlyActivatedPromoCodes = newValue.promos.filter(
|
||||
(newPromo) => !oldPromoCodes.includes(newPromo.promoCode)
|
||||
(newPromo) => !oldPromoCodes.includes(newPromo.promoCode),
|
||||
);
|
||||
const alert = createPromoSuccessAlert(newlyActivatedPromoCodes[0].promoCode);
|
||||
this.$refs.funnelHeader.pushGlobalAlert(alert, alert.shouldAutoFade);
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ export default {
|
|||
},
|
||||
recalBody() {
|
||||
return splitCopyOnCMSPlaceHolder(
|
||||
this.getCmsContent(this.cmsWidgetName, "SubheaderText")
|
||||
this.getCmsContent(this.cmsWidgetName, "SubheaderText"),
|
||||
);
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -119,11 +119,11 @@ describe("service-package-question.vue", () => {
|
|||
|
||||
wrapper.vm.isServicePackageDiscountOnOrder = containsLineItemWithPartType(
|
||||
partType,
|
||||
mockProps.lineItems.supportingItems
|
||||
mockProps.lineItems.supportingItems,
|
||||
);
|
||||
const servicePackageDiscountLineItem = findLineItemsWithPartType(
|
||||
partType,
|
||||
mockProps.lineItems.supportingItems
|
||||
mockProps.lineItems.supportingItems,
|
||||
);
|
||||
wrapper.vm.getServicePackageDiscountPrice();
|
||||
const price = baseMixin.methods.getTotalLineItemPrice(servicePackageDiscountLineItem[0]);
|
||||
|
|
@ -159,7 +159,7 @@ describe("service-package-question.vue", () => {
|
|||
|
||||
// Assert
|
||||
expect(
|
||||
wrapper.vm.servicePackageAnswers[0].buttonAuxillaryCopy.includes("As little as")
|
||||
wrapper.vm.servicePackageAnswers[0].buttonAuxillaryCopy.includes("As little as"),
|
||||
).toBe(true);
|
||||
});
|
||||
it("should return [] from nullSafeAvailableLineItems and not error out if availableLineItems is null", () => {
|
||||
|
|
@ -209,14 +209,14 @@ describe("service-package-question.vue", () => {
|
|||
// economy answer
|
||||
runPackageAnswerExpectStatements(
|
||||
wrapper.vm.servicePackageAnswers[0],
|
||||
expectedModifiedAnswers[packageNameKey].tierOne
|
||||
expectedModifiedAnswers[packageNameKey].tierOne,
|
||||
);
|
||||
// standard answer should not be created
|
||||
expect(wrapper.vm.servicePackageAnswers.length).toBe(2);
|
||||
// premium answer
|
||||
runPackageAnswerExpectStatements(
|
||||
wrapper.vm.servicePackageAnswers[1],
|
||||
expectedModifiedAnswers[packageNameKey].tierThree
|
||||
expectedModifiedAnswers[packageNameKey].tierThree,
|
||||
);
|
||||
});
|
||||
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
|
||||
runPackageAnswerExpectStatements(
|
||||
wrapper.vm.servicePackageAnswers[0],
|
||||
expectedModifiedAnswers[packageNameKey].tierOne
|
||||
expectedModifiedAnswers[packageNameKey].tierOne,
|
||||
);
|
||||
// standard answer
|
||||
runPackageAnswerExpectStatements(
|
||||
wrapper.vm.servicePackageAnswers[1],
|
||||
expectedModifiedAnswers[packageNameKey].tierTwo
|
||||
expectedModifiedAnswers[packageNameKey].tierTwo,
|
||||
);
|
||||
// premium answer
|
||||
runPackageAnswerExpectStatements(
|
||||
wrapper.vm.servicePackageAnswers[2],
|
||||
expectedModifiedAnswers[packageNameKey].tierThree
|
||||
expectedModifiedAnswers[packageNameKey].tierThree,
|
||||
);
|
||||
});
|
||||
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
|
||||
runPackageAnswerExpectStatements(
|
||||
wrapper.vm.servicePackageAnswers[0],
|
||||
expectedModifiedAnswers[packageNameKey].tierOne
|
||||
expectedModifiedAnswers[packageNameKey].tierOne,
|
||||
);
|
||||
// standard answer
|
||||
runPackageAnswerExpectStatements(
|
||||
wrapper.vm.servicePackageAnswers[1],
|
||||
expectedModifiedAnswers[packageNameKey].tierTwo
|
||||
expectedModifiedAnswers[packageNameKey].tierTwo,
|
||||
);
|
||||
// premium answer
|
||||
runPackageAnswerExpectStatements(
|
||||
wrapper.vm.servicePackageAnswers[2],
|
||||
expectedModifiedAnswers[packageNameKey].tierThree
|
||||
expectedModifiedAnswers[packageNameKey].tierThree,
|
||||
);
|
||||
});
|
||||
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
|
||||
runPackageAnswerExpectStatements(
|
||||
wrapper.vm.servicePackageAnswers[0],
|
||||
expectedModifiedAnswers[packageNameKey].tierOne
|
||||
expectedModifiedAnswers[packageNameKey].tierOne,
|
||||
);
|
||||
// standard answer
|
||||
runPackageAnswerExpectStatements(
|
||||
wrapper.vm.servicePackageAnswers[1],
|
||||
expectedModifiedAnswers[packageNameKey].tierTwo
|
||||
expectedModifiedAnswers[packageNameKey].tierTwo,
|
||||
);
|
||||
// premium answer
|
||||
runPackageAnswerExpectStatements(
|
||||
wrapper.vm.servicePackageAnswers[2],
|
||||
expectedModifiedAnswers[packageNameKey].tierThree
|
||||
expectedModifiedAnswers[packageNameKey].tierThree,
|
||||
);
|
||||
});
|
||||
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
|
||||
runPackageAnswerExpectStatements(
|
||||
wrapper.vm.servicePackageAnswers[0],
|
||||
expectedModifiedAnswers[packageNameKey].tierOne
|
||||
expectedModifiedAnswers[packageNameKey].tierOne,
|
||||
);
|
||||
// standard answer
|
||||
runPackageAnswerExpectStatements(
|
||||
wrapper.vm.servicePackageAnswers[1],
|
||||
expectedModifiedAnswers[packageNameKey].tierTwo
|
||||
expectedModifiedAnswers[packageNameKey].tierTwo,
|
||||
);
|
||||
// premium answer
|
||||
runPackageAnswerExpectStatements(
|
||||
wrapper.vm.servicePackageAnswers[2],
|
||||
expectedModifiedAnswers[packageNameKey].tierThree
|
||||
expectedModifiedAnswers[packageNameKey].tierThree,
|
||||
);
|
||||
});
|
||||
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
|
||||
runPackageAnswerExpectStatements(
|
||||
wrapper.vm.servicePackageAnswers[0],
|
||||
expectedModifiedAnswers[packageNameKey].tierOne
|
||||
expectedModifiedAnswers[packageNameKey].tierOne,
|
||||
);
|
||||
// standard answer
|
||||
runPackageAnswerExpectStatements(
|
||||
wrapper.vm.servicePackageAnswers[1],
|
||||
expectedModifiedAnswers[packageNameKey].tierTwo
|
||||
expectedModifiedAnswers[packageNameKey].tierTwo,
|
||||
);
|
||||
// premium answer
|
||||
runPackageAnswerExpectStatements(
|
||||
wrapper.vm.servicePackageAnswers[2],
|
||||
expectedModifiedAnswers[packageNameKey].tierThree
|
||||
expectedModifiedAnswers[packageNameKey].tierThree,
|
||||
);
|
||||
});
|
||||
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
|
||||
runPackageAnswerExpectStatements(
|
||||
wrapper.vm.servicePackageAnswers[0],
|
||||
expectedModifiedAnswers[packageNameKey].tierOne
|
||||
expectedModifiedAnswers[packageNameKey].tierOne,
|
||||
);
|
||||
// standard answer
|
||||
runPackageAnswerExpectStatements(
|
||||
wrapper.vm.servicePackageAnswers[1],
|
||||
expectedModifiedAnswers[packageNameKey].tierTwo
|
||||
expectedModifiedAnswers[packageNameKey].tierTwo,
|
||||
);
|
||||
// premium answer
|
||||
runPackageAnswerExpectStatements(
|
||||
wrapper.vm.servicePackageAnswers[2],
|
||||
expectedModifiedAnswers[packageNameKey].tierThree
|
||||
expectedModifiedAnswers[packageNameKey].tierThree,
|
||||
);
|
||||
});
|
||||
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
|
||||
runPackageAnswerExpectStatements(
|
||||
wrapper.vm.servicePackageAnswers[0],
|
||||
expectedModifiedAnswers[packageNameKey].tierOne
|
||||
expectedModifiedAnswers[packageNameKey].tierOne,
|
||||
);
|
||||
// standard answer
|
||||
runPackageAnswerExpectStatements(
|
||||
wrapper.vm.servicePackageAnswers[1],
|
||||
expectedModifiedAnswers[packageNameKey].tierTwo
|
||||
expectedModifiedAnswers[packageNameKey].tierTwo,
|
||||
);
|
||||
// premium answer
|
||||
runPackageAnswerExpectStatements(
|
||||
wrapper.vm.servicePackageAnswers[2],
|
||||
expectedModifiedAnswers[packageNameKey].tierThree
|
||||
expectedModifiedAnswers[packageNameKey].tierThree,
|
||||
);
|
||||
});
|
||||
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
|
||||
runPackageAnswerExpectStatements(
|
||||
wrapper.vm.servicePackageAnswers[0],
|
||||
expectedModifiedAnswers[packageNameKey].tierOne
|
||||
expectedModifiedAnswers[packageNameKey].tierOne,
|
||||
);
|
||||
// standard answer should not be created
|
||||
expect(wrapper.vm.servicePackageAnswers.length).toBe(2);
|
||||
// premium answer
|
||||
runPackageAnswerExpectStatements(
|
||||
wrapper.vm.servicePackageAnswers[1],
|
||||
expectedModifiedAnswers[packageNameKey].tierThree
|
||||
expectedModifiedAnswers[packageNameKey].tierThree,
|
||||
);
|
||||
});
|
||||
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
|
||||
runPackageAnswerExpectStatements(
|
||||
wrapper.vm.servicePackageAnswers[0],
|
||||
expectedModifiedAnswers[packageNameKey].tierOne
|
||||
expectedModifiedAnswers[packageNameKey].tierOne,
|
||||
);
|
||||
// standard answer should not be created
|
||||
expect(wrapper.vm.servicePackageAnswers.length).toBe(2);
|
||||
// premium answer
|
||||
runPackageAnswerExpectStatements(
|
||||
wrapper.vm.servicePackageAnswers[1],
|
||||
expectedModifiedAnswers[packageNameKey].tierThree
|
||||
expectedModifiedAnswers[packageNameKey].tierThree,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -78,11 +78,11 @@ export default {
|
|||
if (
|
||||
containsLineItemWithPartType(
|
||||
partTypeStrings.SERVICE_PACKAGE_DISCOUNT,
|
||||
supportingItems
|
||||
supportingItems,
|
||||
)
|
||||
) {
|
||||
supportingItems = supportingItems.filter(
|
||||
(item) => item.partType !== partTypeStrings.SERVICE_PACKAGE_DISCOUNT
|
||||
(item) => item.partType !== partTypeStrings.SERVICE_PACKAGE_DISCOUNT,
|
||||
);
|
||||
}
|
||||
if (
|
||||
|
|
@ -114,11 +114,11 @@ export default {
|
|||
const availablePackages = getAvailablePackages(
|
||||
this.glassToReplace,
|
||||
this.nullSafeAvailableLineItems,
|
||||
this.isRepair
|
||||
this.isRepair,
|
||||
);
|
||||
|
||||
cmsAnswersContent = cmsAnswersContent.filter((answer) =>
|
||||
availablePackages.some((tier) => answer.Name === tier.packageName)
|
||||
availablePackages.some((tier) => answer.Name === tier.packageName),
|
||||
);
|
||||
|
||||
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
|
||||
buttonAuxillaryCopy: this.getDiscountedPackagePriceString(
|
||||
answer.Name,
|
||||
this.isServicePackageDiscountOnOrder && answer.Text != ""
|
||||
this.isServicePackageDiscountOnOrder && answer.Text != "",
|
||||
),
|
||||
buttonFooterCopy: this.getFooterTextFromCms(answer.SubWidgetName),
|
||||
additionalButtonData: {
|
||||
|
|
@ -144,13 +144,13 @@ export default {
|
|||
isRecalibrationOnOrder() {
|
||||
return containsLineItemWithPartType(
|
||||
partTypeStrings.RECALIBRATION,
|
||||
this.nullSafeAvailableLineItems
|
||||
this.nullSafeAvailableLineItems,
|
||||
);
|
||||
},
|
||||
isServicePackageDiscountOnOrder() {
|
||||
return containsLineItemWithPartType(
|
||||
partTypeStrings.SERVICE_PACKAGE_DISCOUNT,
|
||||
this.nullSafeAvailableLineItems
|
||||
this.nullSafeAvailableLineItems,
|
||||
);
|
||||
},
|
||||
frontWipersApplicableForTierTwo() {
|
||||
|
|
@ -158,7 +158,7 @@ export default {
|
|||
this.glassToReplace,
|
||||
this.nullSafeAvailableLineItems,
|
||||
this.isRepair,
|
||||
packageNames.TIER_TWO
|
||||
packageNames.TIER_TWO,
|
||||
);
|
||||
},
|
||||
rearWiperApplicableForTierTwo() {
|
||||
|
|
@ -166,7 +166,7 @@ export default {
|
|||
this.glassToReplace,
|
||||
this.nullSafeAvailableLineItems,
|
||||
this.isRepair,
|
||||
packageNames.TIER_TWO
|
||||
packageNames.TIER_TWO,
|
||||
);
|
||||
},
|
||||
frontWipersApplicableForTierThree() {
|
||||
|
|
@ -174,7 +174,7 @@ export default {
|
|||
this.glassToReplace,
|
||||
this.nullSafeAvailableLineItems,
|
||||
this.isRepair,
|
||||
packageNames.TIER_THREE
|
||||
packageNames.TIER_THREE,
|
||||
);
|
||||
},
|
||||
rearWiperApplicableForTierThree() {
|
||||
|
|
@ -182,7 +182,7 @@ export default {
|
|||
this.glassToReplace,
|
||||
this.nullSafeAvailableLineItems,
|
||||
this.isRepair,
|
||||
packageNames.TIER_THREE
|
||||
packageNames.TIER_THREE,
|
||||
);
|
||||
},
|
||||
rainDefenseApplicableForTierThree() {
|
||||
|
|
@ -190,7 +190,7 @@ export default {
|
|||
this.glassToReplace,
|
||||
this.nullSafeAvailableLineItems,
|
||||
this.isRepair,
|
||||
packageNames.TIER_THREE
|
||||
packageNames.TIER_THREE,
|
||||
);
|
||||
},
|
||||
glassToReplace() {
|
||||
|
|
@ -202,7 +202,7 @@ export default {
|
|||
servicePackageDiscountParts() {
|
||||
return findLineItemsWithPartType(
|
||||
partTypeStrings.SERVICE_PACKAGE_DISCOUNT,
|
||||
this.nullSafeAvailableLineItems
|
||||
this.nullSafeAvailableLineItems,
|
||||
);
|
||||
},
|
||||
},
|
||||
|
|
@ -227,13 +227,16 @@ export default {
|
|||
this.getPackagePrice(packageName, {
|
||||
discountedPrice: false,
|
||||
servicePackageDiscount: false,
|
||||
})
|
||||
}),
|
||||
).toFixed(2);
|
||||
return "$" + formattedPriceFloat;
|
||||
},
|
||||
getDiscountedPackagePriceString(packageName, servicePackageDiscount) {
|
||||
const formattedPriceFloat = parseFloat(
|
||||
this.getPackagePrice(packageName, { discountedPrice: true, servicePackageDiscount })
|
||||
this.getPackagePrice(packageName, {
|
||||
discountedPrice: true,
|
||||
servicePackageDiscount,
|
||||
}),
|
||||
).toFixed(2);
|
||||
return (this.isInsuranceSelected ? "As little as $" : "$") + formattedPriceFloat;
|
||||
},
|
||||
|
|
@ -261,7 +264,7 @@ export default {
|
|||
let priceFloat = this.isInsuranceSelected
|
||||
? 0
|
||||
: baseMixin.methods.getTierOnePackagePrice(
|
||||
baseMixin.methods.filterOutFees(lineItemsToPrice)
|
||||
baseMixin.methods.filterOutFees(lineItemsToPrice),
|
||||
);
|
||||
|
||||
priceFloat += this.getVapsPrice(packageName, discountedPrice);
|
||||
|
|
@ -272,7 +275,7 @@ export default {
|
|||
if (this.isServicePackageDiscountOnOrder) {
|
||||
let price = 0;
|
||||
price += baseMixin.methods.getTotalLineItemPrice(
|
||||
this.servicePackageDiscountParts[0]
|
||||
this.servicePackageDiscountParts[0],
|
||||
);
|
||||
return Math.abs(price);
|
||||
}
|
||||
|
|
@ -288,7 +291,7 @@ export default {
|
|||
if (applyPromoDiscounts && this.activePromos) {
|
||||
const relevantPromos = getPromosThatMatchLineItemsOnOrder(
|
||||
this.activePromos,
|
||||
vapsItems
|
||||
vapsItems,
|
||||
);
|
||||
relevantPromos.forEach((promo) => {
|
||||
price += baseMixin.methods.getTotalLineItemPrice(promo);
|
||||
|
|
@ -305,19 +308,19 @@ export default {
|
|||
const promosWithAddableVaps = getPromosWithAddableVaps(this.activePromos);
|
||||
const vapsThatMatchPromos = getLineItemsThatMatchPromos(
|
||||
promosWithAddableVaps,
|
||||
this.nullSafeAvailableLineItems
|
||||
this.nullSafeAvailableLineItems,
|
||||
);
|
||||
const vapsFromStore = this.$store.getters.lineItems.vaps ?? [];
|
||||
const vapsToUseForDefaultPackageSelection = this.combineLineItemsWithoutDuplicates(
|
||||
vapsThatMatchPromos,
|
||||
vapsFromStore
|
||||
vapsFromStore,
|
||||
);
|
||||
|
||||
this.selectedPackageName = getHighestRequiredTier(
|
||||
this.glassToReplace,
|
||||
this.nullSafeAvailableLineItems,
|
||||
this.isRepair,
|
||||
vapsToUseForDefaultPackageSelection
|
||||
vapsToUseForDefaultPackageSelection,
|
||||
);
|
||||
},
|
||||
getVapsLineItemsForSelectedPackage(packageName) {
|
||||
|
|
@ -325,14 +328,14 @@ export default {
|
|||
this.glassToReplace,
|
||||
this.nullSafeAvailableLineItems,
|
||||
this.isRepair,
|
||||
packageName
|
||||
packageName,
|
||||
);
|
||||
|
||||
let vapsLineItemsForSelectedPackage = [];
|
||||
|
||||
packageContentTypes.forEach((vapType) => {
|
||||
vapsLineItemsForSelectedPackage.push(
|
||||
...findLineItemsWithPartType(vapType, this.nullSafeAvailableLineItems)
|
||||
...findLineItemsWithPartType(vapType, this.nullSafeAvailableLineItems),
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -340,7 +343,7 @@ export default {
|
|||
},
|
||||
getServicePackageDiscountPartForSelectedPackage(packageName) {
|
||||
const selectedPackage = this.servicePackageAnswers.filter(
|
||||
(item) => item.value === packageName
|
||||
(item) => item.value === packageName,
|
||||
);
|
||||
if (selectedPackage?.[0]?.additionalButtonData?.servicePackageDiscount) {
|
||||
return this.servicePackageDiscountParts;
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ export default {
|
|||
},
|
||||
shouldDisplayStrikeThroughPrice() {
|
||||
const displayPrice = this.buttonAuxillaryCopy.substring(
|
||||
this.buttonAuxillaryCopy.indexOf("$")
|
||||
this.buttonAuxillaryCopy.indexOf("$"),
|
||||
);
|
||||
return displayPrice != this.additionalButtonData.strikeThroughPrice;
|
||||
},
|
||||
|
|
@ -173,7 +173,8 @@ export default {
|
|||
width: 100%;
|
||||
padding: 1rem;
|
||||
border: 1px solid $gray-300;
|
||||
box-shadow: 0px 4px 8px -4px rgba(0, 0, 0, 0.15),
|
||||
box-shadow:
|
||||
0px 4px 8px -4px rgba(0, 0, 0, 0.15),
|
||||
0px 4px 24px -8px rgba(0, 0, 0, 0.2);
|
||||
border-radius: 0.5rem;
|
||||
overflow: hidden;
|
||||
|
|
@ -220,7 +221,9 @@ export default {
|
|||
+ .package-label {
|
||||
&:before {
|
||||
border: 1px solid #8e9292;
|
||||
box-shadow: 0px 0px 0px 4px #9fcee6, 0px 1px 4px rgba(0, 0, 0, 0.2);
|
||||
box-shadow:
|
||||
0px 0px 0px 4px #9fcee6,
|
||||
0px 1px 4px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ export async function getAlertReasons(ctu) {
|
|||
{
|
||||
ctu: ctu,
|
||||
},
|
||||
"schedule"
|
||||
"schedule",
|
||||
);
|
||||
|
||||
return Promise.resolve(alertReasons);
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ describe("schedule.vue...", () => {
|
|||
// Act
|
||||
const newShopTimeSlots = await wrapper.vm.getAvailableDatesMethod(
|
||||
"2023-01-01",
|
||||
"2023-01-31"
|
||||
"2023-01-31",
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -281,7 +281,7 @@ describe("schedule.vue...", () => {
|
|||
"2023-01-01",
|
||||
"2023-03-31",
|
||||
"Inshop",
|
||||
"123"
|
||||
"123",
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -290,7 +290,7 @@ describe("schedule.vue...", () => {
|
|||
"getShopTimeSlots",
|
||||
expect.anything(),
|
||||
expect.anything(),
|
||||
expect.anything()
|
||||
expect.anything(),
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -311,7 +311,7 @@ describe("schedule.vue...", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "schedule" } },
|
||||
undefined,
|
||||
nextFunction
|
||||
nextFunction,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -320,7 +320,7 @@ describe("schedule.vue...", () => {
|
|||
expect(wrapper.vm.$refs.datePicker.initializeComponent).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
calendarViewDirection: "future",
|
||||
})
|
||||
}),
|
||||
);
|
||||
expect(wrapper.vm.$refs.locationAlerts.initializeComponent).toHaveBeenCalled();
|
||||
expect(wrapper.vm.selectableDatesData).toStrictEqual(
|
||||
|
|
@ -328,12 +328,12 @@ describe("schedule.vue...", () => {
|
|||
days: expect.any(Array),
|
||||
estimatedServiceMinutesMaximum: expect.any(Number),
|
||||
estimatedServiceMinutesMinimum: expect.any(Number),
|
||||
})
|
||||
}),
|
||||
);
|
||||
expect(wrapper.vm.mobilePremiumAppointmentFee).toStrictEqual(
|
||||
expect.objectContaining({
|
||||
partNumber: expect.any(String),
|
||||
})
|
||||
}),
|
||||
);
|
||||
expect(wrapper.vm.updateFooterButtonText).toHaveBeenCalled();
|
||||
});
|
||||
|
|
@ -375,7 +375,7 @@ describe("schedule.vue...", () => {
|
|||
expect(testValue).toStrictEqual(
|
||||
expect.objectContaining({
|
||||
date: "2022-11-11",
|
||||
})
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -514,7 +514,7 @@ describe("schedule.vue...", () => {
|
|||
// Assert
|
||||
expect(wrapper.vm.$router.navigateWithoutSaving).toBeCalledWith(
|
||||
"CLICKED_BACK",
|
||||
"testRoute"
|
||||
"testRoute",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
@ -579,7 +579,7 @@ describe("schedule.vue...", () => {
|
|||
partType: "EARLY BIRD",
|
||||
}),
|
||||
]),
|
||||
expect.anything()
|
||||
expect.anything(),
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -624,7 +624,7 @@ describe("schedule.vue...", () => {
|
|||
partType: "EARLY BIRD",
|
||||
}),
|
||||
]),
|
||||
expect.anything()
|
||||
expect.anything(),
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ const getAvailableDates = async (
|
|||
startDateString,
|
||||
endDateString,
|
||||
appointmentType,
|
||||
providerNumber
|
||||
providerNumber,
|
||||
) => {
|
||||
const apiEndDateLimit = sumDateString(startDateString, TIME_SLOTS_CALL_DAYS_LIMIT);
|
||||
const difference = calcDaysBetweenDates(startDateString, endDateString);
|
||||
|
|
@ -172,7 +172,7 @@ const getAvailableDates = async (
|
|||
storeAction.storeAction,
|
||||
storeAction.payload,
|
||||
"schedule",
|
||||
false
|
||||
false,
|
||||
);
|
||||
timeSlotsResponsesData.estimatedServiceMinutesMinimum =
|
||||
timeSlotsResponse.data.estimatedServiceMinutesMinimum;
|
||||
|
|
@ -182,7 +182,7 @@ const getAvailableDates = async (
|
|||
...timeSlotsResponsesData.days,
|
||||
...timeSlotsResponse.data.days,
|
||||
];
|
||||
})
|
||||
}),
|
||||
);
|
||||
};
|
||||
|
||||
|
|
@ -222,7 +222,7 @@ export default {
|
|||
const premiumFeePromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
||||
storeActions.GET_MOBILE_PREMIUM_FEE,
|
||||
null,
|
||||
"schedule"
|
||||
"schedule",
|
||||
);
|
||||
|
||||
const premiumFeeWithPricePromise = premiumFeePromise.then((result) => {
|
||||
|
|
@ -233,7 +233,7 @@ export default {
|
|||
availableLineItems: [result.data],
|
||||
},
|
||||
"schedule",
|
||||
false
|
||||
false,
|
||||
);
|
||||
} else {
|
||||
return result.data;
|
||||
|
|
@ -242,7 +242,7 @@ export default {
|
|||
|
||||
const alertReasonsPromise = locationAlerts.methods.loadInitialData(
|
||||
store.getters.order.serviceLocation.zipCodeCtu,
|
||||
store.getters.order.serviceLocation.provider?.address?.zipCodeCtu
|
||||
store.getters.order.serviceLocation.provider?.address?.zipCodeCtu,
|
||||
);
|
||||
|
||||
// Settle promises and get results
|
||||
|
|
@ -296,7 +296,7 @@ export default {
|
|||
}
|
||||
|
||||
return this.selectableDatesData.days?.find(
|
||||
(selectableDate) => selectableDate.date === this.selectedDate
|
||||
(selectableDate) => selectableDate.date === this.selectedDate,
|
||||
);
|
||||
},
|
||||
},
|
||||
|
|
@ -326,11 +326,11 @@ export default {
|
|||
startDate,
|
||||
endDate,
|
||||
this.appointmentType,
|
||||
this.$store.getters.order.serviceLocation.provider.providerNumber
|
||||
this.$store.getters.order.serviceLocation.provider.providerNumber,
|
||||
);
|
||||
// ADD API CALL RESULTS TO EXISTING DATE DATA
|
||||
this.selectableDatesData.days = this.selectableDatesData.days.concat(
|
||||
newShopTimeSlots.days
|
||||
newShopTimeSlots.days,
|
||||
);
|
||||
return newShopTimeSlots;
|
||||
},
|
||||
|
|
@ -351,7 +351,7 @@ export default {
|
|||
if (supportingItems) {
|
||||
isPremiumAppointment =
|
||||
!!supportingItems.filter(
|
||||
(lineItem) => lineItem.partType === PREMIUM_FEE_PART_TYPE
|
||||
(lineItem) => lineItem.partType === PREMIUM_FEE_PART_TYPE,
|
||||
).length > 0;
|
||||
}
|
||||
|
||||
|
|
@ -377,12 +377,12 @@ export default {
|
|||
navbarButtonText = "Continue";
|
||||
} else {
|
||||
navbarButtonText = `Select ${this.convertSelectedDateToShortMonthAndDay(
|
||||
timeSlotInfo.timeSlot.date
|
||||
timeSlotInfo.timeSlot.date,
|
||||
)}`;
|
||||
|
||||
if (this.appointmentType === AppointmentTypeStrings.IN_SHOP) {
|
||||
navbarButtonText += ` at ${this.getDisplayTextForMilitaryTime(
|
||||
timeSlotInfo.timeSlot.startTime
|
||||
timeSlotInfo.timeSlot.startTime,
|
||||
)}`;
|
||||
} else if (
|
||||
this.appointmentType === AppointmentTypeStrings.MOBILE &&
|
||||
|
|
@ -390,10 +390,10 @@ export default {
|
|||
) {
|
||||
navbarButtonText += ` at ${this.getDisplayTextForMilitaryTime(
|
||||
timeSlotInfo.timeSlot.startTime,
|
||||
true
|
||||
true,
|
||||
)} - ${this.getDisplayTextForMilitaryTime(
|
||||
timeSlotInfo.timeSlot.endTime,
|
||||
true
|
||||
true,
|
||||
)}`;
|
||||
}
|
||||
}
|
||||
|
|
@ -430,7 +430,7 @@ export default {
|
|||
this.dispatchStoreAction(
|
||||
this.storeActions.SAVE_SCHEDULE,
|
||||
this.selectedTimeSlotInfo.timeSlot,
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
this.$router.navigateWithSaving(this.navigationScenarios.CLICKED_FORWARD, this.$route);
|
||||
|
|
@ -444,7 +444,7 @@ export default {
|
|||
this.selectedTimeSlotInfo?.isPremiumAppointment
|
||||
) {
|
||||
const premiumFeeIndex = supportingItems.findIndex(
|
||||
(item) => item.partType == PREMIUM_FEE_PART_TYPE
|
||||
(item) => item.partType == PREMIUM_FEE_PART_TYPE,
|
||||
);
|
||||
|
||||
if (premiumFeeIndex >= 0) {
|
||||
|
|
@ -461,7 +461,7 @@ export default {
|
|||
this.dispatchStoreAction(
|
||||
this.storeActions.SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING,
|
||||
supportingItems,
|
||||
false
|
||||
false,
|
||||
);
|
||||
} else {
|
||||
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
|
||||
const removePremiumFeeIndex = supportingItems.findIndex(
|
||||
(item) => item.partType == PREMIUM_FEE_PART_TYPE
|
||||
(item) => item.partType == PREMIUM_FEE_PART_TYPE,
|
||||
);
|
||||
|
||||
if (removePremiumFeeIndex >= 0) {
|
||||
|
|
@ -478,7 +478,7 @@ export default {
|
|||
this.dispatchStoreAction(
|
||||
this.storeActions.SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING,
|
||||
supportingItems,
|
||||
false
|
||||
false,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ describe("time-slot-modal-question.vue Supplemental information", () => {
|
|||
|
||||
//Assert
|
||||
expect(wrapper.vm.supplementalInformationBlock).toEqual(
|
||||
mockCmsContent[mobileCmsWidgetName]["BodyText"]
|
||||
mockCmsContent[mobileCmsWidgetName]["BodyText"],
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -136,7 +136,7 @@ describe("time-slot-modal-question.vue Supplemental information", () => {
|
|||
|
||||
//Assert
|
||||
expect(wrapper.vm.supplementalInformationBlock).toEqual(
|
||||
mockCmsContent[mobileCmsWidgetName]["BodyText"]
|
||||
mockCmsContent[mobileCmsWidgetName]["BodyText"],
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -199,7 +199,7 @@ describe("time-slot-modal-question.vue Supplemental information", () => {
|
|||
|
||||
//Assert
|
||||
expect(wrapper.vm.supplementalInformationBlock).toEqual(
|
||||
mockCmsContent[dropOffWidgetName]["BodyText"]
|
||||
mockCmsContent[dropOffWidgetName]["BodyText"],
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -230,7 +230,7 @@ describe("time-slot-modal-question.vue Supplemental information", () => {
|
|||
|
||||
//Assert
|
||||
expect(wrapper.vm.supplementalInformationBlock).toEqual(
|
||||
mockCmsContent[overnightDropOffCmsWidgetName]["BodyText"]
|
||||
mockCmsContent[overnightDropOffCmsWidgetName]["BodyText"],
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -279,7 +279,7 @@ describe("time-slot-modal-question.vue Supplemental information", () => {
|
|||
|
||||
//Assert
|
||||
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
|
||||
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
|
||||
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
|
||||
expect(wrapper.vm.disclaimerTextBlockCopy).toEqual(
|
||||
mockCmsContent[overnightDropOffCmsWidgetName]["FooterText"]
|
||||
mockCmsContent[overnightDropOffCmsWidgetName]["FooterText"],
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -473,7 +473,7 @@ describe("time-slot-modal-question.vue Duration", () => {
|
|||
|
||||
//Assert
|
||||
expect(wrapper.vm.durationTextBlockCopy).toEqual(
|
||||
mockCmsContent[sameDayDropOffCmsWidgetName]["SubheaderText"]
|
||||
mockCmsContent[sameDayDropOffCmsWidgetName]["SubheaderText"],
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -505,7 +505,7 @@ describe("time-slot-modal-question.vue Duration", () => {
|
|||
|
||||
//Assert
|
||||
expect(wrapper.vm.durationTextBlockCopy).toEqual(
|
||||
mockCmsContent[overnightDropOffCmsWidgetName]["SubheaderText"]
|
||||
mockCmsContent[overnightDropOffCmsWidgetName]["SubheaderText"],
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -536,7 +536,7 @@ describe("time-slot-modal-question.vue Duration", () => {
|
|||
});
|
||||
//Assert
|
||||
expect(wrapper.vm.durationTextBlockCopy).toEqual(
|
||||
mockCmsContent[dropoffCmsWidgetName]["SubheaderText"]
|
||||
mockCmsContent[dropoffCmsWidgetName]["SubheaderText"],
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -568,7 +568,7 @@ describe("time-slot-modal-question.vue Duration", () => {
|
|||
|
||||
//Assert
|
||||
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
|
||||
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
|
||||
expect(wrapper.vm.durationTextBlockCopy).toEqual(
|
||||
mockCmsContent[cmsWidgetName]["SubheaderText"] + " 4 hours"
|
||||
mockCmsContent[cmsWidgetName]["SubheaderText"] + " 4 hours",
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ export default {
|
|||
const { errorMessage, handleChange, meta, validate, errors } = useField(
|
||||
componentId,
|
||||
props.validationRules,
|
||||
fieldOptions
|
||||
fieldOptions,
|
||||
);
|
||||
|
||||
return {
|
||||
|
|
@ -162,7 +162,7 @@ export default {
|
|||
return null;
|
||||
} else if (this.appointmentType === AppointmentTypeStrings.MOBILE) {
|
||||
appointmentTypeCmsWidgetName = this.selectedRouteCode?.includes(
|
||||
PREMIUM_TIME_SLOT_ID_FLAG
|
||||
PREMIUM_TIME_SLOT_ID_FLAG,
|
||||
)
|
||||
? this.mobilePremiumCmsWidgetName
|
||||
: this.mobileCmsWidgetName;
|
||||
|
|
@ -173,44 +173,44 @@ export default {
|
|||
appointmentTypeCmsWidgetName =
|
||||
this.getRelevantDropOffCmsWidgetNameForSelectedTimeSlot(
|
||||
this.selectedRouteCode,
|
||||
true
|
||||
true,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return this.getCmsContent(
|
||||
appointmentTypeCmsWidgetName,
|
||||
cmsWidgetFieldMappings.SUPPLEMENTAL_INFORMATION
|
||||
cmsWidgetFieldMappings.SUPPLEMENTAL_INFORMATION,
|
||||
);
|
||||
},
|
||||
footerCloseButtonText() {
|
||||
return this.getCmsContent(
|
||||
this.cmsWidgetName,
|
||||
cmsWidgetFieldMappings.MODAL_CLOSE_BUTTON
|
||||
cmsWidgetFieldMappings.MODAL_CLOSE_BUTTON,
|
||||
);
|
||||
},
|
||||
premiumAppointmentButtonText() {
|
||||
return this.getCmsContent(
|
||||
this.mobilePremiumCmsWidgetName,
|
||||
cmsWidgetFieldMappings.TIME_SLOT_BUTTON
|
||||
cmsWidgetFieldMappings.TIME_SLOT_BUTTON,
|
||||
);
|
||||
},
|
||||
dropoffButtonText() {
|
||||
return this.getCmsContent(
|
||||
this.dropoffCmsWidgetName,
|
||||
cmsWidgetFieldMappings.TIME_SLOT_BUTTON
|
||||
cmsWidgetFieldMappings.TIME_SLOT_BUTTON,
|
||||
);
|
||||
},
|
||||
sameDayDropoffButtonText() {
|
||||
return this.getCmsContent(
|
||||
this.sameDayDropOffCmsWidgetName,
|
||||
cmsWidgetFieldMappings.TIME_SLOT_BUTTON
|
||||
cmsWidgetFieldMappings.TIME_SLOT_BUTTON,
|
||||
);
|
||||
},
|
||||
overnightDropoffButtonText() {
|
||||
return this.getCmsContent(
|
||||
this.overnightDropOffCmsWidgetName,
|
||||
cmsWidgetFieldMappings.TIME_SLOT_BUTTON
|
||||
cmsWidgetFieldMappings.TIME_SLOT_BUTTON,
|
||||
);
|
||||
},
|
||||
dropoffDisclaimerText() {
|
||||
|
|
@ -219,13 +219,13 @@ export default {
|
|||
sameDayDropOffDisclaimerText() {
|
||||
return this.getCmsContent(
|
||||
this.sameDayDropOffCmsWidgetName,
|
||||
cmsWidgetFieldMappings.DISCLAIMER
|
||||
cmsWidgetFieldMappings.DISCLAIMER,
|
||||
);
|
||||
},
|
||||
overnightDropOffDisclaimerText() {
|
||||
return this.getCmsContent(
|
||||
this.overnightDropOffCmsWidgetName,
|
||||
cmsWidgetFieldMappings.DISCLAIMER
|
||||
cmsWidgetFieldMappings.DISCLAIMER,
|
||||
);
|
||||
},
|
||||
disclaimerTextBlockCopy() {
|
||||
|
|
@ -251,24 +251,24 @@ export default {
|
|||
sameDayDropoffDurationText() {
|
||||
return this.getCmsContent(
|
||||
this.sameDayDropOffCmsWidgetName,
|
||||
cmsWidgetFieldMappings.DURATION
|
||||
cmsWidgetFieldMappings.DURATION,
|
||||
);
|
||||
},
|
||||
overnightDropoffDurationText() {
|
||||
return this.getCmsContent(
|
||||
this.overnightDropOffCmsWidgetName,
|
||||
cmsWidgetFieldMappings.DURATION
|
||||
cmsWidgetFieldMappings.DURATION,
|
||||
);
|
||||
},
|
||||
inshopDurationText() {
|
||||
const inshopDurationTextWithoutTime = this.getCmsContent(
|
||||
this.cmsWidgetName,
|
||||
cmsWidgetFieldMappings.DURATION
|
||||
cmsWidgetFieldMappings.DURATION,
|
||||
);
|
||||
|
||||
const inshopDurationTime = getDisplayTextForDurationLength(
|
||||
this.estimatedServiceMinutesMinimum,
|
||||
this.estimatedServiceMinutesMaximum
|
||||
this.estimatedServiceMinutesMaximum,
|
||||
);
|
||||
|
||||
return `${inshopDurationTextWithoutTime} ${inshopDurationTime}`;
|
||||
|
|
@ -322,7 +322,7 @@ export default {
|
|||
|
||||
if (this.appointmentType === AppointmentTypeStrings.DROP_OFF) {
|
||||
return this.getAvailableTimeSlotsForDropOff(
|
||||
this.timeSlotsForSelectedDate.timeSlots
|
||||
this.timeSlotsForSelectedDate.timeSlots,
|
||||
);
|
||||
} else if (this.appointmentType === AppointmentTypeStrings.MOBILE) {
|
||||
return this.getAvailableTimeSlotsForMobile(this.timeSlotsForSelectedDate.timeSlots);
|
||||
|
|
@ -349,13 +349,13 @@ export default {
|
|||
async setSelectedTimeSlot() {
|
||||
this.$emit(
|
||||
"update:modelValue",
|
||||
this.getSelectedTimeSlotInfoObject(this.selectedRouteCode)
|
||||
this.getSelectedTimeSlotInfoObject(this.selectedRouteCode),
|
||||
);
|
||||
this.$emit("TimeSlotSelected");
|
||||
},
|
||||
getRelevantDropOffCmsWidgetNameForSelectedTimeSlot(
|
||||
selectedRouteCode,
|
||||
isSameDayRelevant = false
|
||||
isSameDayRelevant = false,
|
||||
) {
|
||||
if (selectedRouteCode.includes(RouteCodeFlags.OVERNIGHT_DROP_OFF)) {
|
||||
return this.overnightDropOffCmsWidgetName;
|
||||
|
|
@ -396,7 +396,7 @@ export default {
|
|||
getAvailableTimeSlotsForMobile(timeSlotsForSelectedDate) {
|
||||
const availableTimeSlots = timeSlotsForSelectedDate.map((timeSlot) => {
|
||||
const readableTime = `${militaryToTwelveHourTime(
|
||||
timeSlot.startTime
|
||||
timeSlot.startTime,
|
||||
)} - ${militaryToTwelveHourTime(timeSlot.endTime)}`;
|
||||
return {
|
||||
value: timeSlot.id,
|
||||
|
|
@ -409,7 +409,7 @@ export default {
|
|||
this.premiumAppointmentFee?.partType === PREMIUM_FEE_PART_TYPE;
|
||||
if (isPremiumTimeSlot && hasPremiumPartAvailable) {
|
||||
availableTimeSlots.unshift(
|
||||
this.getPremiumAppointmentTimeSlot(timeSlotsForSelectedDate[0])
|
||||
this.getPremiumAppointmentTimeSlot(timeSlotsForSelectedDate[0]),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -437,7 +437,7 @@ export default {
|
|||
|
||||
if (this.modelValue?.isPremiumAppointment) {
|
||||
selectedRouteCode = this.addPremiumFlagToInput(
|
||||
this.modelValue?.timeSlot?.routeCode
|
||||
this.modelValue?.timeSlot?.routeCode,
|
||||
);
|
||||
} else {
|
||||
selectedRouteCode = this.modelValue?.timeSlot?.routeCode;
|
||||
|
|
@ -464,7 +464,7 @@ export default {
|
|||
}
|
||||
|
||||
const timeSlot = this.timeSlotsForSelectedDate?.timeSlots?.find(
|
||||
(timeSlot) => timeSlot.id == routeCode
|
||||
(timeSlot) => timeSlot.id == routeCode,
|
||||
);
|
||||
|
||||
if (timeSlot) {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ export class ProviderAddress {
|
|||
city = null,
|
||||
state = null,
|
||||
zipCode = null,
|
||||
zipCodeCtu = null
|
||||
zipCodeCtu = null,
|
||||
) {
|
||||
this.streetAddress = streetAddress;
|
||||
this.city = city;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ export async function getPricedMobileFeePart(serviceZipCode, pageNameToLog) {
|
|||
storeActions.GET_MOBILE_FEE_PART,
|
||||
null,
|
||||
pageNameToLog,
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
if (
|
||||
|
|
@ -33,7 +33,7 @@ export async function getPricedMobileFeePart(serviceZipCode, pageNameToLog) {
|
|||
serviceZipCodeCtu: zipCodeData.zipCodeCtu,
|
||||
},
|
||||
pageNameToLog,
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
return Promise.resolve(pricingResults[0]);
|
||||
|
|
@ -48,7 +48,7 @@ export async function getServiceabilityDetails(serviceZipCode, lineItems, pageNa
|
|||
lineItems: lineItems,
|
||||
},
|
||||
pageNameToLog,
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
return Promise.resolve(serviceabilityDetails);
|
||||
|
|
@ -60,7 +60,7 @@ export async function getShopProviderData(serviceZipCode) {
|
|||
{
|
||||
serviceZipCode: serviceZipCode,
|
||||
},
|
||||
"service-location"
|
||||
"service-location",
|
||||
);
|
||||
|
||||
return Promise.resolve(shopProviderData);
|
||||
|
|
@ -70,7 +70,7 @@ export async function getAvailabilityRating(
|
|||
startDate,
|
||||
endDate,
|
||||
shopAppointmentType,
|
||||
providerNumber
|
||||
providerNumber,
|
||||
) {
|
||||
// For a given shop provider number and date range, get the appointment time slots available
|
||||
const shopTimeSlots = await baseMixin.methods.dispatchStoreActionWithLogging(
|
||||
|
|
@ -82,7 +82,7 @@ export async function getAvailabilityRating(
|
|||
shopAppointmentType: shopAppointmentType,
|
||||
},
|
||||
"service-location",
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
const numberOfDaysToEvaluate = 2;
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ describe("service-location-helper.js", () => {
|
|||
serviceZipCode,
|
||||
damageType,
|
||||
parentAccountNumber,
|
||||
billToAccountNumber
|
||||
billToAccountNumber,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -283,7 +283,7 @@ describe("service-location-helper.js", () => {
|
|||
serviceZipCode,
|
||||
damageType,
|
||||
parentAccountNumber,
|
||||
billToAccountNumber
|
||||
billToAccountNumber,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -321,7 +321,7 @@ describe("service-location-helper.js", () => {
|
|||
"2023-06-30",
|
||||
"2023-07-06",
|
||||
"Inshop",
|
||||
providerNumber
|
||||
providerNumber,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -337,7 +337,7 @@ describe("service-location-helper.js", () => {
|
|||
"2023-06-30",
|
||||
"2023-07-06",
|
||||
"Inshop",
|
||||
providerNumber
|
||||
providerNumber,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ jest.mock(
|
|||
getServiceabilityDetails: jest.fn((mockServiceZipCode) => {
|
||||
return mockGetServiceabilityDetails(mockServiceZipCode);
|
||||
}),
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
describe("mobile-location-modal-questions.vue", () => {
|
||||
|
|
@ -156,7 +156,7 @@ describe("mobile-location-modal-questions.vue", () => {
|
|||
// Assert
|
||||
expect(wrapper.vm.internalModel.addressQuestions.streetAddress).toEqual("555 Some St");
|
||||
expect(wrapper.vm.internalModel.addressQuestions.apartmentNumberOrBusinessName).toEqual(
|
||||
"Apt 1"
|
||||
"Apt 1",
|
||||
);
|
||||
expect(wrapper.vm.internalModel.addressQuestions.city).toEqual("Funkytown");
|
||||
expect(wrapper.vm.internalModel.addressQuestions.state).toEqual("OH");
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ export default {
|
|||
const { errorMessage, handleChange, meta, validate, errors } = useField(
|
||||
componentId,
|
||||
props.validationRules,
|
||||
fieldOptions
|
||||
fieldOptions,
|
||||
);
|
||||
|
||||
return {
|
||||
|
|
@ -242,7 +242,7 @@ export default {
|
|||
// Validate the Zip Code
|
||||
const zipCodeData = await this.getZipCodeData(
|
||||
this.internalModel.addressQuestions.zipCode,
|
||||
"service-location"
|
||||
"service-location",
|
||||
);
|
||||
|
||||
if (!zipCodeData.isValid) {
|
||||
|
|
@ -256,14 +256,14 @@ export default {
|
|||
const serviceZipCode = this.internalModel.addressQuestions.zipCode;
|
||||
const mobileFeePart = await getPricedMobileFeePart(
|
||||
serviceZipCode,
|
||||
"service-location"
|
||||
"service-location",
|
||||
);
|
||||
|
||||
// retrieve serviceability details
|
||||
const serviceabilityDetails = await getServiceabilityDetails(
|
||||
serviceZipCode,
|
||||
null,
|
||||
"service-location"
|
||||
"service-location",
|
||||
);
|
||||
|
||||
// update content related to service zip code
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ jest.mock(
|
|||
getShopProviderData: jest.fn((mockServiceZipCode) => {
|
||||
return mockGetShopProviderData(mockServiceZipCode);
|
||||
}),
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
jest.spyOn(baseMixin.methods, "getZipCodeData").mockImplementation((serviceZipCode) => {
|
||||
|
|
@ -221,7 +221,7 @@ describe("service-location.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "serviceLocation" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -458,7 +458,7 @@ describe("service-location.vue", () => {
|
|||
// Act
|
||||
mobileLocationQuestionsComponent.vm.$emit(
|
||||
"update:modelValue",
|
||||
newMobileLocationQuestions
|
||||
newMobileLocationQuestions,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -527,7 +527,7 @@ describe("service-location.vue", () => {
|
|||
// Act
|
||||
mobileLocationQuestionsComponent.vm.$emit(
|
||||
"update:modelValue",
|
||||
newMobileLocationQuestions
|
||||
newMobileLocationQuestions,
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -596,7 +596,7 @@ describe("service-location.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "serviceLocation" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -623,7 +623,7 @@ describe("service-location.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "serviceLocation" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -650,7 +650,7 @@ describe("service-location.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "serviceLocation" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -677,7 +677,7 @@ describe("service-location.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "serviceLocation" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -704,7 +704,7 @@ describe("service-location.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "serviceLocation" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -732,7 +732,7 @@ describe("service-location.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "serviceLocation" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -760,7 +760,7 @@ describe("service-location.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "serviceLocation" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -788,7 +788,7 @@ describe("service-location.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "serviceLocation" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -816,7 +816,7 @@ describe("service-location.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "serviceLocation" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -844,7 +844,7 @@ describe("service-location.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "serviceLocation" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -872,7 +872,7 @@ describe("service-location.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "serviceLocation" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -900,7 +900,7 @@ describe("service-location.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "serviceLocation" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -928,7 +928,7 @@ describe("service-location.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "serviceLocation" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -956,7 +956,7 @@ describe("service-location.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "serviceLocation" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -984,7 +984,7 @@ describe("service-location.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "serviceLocation" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -1015,7 +1015,7 @@ describe("service-location.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "serviceLocation" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -1042,7 +1042,7 @@ describe("service-location.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "serviceLocation" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -1069,7 +1069,7 @@ describe("service-location.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "serviceLocation" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -1097,7 +1097,7 @@ describe("service-location.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "serviceLocation" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -1125,7 +1125,7 @@ describe("service-location.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "serviceLocation" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -1153,7 +1153,7 @@ describe("service-location.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "serviceLocation" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
// Assert
|
||||
|
|
@ -1183,7 +1183,7 @@ describe("service-location.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "serviceLocation" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
const alertComponent = wrapper.findComponent({ ref: "alertMobileOnly" });
|
||||
|
|
@ -1211,7 +1211,7 @@ describe("service-location.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "serviceLocation" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
const alertComponent = wrapper.findComponent({ ref: "alertMobileOnly" });
|
||||
|
|
@ -1239,7 +1239,7 @@ describe("service-location.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "serviceLocation" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
const alertComponent = wrapper.findComponent({ ref: "alertNoShops" });
|
||||
|
|
@ -1267,7 +1267,7 @@ describe("service-location.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "serviceLocation" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
const alertComponent = wrapper.findComponent({ ref: "alertNoShops" });
|
||||
|
|
@ -1295,7 +1295,7 @@ describe("service-location.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "serviceLocation" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
const alertComponent = wrapper.findComponent({ ref: "alertInshopOnly" });
|
||||
|
|
@ -1323,7 +1323,7 @@ describe("service-location.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "serviceLocation" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
const alertComponent = wrapper.findComponent({ ref: "alertInshopOnly" });
|
||||
|
|
@ -1351,7 +1351,7 @@ describe("service-location.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "serviceLocation" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
const alertInshopComponent = wrapper.findComponent({ ref: "alertInshopOnly" });
|
||||
|
|
@ -1381,7 +1381,7 @@ describe("service-location.vue", () => {
|
|||
wrapper.vm,
|
||||
{ query: { fmgPage: "serviceLocation" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
(c) => c(wrapper.vm),
|
||||
);
|
||||
|
||||
const alertComponent = wrapper.findComponent({ ref: "alertRecalNoMobile" });
|
||||
|
|
|
|||
|
|
@ -202,13 +202,13 @@ export default {
|
|||
const serviceZipCode = store.getters.order.serviceLocation.zipCode;
|
||||
const zipCodeDataPromise = baseMixin.methods.getZipCodeData(
|
||||
serviceZipCode,
|
||||
"service-location"
|
||||
"service-location",
|
||||
);
|
||||
|
||||
const serviceabilityDetailsPromise = getServiceabilityDetails(
|
||||
serviceZipCode,
|
||||
null,
|
||||
"service-location"
|
||||
"service-location",
|
||||
);
|
||||
|
||||
const mobileFeePartPromise = getPricedMobileFeePart(serviceZipCode, "service-location");
|
||||
|
|
@ -248,7 +248,7 @@ export default {
|
|||
resultMap.zipCodeData,
|
||||
resultMap.serviceabilityDetails,
|
||||
resultMap.mobileFeePart,
|
||||
resultMap.shopProviderData
|
||||
resultMap.shopProviderData,
|
||||
);
|
||||
});
|
||||
},
|
||||
|
|
@ -293,7 +293,7 @@ export default {
|
|||
getShopProviderData(newValue.addressQuestions.zipCode).then((result) => {
|
||||
this.shopProviderData = result.data;
|
||||
this.selectedProvider = new Provider(
|
||||
this.shopProviderData.mobileProviderNumber
|
||||
this.shopProviderData.mobileProviderNumber,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
|
@ -393,7 +393,7 @@ export default {
|
|||
":" +
|
||||
store.getters.order.policy.policyNumber +
|
||||
":" +
|
||||
store.getters.order.serviceLocation.zipCode
|
||||
store.getters.order.serviceLocation.zipCode,
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
|
@ -408,7 +408,7 @@ export default {
|
|||
"cash: servce-location invalid prereq:" +
|
||||
JSON.stringify(store.getters.lineItems.supportingItems) +
|
||||
":" +
|
||||
store.getters.order.serviceLocation.zipCode
|
||||
store.getters.order.serviceLocation.zipCode,
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
|
@ -503,7 +503,7 @@ export default {
|
|||
} else {
|
||||
this.$router.navigateWithoutSaving(
|
||||
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 (this.selectedAppointmentType == "Mobile") {
|
||||
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 (mobileFeeIndex >= 0) {
|
||||
|
|
@ -532,12 +532,12 @@ export default {
|
|||
this.dispatchStoreAction(
|
||||
this.storeActions.SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING,
|
||||
supportingItems,
|
||||
false
|
||||
false,
|
||||
);
|
||||
} else {
|
||||
// if it's not a mobile, then make sure we remove any that may have been added
|
||||
const removeMobileFeeIndex = supportingItems?.findIndex(
|
||||
(item) => item.partType == MOBILE_FEE_PART_TYPE
|
||||
(item) => item.partType == MOBILE_FEE_PART_TYPE,
|
||||
);
|
||||
|
||||
if (removeMobileFeeIndex >= 0) {
|
||||
|
|
@ -545,7 +545,7 @@ export default {
|
|||
this.dispatchStoreAction(
|
||||
this.storeActions.SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING,
|
||||
supportingItems,
|
||||
false
|
||||
false,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -599,7 +599,7 @@ export default {
|
|||
},
|
||||
},
|
||||
},
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
this.updateAndSaveSupportingItems();
|
||||
|
|
@ -617,7 +617,7 @@ export default {
|
|||
this.shopProviderData = result.data;
|
||||
if (this.selectedAppointmentType === "Mobile") {
|
||||
this.selectedProvider = new Provider(
|
||||
this.shopProviderData.mobileProviderNumber
|
||||
this.shopProviderData.mobileProviderNumber,
|
||||
);
|
||||
} else {
|
||||
this.selectedProvider = new Provider();
|
||||
|
|
@ -630,7 +630,7 @@ export default {
|
|||
handler(newValue) {
|
||||
if (newValue === "Mobile") {
|
||||
this.selectedProvider = new Provider(
|
||||
this.shopProviderData.mobileProviderNumber
|
||||
this.shopProviderData.mobileProviderNumber,
|
||||
);
|
||||
} else {
|
||||
this.selectedProvider = new Provider();
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ jest.mock(
|
|||
getServiceabilityDetails: jest.fn((mockServiceZipCode) => {
|
||||
return mockGetServiceabilityDetails(mockServiceZipCode);
|
||||
}),
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
const linkWidgetName = "linkWidgetName";
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ export default {
|
|||
|
||||
const zipCodeData = await this.getZipCodeData(
|
||||
this.internalModel.zipCode,
|
||||
"service-location"
|
||||
"service-location",
|
||||
);
|
||||
|
||||
if (!zipCodeData.isValid) {
|
||||
|
|
@ -155,14 +155,14 @@ export default {
|
|||
const serviceZipCode = this.internalModel.zipCode;
|
||||
const mobileFeePart = await getPricedMobileFeePart(
|
||||
serviceZipCode,
|
||||
"service-location"
|
||||
"service-location",
|
||||
);
|
||||
|
||||
// retrieve serviceability details
|
||||
const serviceabilityDetails = await getServiceabilityDetails(
|
||||
serviceZipCode,
|
||||
null,
|
||||
"service-location"
|
||||
"service-location",
|
||||
);
|
||||
|
||||
// update content related to service zip code
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ export default {
|
|||
displayAvailabilityIndicators() {
|
||||
return experimentMixin.methods.hasSettingEqualTo(
|
||||
experimentSettings.DISPLAY_AVAILABILITY_INDICATORS,
|
||||
"true"
|
||||
"true",
|
||||
);
|
||||
},
|
||||
isLoaderDisplayed() {
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue