Merge pull request #1306 from Safelite/rlsmerge/2023.08.24-to-develop
Release Merge | 2023.08.24 to Develop
This commit is contained in:
commit
5fc65093dc
4 changed files with 29 additions and 128 deletions
|
|
@ -31,7 +31,8 @@ export async function getPageToRouteExistingOrderTo(toRoute = {}, existingHerita
|
|||
// Return that page, so that it can navigate like normal.
|
||||
if (
|
||||
toRoute.query[queryStrings.FMG_PAGE] !== undefined &&
|
||||
toRoute.query[queryStrings.FMG_PAGE] !== fmgPageValues.QUOTE &&
|
||||
toRoute.query[queryStrings.FMG_PAGE] !== fmgPageValues.SERVICE_LOCATION &&
|
||||
toRoute.query[queryStrings.FMG_PAGE] !== fmgPageValues.SCHEDULE &&
|
||||
!isVinRelatedPage(toRoute)
|
||||
) {
|
||||
return overrideYmmsDirectionIfNeeded(toRoute);
|
||||
|
|
@ -115,6 +116,8 @@ async function getLatestPageForRedirection() {
|
|||
fmgPageValues.CAPABILITY_QUESTIONS
|
||||
);
|
||||
const quoteComponent = await getLazyLoadedComponent(fmgPageValues.QUOTE);
|
||||
const serviceLocationComponent = await getLazyLoadedComponent(fmgPageValues.SERVICE_LOCATION);
|
||||
const scheduleComponent = await getLazyLoadedComponent(fmgPageValues.SCHEDULE);
|
||||
|
||||
const skipVin = await skipVinLookup();
|
||||
|
||||
|
|
@ -129,7 +132,13 @@ async function getLatestPageForRedirection() {
|
|||
} else if (!estimateComponent.methods.arePagePrerequisitesValid()) {
|
||||
return fmgPageValues.VEHICLE_DAMAGE;
|
||||
} else {
|
||||
if (quoteComponent.methods.arePagePrerequisitesValid()) {
|
||||
if (scheduleComponent.methods.arePagePrerequisitesValid()) {
|
||||
return fmgPageValues.SCHEDULE;
|
||||
} else if (serviceLocationComponent.methods.arePagePrerequisitesValid()) {
|
||||
// This should be reversed 45+ days after the 8.24 release (Sunday October 8th, 2023)
|
||||
//return fmgPageValues.SERVICE_LOCATION;
|
||||
return fmgPageValues.QUOTE;
|
||||
} else if (quoteComponent.methods.arePagePrerequisitesValid()) {
|
||||
return fmgPageValues.QUOTE;
|
||||
} else if (capabilityQuestionsComponent.methods.arePagePrerequisitesValid()) {
|
||||
return fmgPageValues.CAPABILITY_QUESTIONS;
|
||||
|
|
|
|||
|
|
@ -135,64 +135,9 @@ describe("service-package-question.vue", () => {
|
|||
expectedModifiedAnswers[packageNameKey].tierThree
|
||||
);
|
||||
});
|
||||
it("should not select a default package if ANY glass part or supporting item has no prices", async () => {
|
||||
it("should not select a default package if isInsurance is null", async () => {
|
||||
// Note, only the first WSREPAIR item has a 0 for laborAmount, this is enough to not try and select a default package
|
||||
const wrapper = setupMocks({
|
||||
mountOptionsMockData: {
|
||||
store: {
|
||||
getters: {
|
||||
lineItems: {
|
||||
glassParts: [
|
||||
{
|
||||
partNumber: "FW02627GBYNOEE",
|
||||
description: "solar, 3rd visor band",
|
||||
color: "Green Tint, Blue Shade",
|
||||
partType: "WINDSHIELD",
|
||||
canSafeliteRecalibrate: false,
|
||||
requiresRecalibration: false,
|
||||
requiresCapabilityQuestions: false,
|
||||
recalibrationType: null,
|
||||
childParts: null,
|
||||
laborAmount: 5.0,
|
||||
},
|
||||
],
|
||||
supportingItems: [
|
||||
{
|
||||
partNumber: "SUPPLIES-REPAIR",
|
||||
description: null,
|
||||
partType: "REPAIR FEE",
|
||||
laborAmount: 5.0,
|
||||
},
|
||||
{
|
||||
partNumber: "WSREPAIR",
|
||||
description: null,
|
||||
partType: "REPAIR FEE",
|
||||
laborAmount: 0,
|
||||
},
|
||||
{
|
||||
partNumber: "WSREPAIR",
|
||||
description: null,
|
||||
partType: "REPAIR FEE",
|
||||
laborAmount: 5.0,
|
||||
},
|
||||
{
|
||||
partNumber: "WSREPAIR",
|
||||
description: null,
|
||||
partType: "REPAIR FEE",
|
||||
laborAmount: 5.0,
|
||||
},
|
||||
],
|
||||
},
|
||||
order: {
|
||||
damage: {
|
||||
isRepair: false,
|
||||
glassToReplace: [{ glassLocation: "Windshield" }],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
const wrapper = setupMocks({});
|
||||
|
||||
// Act
|
||||
wrapper.setProps({ availableLineItems: null });
|
||||
|
|
@ -202,59 +147,24 @@ describe("service-package-question.vue", () => {
|
|||
// Assert
|
||||
expect(wrapper.vm.selectedPackageName).toBe(null);
|
||||
});
|
||||
it("should select a default package if ALL glass parts and supporting items have prices", async () => {
|
||||
it("should select a default package if isInsurance is NOT null", async () => {
|
||||
const wrapper = setupMocks({
|
||||
mountOptionsMockData: {
|
||||
store: {
|
||||
getters: {
|
||||
lineItems: {
|
||||
glassParts: [
|
||||
{
|
||||
partNumber: "FW02627GBYNOEE",
|
||||
description: "solar, 3rd visor band",
|
||||
color: "Green Tint, Blue Shade",
|
||||
partType: "WINDSHIELD",
|
||||
canSafeliteRecalibrate: false,
|
||||
requiresRecalibration: false,
|
||||
requiresCapabilityQuestions: false,
|
||||
recalibrationType: null,
|
||||
childParts: null,
|
||||
laborAmount: 5.0,
|
||||
},
|
||||
],
|
||||
supportingItems: [
|
||||
{
|
||||
partNumber: "SUPPLIES-REPAIR",
|
||||
description: null,
|
||||
partType: "REPAIR FEE",
|
||||
laborAmount: 5.0,
|
||||
},
|
||||
{
|
||||
partNumber: "WSREPAIR",
|
||||
description: null,
|
||||
partType: "REPAIR FEE",
|
||||
laborAmount: 5.0,
|
||||
},
|
||||
{
|
||||
partNumber: "WSREPAIR",
|
||||
description: null,
|
||||
partType: "REPAIR FEE",
|
||||
laborAmount: 5.0,
|
||||
},
|
||||
{
|
||||
partNumber: "WSREPAIR",
|
||||
description: null,
|
||||
partType: "REPAIR FEE",
|
||||
laborAmount: 5.0,
|
||||
},
|
||||
],
|
||||
},
|
||||
order: {
|
||||
damage: {
|
||||
isRepair: false,
|
||||
glassToReplace: [{ glassLocation: "Windshield" }],
|
||||
},
|
||||
},
|
||||
lineItems: {
|
||||
vaps: [],
|
||||
},
|
||||
hasAnyNonWindshieldGlassParts: false,
|
||||
payment: {
|
||||
isInsurance: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -329,6 +239,9 @@ describe("service-package-question.vue", () => {
|
|||
glassToReplace: [{ glassLocation: "Windshield" }],
|
||||
},
|
||||
},
|
||||
payment: {
|
||||
isInsurance: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -758,6 +671,9 @@ function setupMocks({ mountOptionsMockData, props = mockProps }) {
|
|||
},
|
||||
},
|
||||
hasAnyNonWindshieldGlassParts: false,
|
||||
payment: {
|
||||
isInsurance: null,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ export default {
|
|||
},
|
||||
watch: {
|
||||
availableLineItems() {
|
||||
if (this.allGlassPartsAndSupportingItemsHavePrices(this.$store.getters.lineItems)) {
|
||||
if (this.$store.getters.payment.isInsurance != null) {
|
||||
this.selectDefaultPackage();
|
||||
}
|
||||
},
|
||||
|
|
@ -196,30 +196,6 @@ export default {
|
|||
vapsFromStore
|
||||
);
|
||||
},
|
||||
allGlassPartsAndSupportingItemsHavePrices(lineItems) {
|
||||
if (lineItems?.glassParts) {
|
||||
for (let i = 0; i < lineItems.glassParts.length; i++) {
|
||||
if (this.priceIsNullOrZero(lineItems.glassParts[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (lineItems?.supportingItems) {
|
||||
for (let i = 0; i < lineItems.supportingItems.length; i++) {
|
||||
if (this.priceIsNullOrZero(lineItems.supportingItems[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
},
|
||||
priceIsNullOrZero(lineItem) {
|
||||
return (
|
||||
(lineItem.kitPrice == null || lineItem.kitPrice == 0) &&
|
||||
(lineItem.laborAmount == null || lineItem.laborAmount == 0) &&
|
||||
(lineItem.sellingPrice == null || lineItem.sellingPrice == 0)
|
||||
);
|
||||
},
|
||||
getVapsLineItemsForSelectedPackage(packageName) {
|
||||
const packageContentTypes = getPackageContents(
|
||||
this.glassToReplace,
|
||||
|
|
|
|||
|
|
@ -1450,7 +1450,7 @@ export const actions = {
|
|||
InsuranceCoverage: {
|
||||
isVerified: order.payment.insuranceCoverage.isVerified ?? false,
|
||||
},
|
||||
isInsurance: order.payment.isInsurance ?? false,
|
||||
isInsurance: order.payment.isInsurance,
|
||||
parentAccountNumber: order.payment.parentAccountNumber,
|
||||
},
|
||||
serviceLocation: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue