commit
39f9fb9cc4
26 changed files with 244 additions and 277 deletions
|
|
@ -3,7 +3,7 @@ const cartItemTypes = {
|
||||||
REAR_WIPERS: "REAR WIPERS",
|
REAR_WIPERS: "REAR WIPERS",
|
||||||
SUPPORTING_ITEMS: "SUPPORTING ITEMS",
|
SUPPORTING_ITEMS: "SUPPORTING ITEMS",
|
||||||
GLASS_PARTS: "GLASS PARTS",
|
GLASS_PARTS: "GLASS PARTS",
|
||||||
RAIN_DEFENSE: "RAIN DEFENSE",
|
RAIN_REPEL: "RAIN REPEL",
|
||||||
RECYCLE_FEE: "RECYCLE FEE",
|
RECYCLE_FEE: "RECYCLE FEE",
|
||||||
REPLACE_FEE: "REPLACE FEE",
|
REPLACE_FEE: "REPLACE FEE",
|
||||||
MOBILE_FEE: "MOBILE FEE",
|
MOBILE_FEE: "MOBILE FEE",
|
||||||
|
|
|
||||||
|
|
@ -64,8 +64,8 @@ const endpoints = {
|
||||||
url: "/parts/api/v1/parts/wipers",
|
url: "/parts/api/v1/parts/wipers",
|
||||||
method: "GET",
|
method: "GET",
|
||||||
},
|
},
|
||||||
GetRainDefense: {
|
GetRainRepel: {
|
||||||
url: "/parts/api/v1/parts/rain-defense",
|
url: "/parts/api/v1/parts/rain-repel",
|
||||||
method: "GET",
|
method: "GET",
|
||||||
},
|
},
|
||||||
GetMobileFeePart: {
|
GetMobileFeePart: {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
const partTypeStrings = {
|
const partTypeStrings = {
|
||||||
FRONT_WIPER: "FRONT WIPER",
|
FRONT_WIPER: "FRONT WIPER",
|
||||||
REAR_WIPER: "REAR WIPER",
|
REAR_WIPER: "REAR WIPER",
|
||||||
RAIN_DEFENSE: "RAIN DEFENSE",
|
RAIN_REPEL: "RAIN REPEL",
|
||||||
ADAS_RECALIBRATION: "ADAS RECALIBRATION",
|
ADAS_RECALIBRATION: "ADAS RECALIBRATION",
|
||||||
RECALIBRATION: "RECALIBRATION",
|
RECALIBRATION: "RECALIBRATION",
|
||||||
REPLACE_FEE: "REPLACE FEE",
|
REPLACE_FEE: "REPLACE FEE",
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ const storeActions = {
|
||||||
GET_PARTS_OR_QUESTIONS: "getPartsOrQuestions",
|
GET_PARTS_OR_QUESTIONS: "getPartsOrQuestions",
|
||||||
GET_PARTS: "getParts",
|
GET_PARTS: "getParts",
|
||||||
GET_WIPERS: "getWipers",
|
GET_WIPERS: "getWipers",
|
||||||
GET_RAIN_DEFENSE: "getRainDefense",
|
GET_RAIN_REPEL: "getRainRepel",
|
||||||
GET_SUPPORTING_ITEMS: "getSupportingItems",
|
GET_SUPPORTING_ITEMS: "getSupportingItems",
|
||||||
GET_CAPABILITY_QUESTIONS: "getCapabilityQuestions",
|
GET_CAPABILITY_QUESTIONS: "getCapabilityQuestions",
|
||||||
SUBMIT_DONATION_PART_TO_SV2: "submitDonationPartToSV2",
|
SUBMIT_DONATION_PART_TO_SV2: "submitDonationPartToSV2",
|
||||||
|
|
|
||||||
|
|
@ -120,20 +120,20 @@ describe("cart.vue", () => {
|
||||||
expect(found).toBe(true);
|
expect(found).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("if there is Rain Defense on the order, a rain defense cart item should be added to the cart", () => {
|
test("if there is Rain Repel on the order, a rain repel cart item should be added to the cart", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const lineItems = {
|
const lineItems = {
|
||||||
glassParts: [],
|
glassParts: [],
|
||||||
supportingItems: [],
|
supportingItems: [],
|
||||||
vaps: [
|
vaps: [
|
||||||
{
|
{
|
||||||
cartItemType: "RAIN DEFENSE",
|
cartItemType: "RAIN REPEL",
|
||||||
description: null,
|
description: null,
|
||||||
kitPrice: 0,
|
kitPrice: 0,
|
||||||
laborAmount: 0,
|
laborAmount: 0,
|
||||||
listPrice: "44.99",
|
listPrice: "44.99",
|
||||||
partNumber: "RAIN DEFENSE",
|
partNumber: "RAIN REPEL",
|
||||||
partType: "RAIN DEFENSE",
|
partType: "RAIN REPEL",
|
||||||
salesTax: 3.37,
|
salesTax: 3.37,
|
||||||
sellingPrice: 44.99,
|
sellingPrice: 44.99,
|
||||||
},
|
},
|
||||||
|
|
@ -152,13 +152,13 @@ describe("cart.vue", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(wrapper.vm.rainDefenseCartItem).not.toBeNull();
|
expect(wrapper.vm.rainRepelCartItem).not.toBeNull();
|
||||||
expect(wrapper.vm.rainDefenseCartItem.subTotal).toEqual(44.99);
|
expect(wrapper.vm.rainRepelCartItem.subTotal).toEqual(44.99);
|
||||||
expect(wrapper.vm.rainDefenseCartItem.salesTax).toEqual(3.37);
|
expect(wrapper.vm.rainRepelCartItem.salesTax).toEqual(3.37);
|
||||||
|
|
||||||
const found =
|
const found =
|
||||||
wrapper.vm.cartItems.findIndex(
|
wrapper.vm.cartItems.findIndex(
|
||||||
(cartItem) => cartItem == wrapper.vm.rainDefenseCartItem
|
(cartItem) => cartItem == wrapper.vm.rainRepelCartItem
|
||||||
) >= 0;
|
) >= 0;
|
||||||
expect(found).toBe(true);
|
expect(found).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -444,8 +444,8 @@ export default {
|
||||||
cartItems.push(this.rearWipersCartItem);
|
cartItems.push(this.rearWipersCartItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.rainDefenseCartItem) {
|
if (this.rainRepelCartItem) {
|
||||||
cartItems.push(this.rainDefenseCartItem);
|
cartItems.push(this.rainRepelCartItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.glassPartCartItems) {
|
if (this.glassPartCartItems) {
|
||||||
|
|
@ -701,40 +701,40 @@ export default {
|
||||||
|
|
||||||
return cartItem;
|
return cartItem;
|
||||||
},
|
},
|
||||||
rainDefenseCartItemName() {
|
rainRepelCartItemName() {
|
||||||
return this.getCmsContentForVapsType(partTypeStrings.RAIN_DEFENSE);
|
return this.getCmsContentForVapsType(partTypeStrings.RAIN_REPEL);
|
||||||
},
|
},
|
||||||
rainDefenseCartItem() {
|
rainRepelCartItem() {
|
||||||
let cartItem = null;
|
let cartItem = null;
|
||||||
|
|
||||||
const rainDefenseLineItem = this.vaps.find(
|
const rainRepelLineItem = this.vaps.find(
|
||||||
(vapsLineItem) => vapsLineItem.partType == partTypeStrings.RAIN_DEFENSE
|
(vapsLineItem) => vapsLineItem.partType == partTypeStrings.RAIN_REPEL
|
||||||
);
|
);
|
||||||
|
|
||||||
if (rainDefenseLineItem) {
|
if (rainRepelLineItem) {
|
||||||
cartItem = {
|
cartItem = {
|
||||||
name: this.getCmsContentForVapsType(partTypeStrings.RAIN_DEFENSE),
|
name: this.getCmsContentForVapsType(partTypeStrings.RAIN_REPEL),
|
||||||
category: cartItemCategories.VAPS,
|
category: cartItemCategories.VAPS,
|
||||||
cartItemType: cartItemTypes.RAIN_DEFENSE,
|
cartItemType: cartItemTypes.RAIN_REPEL,
|
||||||
isDisplayed: true,
|
isDisplayed: true,
|
||||||
isRemovable: true,
|
isRemovable: true,
|
||||||
subTotal: 0,
|
subTotal: 0,
|
||||||
salesTax: 0,
|
salesTax: 0,
|
||||||
lineItems: [],
|
lineItems: [],
|
||||||
isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes(
|
isCoveredByInsurance: cartItemTypesCoveredByInsurance.includes(
|
||||||
cartItemTypes.RAIN_DEFENSE
|
cartItemTypes.RAIN_REPEL
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
rainDefenseLineItem.cartItemType = cartItem.cartItemType;
|
rainRepelLineItem.cartItemType = cartItem.cartItemType;
|
||||||
cartItem.lineItems.push(rainDefenseLineItem);
|
cartItem.lineItems.push(rainRepelLineItem);
|
||||||
|
|
||||||
cartItem.subTotal +=
|
cartItem.subTotal +=
|
||||||
(rainDefenseLineItem.kitPrice ?? 0) +
|
(rainRepelLineItem.kitPrice ?? 0) +
|
||||||
(rainDefenseLineItem.laborAmount ?? 0) +
|
(rainRepelLineItem.laborAmount ?? 0) +
|
||||||
(rainDefenseLineItem.sellingPrice ?? 0);
|
(rainRepelLineItem.sellingPrice ?? 0);
|
||||||
|
|
||||||
cartItem.salesTax += rainDefenseLineItem.salesTax ?? 0;
|
cartItem.salesTax += rainRepelLineItem.salesTax ?? 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return cartItem;
|
return cartItem;
|
||||||
|
|
|
||||||
|
|
@ -6,13 +6,13 @@ import baseMixin from "@/mixins/base-mixin.js";
|
||||||
|
|
||||||
export const promoPartNumberStrings = {
|
export const promoPartNumberStrings = {
|
||||||
WIPER_DISCOUNT_PART_NUMBER: "WIPER DISCOUNT",
|
WIPER_DISCOUNT_PART_NUMBER: "WIPER DISCOUNT",
|
||||||
RAIN_DEFENSE_DISCOUNT_PART_NUMBER: "DISC RAIN DEFEN",
|
RAIN_REPEL_DISCOUNT_PART_NUMBER: "DISC RAIN REPEL",
|
||||||
GLASS_DISCOUNT_PART_NUMBER: "DISCOUNT",
|
GLASS_DISCOUNT_PART_NUMBER: "DISCOUNT",
|
||||||
GLASS_CLEANER_DISCOUNT_PART_NUMBER: "DISC GLASS CLN",
|
GLASS_CLEANER_DISCOUNT_PART_NUMBER: "DISC GLASS CLN",
|
||||||
};
|
};
|
||||||
|
|
||||||
export const addableVapsPromoPartNumbers = [
|
export const addableVapsPromoPartNumbers = [
|
||||||
promoPartNumberStrings.RAIN_DEFENSE_DISCOUNT_PART_NUMBER,
|
promoPartNumberStrings.RAIN_REPEL_DISCOUNT_PART_NUMBER,
|
||||||
promoPartNumberStrings.WIPER_DISCOUNT_PART_NUMBER,
|
promoPartNumberStrings.WIPER_DISCOUNT_PART_NUMBER,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -75,9 +75,7 @@ export function getLineItemsThatMatchPromos(promos, availableLineItems) {
|
||||||
export function getAddableVapsFromAvailableLineItems(availableLineItems) {
|
export function getAddableVapsFromAvailableLineItems(availableLineItems) {
|
||||||
const addableVaps = [];
|
const addableVaps = [];
|
||||||
addableVaps.push(...findLineItemsWithPartType(partTypeStrings.FRONT_WIPER, availableLineItems));
|
addableVaps.push(...findLineItemsWithPartType(partTypeStrings.FRONT_WIPER, availableLineItems));
|
||||||
addableVaps.push(
|
addableVaps.push(...findLineItemsWithPartType(partTypeStrings.RAIN_REPEL, availableLineItems));
|
||||||
...findLineItemsWithPartType(partTypeStrings.RAIN_DEFENSE, availableLineItems)
|
|
||||||
);
|
|
||||||
return addableVaps;
|
return addableVaps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -88,7 +86,7 @@ export function removeVapsPromosFromPromoArray(promoArray) {
|
||||||
const filteredPromoArray = promoArray.filter((promo) => {
|
const filteredPromoArray = promoArray.filter((promo) => {
|
||||||
return (
|
return (
|
||||||
promo.partNumber != promoPartNumberStrings.WIPER_DISCOUNT_PART_NUMBER &&
|
promo.partNumber != promoPartNumberStrings.WIPER_DISCOUNT_PART_NUMBER &&
|
||||||
promo.partNumber != promoPartNumberStrings.RAIN_DEFENSE_DISCOUNT_PART_NUMBER &&
|
promo.partNumber != promoPartNumberStrings.RAIN_REPEL_DISCOUNT_PART_NUMBER &&
|
||||||
promo.partNumber != promoPartNumberStrings.GLASS_CLEANER_DISCOUNT_PART_NUMBER
|
promo.partNumber != promoPartNumberStrings.GLASS_CLEANER_DISCOUNT_PART_NUMBER
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -188,11 +188,11 @@ describe("promotions-helper.js", () => {
|
||||||
expect(nullAvailableLineItemsReturn).toEqual([]);
|
expect(nullAvailableLineItemsReturn).toEqual([]);
|
||||||
expect(emptyAvailableLineItemsReturn).toEqual([]);
|
expect(emptyAvailableLineItemsReturn).toEqual([]);
|
||||||
});
|
});
|
||||||
it("returns provided front wiper and rain defense items from availableLineItems", () => {
|
it("returns provided front wiper and rain repel items from availableLineItems", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const availableLineItemsWithFrontWipersAndRainDefense = [
|
const availableLineItemsWithFrontWipersAndRainRepel = [
|
||||||
{ partType: partTypeStrings.FRONT_WIPER },
|
{ partType: partTypeStrings.FRONT_WIPER },
|
||||||
{ partType: partTypeStrings.RAIN_DEFENSE },
|
{ partType: partTypeStrings.RAIN_REPEL },
|
||||||
{ partType: partTypeStrings.REAR_WIPER },
|
{ partType: partTypeStrings.REAR_WIPER },
|
||||||
{ partType: partTypeStrings.RECALIBRATION },
|
{ partType: partTypeStrings.RECALIBRATION },
|
||||||
{ partType: partTypeStrings.REPLACE_FEE },
|
{ partType: partTypeStrings.REPLACE_FEE },
|
||||||
|
|
@ -202,19 +202,19 @@ describe("promotions-helper.js", () => {
|
||||||
// Act
|
// Act
|
||||||
const addableVapsFromAvailableLineItems =
|
const addableVapsFromAvailableLineItems =
|
||||||
promotionsHelper.getAddableVapsFromAvailableLineItems(
|
promotionsHelper.getAddableVapsFromAvailableLineItems(
|
||||||
availableLineItemsWithFrontWipersAndRainDefense
|
availableLineItemsWithFrontWipersAndRainRepel
|
||||||
);
|
);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
const frontWiperParts = addableVapsFromAvailableLineItems.filter(
|
const frontWiperParts = addableVapsFromAvailableLineItems.filter(
|
||||||
(lineItem) => lineItem.partType == partTypeStrings.FRONT_WIPER
|
(lineItem) => lineItem.partType == partTypeStrings.FRONT_WIPER
|
||||||
);
|
);
|
||||||
const rainDefenseParts = addableVapsFromAvailableLineItems.filter(
|
const rainRepelParts = addableVapsFromAvailableLineItems.filter(
|
||||||
(lineItem) => lineItem.partType == partTypeStrings.RAIN_DEFENSE
|
(lineItem) => lineItem.partType == partTypeStrings.RAIN_REPEL
|
||||||
);
|
);
|
||||||
expect(addableVapsFromAvailableLineItems.length).toEqual(2);
|
expect(addableVapsFromAvailableLineItems.length).toEqual(2);
|
||||||
expect(frontWiperParts.length).toEqual(1);
|
expect(frontWiperParts.length).toEqual(1);
|
||||||
expect(rainDefenseParts.length).toEqual(1);
|
expect(rainRepelParts.length).toEqual(1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe("removeVapsPromosFromPromoArray", () => {
|
describe("removeVapsPromosFromPromoArray", () => {
|
||||||
|
|
@ -242,8 +242,7 @@ describe("promotions-helper.js", () => {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
partNumber:
|
partNumber:
|
||||||
promotionsHelper.promoPartNumberStrings
|
promotionsHelper.promoPartNumberStrings.RAIN_REPEL_DISCOUNT_PART_NUMBER,
|
||||||
.RAIN_DEFENSE_DISCOUNT_PART_NUMBER,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
partNumber:
|
partNumber:
|
||||||
|
|
|
||||||
|
|
@ -100,8 +100,8 @@ export function getPackageContents(glassToReplace, availableLineItems, isRepair,
|
||||||
vaps.push(partTypeStrings.REAR_WIPER);
|
vaps.push(partTypeStrings.REAR_WIPER);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shouldRainDefenseBeAvailable(glassToReplace, availableLineItems, isRepair, targetTier)) {
|
if (shouldRainRepelBeAvailable(glassToReplace, availableLineItems, isRepair, targetTier)) {
|
||||||
vaps.push(partTypeStrings.RAIN_DEFENSE);
|
vaps.push(partTypeStrings.RAIN_REPEL);
|
||||||
}
|
}
|
||||||
|
|
||||||
return vaps;
|
return vaps;
|
||||||
|
|
@ -160,7 +160,7 @@ export function shouldRearWipersBeAvailable(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function shouldRainDefenseBeAvailable(
|
export function shouldRainRepelBeAvailable(
|
||||||
glassToReplace,
|
glassToReplace,
|
||||||
availableLineItems,
|
availableLineItems,
|
||||||
isRepair,
|
isRepair,
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,9 @@ describe("service-package-helper.js", () => {
|
||||||
recalLineItem,
|
recalLineItem,
|
||||||
driverFrontWiperLineItem,
|
driverFrontWiperLineItem,
|
||||||
passengerFrontWiperLineItem,
|
passengerFrontWiperLineItem,
|
||||||
rainDefenseLineItem,
|
rainRepelLineItem,
|
||||||
];
|
];
|
||||||
const partType = partTypeStrings.RAIN_DEFENSE;
|
const partType = partTypeStrings.RAIN_REPEL;
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const result = servicePackageHelper.containsLineItemWithPartType(partType, lineItems);
|
const result = servicePackageHelper.containsLineItemWithPartType(partType, lineItems);
|
||||||
|
|
@ -28,7 +28,7 @@ describe("service-package-helper.js", () => {
|
||||||
recalLineItem,
|
recalLineItem,
|
||||||
driverFrontWiperLineItem,
|
driverFrontWiperLineItem,
|
||||||
passengerFrontWiperLineItem,
|
passengerFrontWiperLineItem,
|
||||||
rainDefenseLineItem,
|
rainRepelLineItem,
|
||||||
];
|
];
|
||||||
const partType = partTypeStrings.FRONT_WIPER;
|
const partType = partTypeStrings.FRONT_WIPER;
|
||||||
|
|
||||||
|
|
@ -46,7 +46,7 @@ describe("service-package-helper.js", () => {
|
||||||
driverFrontWiperLineItem,
|
driverFrontWiperLineItem,
|
||||||
passengerFrontWiperLineItem,
|
passengerFrontWiperLineItem,
|
||||||
];
|
];
|
||||||
const partType = partTypeStrings.RAIN_DEFENSE;
|
const partType = partTypeStrings.RAIN_REPEL;
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const result = servicePackageHelper.containsLineItemWithPartType(partType, lineItems);
|
const result = servicePackageHelper.containsLineItemWithPartType(partType, lineItems);
|
||||||
|
|
@ -58,7 +58,7 @@ describe("service-package-helper.js", () => {
|
||||||
it("Returns false with empty array", () => {
|
it("Returns false with empty array", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const lineItems = [];
|
const lineItems = [];
|
||||||
const partType = partTypeStrings.RAIN_DEFENSE;
|
const partType = partTypeStrings.RAIN_REPEL;
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const result = servicePackageHelper.containsLineItemWithPartType(partType, lineItems);
|
const result = servicePackageHelper.containsLineItemWithPartType(partType, lineItems);
|
||||||
|
|
@ -75,9 +75,9 @@ describe("service-package-helper.js", () => {
|
||||||
recalLineItem,
|
recalLineItem,
|
||||||
driverFrontWiperLineItem,
|
driverFrontWiperLineItem,
|
||||||
passengerFrontWiperLineItem,
|
passengerFrontWiperLineItem,
|
||||||
rainDefenseLineItem,
|
rainRepelLineItem,
|
||||||
];
|
];
|
||||||
const partType = partTypeStrings.RAIN_DEFENSE;
|
const partType = partTypeStrings.RAIN_REPEL;
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const result = servicePackageHelper.findLineItemsWithPartType(partType, lineItems);
|
const result = servicePackageHelper.findLineItemsWithPartType(partType, lineItems);
|
||||||
|
|
@ -94,7 +94,7 @@ describe("service-package-helper.js", () => {
|
||||||
passengerFrontWiperLineItem,
|
passengerFrontWiperLineItem,
|
||||||
driverFrontWiperLineItem,
|
driverFrontWiperLineItem,
|
||||||
];
|
];
|
||||||
const partType = partTypeStrings.RAIN_DEFENSE;
|
const partType = partTypeStrings.RAIN_REPEL;
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const result = servicePackageHelper.findLineItemsWithPartType(partType, lineItems);
|
const result = servicePackageHelper.findLineItemsWithPartType(partType, lineItems);
|
||||||
|
|
@ -109,7 +109,7 @@ describe("service-package-helper.js", () => {
|
||||||
recalLineItem,
|
recalLineItem,
|
||||||
driverFrontWiperLineItem,
|
driverFrontWiperLineItem,
|
||||||
passengerFrontWiperLineItem,
|
passengerFrontWiperLineItem,
|
||||||
rainDefenseLineItem,
|
rainRepelLineItem,
|
||||||
];
|
];
|
||||||
const partType = partTypeStrings.FRONT_WIPER;
|
const partType = partTypeStrings.FRONT_WIPER;
|
||||||
|
|
||||||
|
|
@ -129,16 +129,16 @@ describe("service-package-helper.js", () => {
|
||||||
recalLineItem,
|
recalLineItem,
|
||||||
driverFrontWiperLineItem,
|
driverFrontWiperLineItem,
|
||||||
passengerFrontWiperLineItem,
|
passengerFrontWiperLineItem,
|
||||||
rainDefenseLineItem,
|
rainRepelLineItem,
|
||||||
];
|
];
|
||||||
const partType = "rAin DEfenSe";
|
const partType = "rAin REpeL";
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const result = servicePackageHelper.findLineItemsWithPartType(partType, lineItems);
|
const result = servicePackageHelper.findLineItemsWithPartType(partType, lineItems);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(result.length).toBe(1);
|
expect(result.length).toBe(1);
|
||||||
expect(result[0].partType).toEqual(partTypeStrings.RAIN_DEFENSE);
|
expect(result[0].partType).toEqual(partTypeStrings.RAIN_REPEL);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -149,17 +149,17 @@ describe("service-package-helper.js", () => {
|
||||||
recalLineItem,
|
recalLineItem,
|
||||||
driverFrontWiperLineItem,
|
driverFrontWiperLineItem,
|
||||||
passengerFrontWiperLineItem,
|
passengerFrontWiperLineItem,
|
||||||
rainDefenseLineItem,
|
rainRepelLineItem,
|
||||||
];
|
];
|
||||||
|
|
||||||
const vapTypes = [partTypeStrings.RAIN_DEFENSE];
|
const vapTypes = [partTypeStrings.RAIN_REPEL];
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const result = servicePackageHelper.getVapsLineItems(lineItems, vapTypes);
|
const result = servicePackageHelper.getVapsLineItems(lineItems, vapTypes);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(result.length).toBe(1);
|
expect(result.length).toBe(1);
|
||||||
expect(result[0].partType).toEqual(partTypeStrings.RAIN_DEFENSE);
|
expect(result[0].partType).toEqual(partTypeStrings.RAIN_REPEL);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Returns all matching line items, when multiple match a single type", () => {
|
it("Returns all matching line items, when multiple match a single type", () => {
|
||||||
|
|
@ -168,7 +168,7 @@ describe("service-package-helper.js", () => {
|
||||||
recalLineItem,
|
recalLineItem,
|
||||||
driverFrontWiperLineItem,
|
driverFrontWiperLineItem,
|
||||||
passengerFrontWiperLineItem,
|
passengerFrontWiperLineItem,
|
||||||
rainDefenseLineItem,
|
rainRepelLineItem,
|
||||||
];
|
];
|
||||||
|
|
||||||
const vapTypes = [partTypeStrings.FRONT_WIPER];
|
const vapTypes = [partTypeStrings.FRONT_WIPER];
|
||||||
|
|
@ -185,7 +185,7 @@ describe("service-package-helper.js", () => {
|
||||||
|
|
||||||
it("Returns only line items in the given set", () => {
|
it("Returns only line items in the given set", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const lineItems = [recalLineItem, passengerFrontWiperLineItem, rainDefenseLineItem];
|
const lineItems = [recalLineItem, passengerFrontWiperLineItem, rainRepelLineItem];
|
||||||
|
|
||||||
const vapTypes = [partTypeStrings.FRONT_WIPER];
|
const vapTypes = [partTypeStrings.FRONT_WIPER];
|
||||||
|
|
||||||
|
|
@ -200,9 +200,9 @@ describe("service-package-helper.js", () => {
|
||||||
|
|
||||||
it("Returns all matching items when multiple vap types are requested", () => {
|
it("Returns all matching items when multiple vap types are requested", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const lineItems = [recalLineItem, passengerFrontWiperLineItem, rainDefenseLineItem];
|
const lineItems = [recalLineItem, passengerFrontWiperLineItem, rainRepelLineItem];
|
||||||
|
|
||||||
const vapTypes = [partTypeStrings.FRONT_WIPER, partTypeStrings.RAIN_DEFENSE];
|
const vapTypes = [partTypeStrings.FRONT_WIPER, partTypeStrings.RAIN_REPEL];
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const result = servicePackageHelper.getVapsLineItems(lineItems, vapTypes);
|
const result = servicePackageHelper.getVapsLineItems(lineItems, vapTypes);
|
||||||
|
|
@ -300,7 +300,7 @@ describe("service-package-helper.js", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const damageLocations = [sideGlass];
|
const damageLocations = [sideGlass];
|
||||||
|
|
||||||
const availableLineItems = [rainDefenseLineItem];
|
const availableLineItems = [rainRepelLineItem];
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const results = servicePackageHelper.getAvailablePackages(
|
const results = servicePackageHelper.getAvailablePackages(
|
||||||
|
|
@ -322,7 +322,7 @@ describe("service-package-helper.js", () => {
|
||||||
const availableLineItems = [
|
const availableLineItems = [
|
||||||
driverFrontWiperLineItem,
|
driverFrontWiperLineItem,
|
||||||
rearWiperLineItem,
|
rearWiperLineItem,
|
||||||
rainDefenseLineItem,
|
rainRepelLineItem,
|
||||||
];
|
];
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
|
|
@ -619,12 +619,12 @@ describe("service-package-helper.js", () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("shouldRainDefenseBeAvailable", () => {
|
describe("shouldRainRepelBeAvailable", () => {
|
||||||
it("Should generally be available only in tier 3", () => {
|
it("Should generally be available only in tier 3", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const damageLocations = [frontWindshieldGlass];
|
const damageLocations = [frontWindshieldGlass];
|
||||||
const availableLineItems = [
|
const availableLineItems = [
|
||||||
rainDefenseLineItem,
|
rainRepelLineItem,
|
||||||
driverFrontWiperLineItem,
|
driverFrontWiperLineItem,
|
||||||
rearWiperLineItem,
|
rearWiperLineItem,
|
||||||
recalLineItem,
|
recalLineItem,
|
||||||
|
|
@ -632,19 +632,19 @@ describe("service-package-helper.js", () => {
|
||||||
const isRepair = false;
|
const isRepair = false;
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const resultOne = servicePackageHelper.shouldRainDefenseBeAvailable(
|
const resultOne = servicePackageHelper.shouldRainRepelBeAvailable(
|
||||||
damageLocations,
|
damageLocations,
|
||||||
availableLineItems,
|
availableLineItems,
|
||||||
isRepair,
|
isRepair,
|
||||||
packageNames.TIER_ONE
|
packageNames.TIER_ONE
|
||||||
);
|
);
|
||||||
const resultTwo = servicePackageHelper.shouldRainDefenseBeAvailable(
|
const resultTwo = servicePackageHelper.shouldRainRepelBeAvailable(
|
||||||
damageLocations,
|
damageLocations,
|
||||||
availableLineItems,
|
availableLineItems,
|
||||||
isRepair,
|
isRepair,
|
||||||
packageNames.TIER_TWO
|
packageNames.TIER_TWO
|
||||||
);
|
);
|
||||||
const resultThree = servicePackageHelper.shouldRainDefenseBeAvailable(
|
const resultThree = servicePackageHelper.shouldRainRepelBeAvailable(
|
||||||
damageLocations,
|
damageLocations,
|
||||||
availableLineItems,
|
availableLineItems,
|
||||||
isRepair,
|
isRepair,
|
||||||
|
|
@ -662,7 +662,7 @@ describe("service-package-helper.js", () => {
|
||||||
// SPECIFICALLY: no front windshield
|
// SPECIFICALLY: no front windshield
|
||||||
const damageLocations = [rearWindshieldGlass];
|
const damageLocations = [rearWindshieldGlass];
|
||||||
const availableLineItems = [
|
const availableLineItems = [
|
||||||
rainDefenseLineItem,
|
rainRepelLineItem,
|
||||||
driverFrontWiperLineItem,
|
driverFrontWiperLineItem,
|
||||||
passengerFrontWiperLineItem,
|
passengerFrontWiperLineItem,
|
||||||
rearWiperLineItem,
|
rearWiperLineItem,
|
||||||
|
|
@ -671,7 +671,7 @@ describe("service-package-helper.js", () => {
|
||||||
const isRepair = false;
|
const isRepair = false;
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const result = servicePackageHelper.shouldRainDefenseBeAvailable(
|
const result = servicePackageHelper.shouldRainRepelBeAvailable(
|
||||||
damageLocations,
|
damageLocations,
|
||||||
availableLineItems,
|
availableLineItems,
|
||||||
isRepair,
|
isRepair,
|
||||||
|
|
@ -692,7 +692,7 @@ describe("service-package-helper.js", () => {
|
||||||
driverFrontWiperLineItem,
|
driverFrontWiperLineItem,
|
||||||
passengerFrontWiperLineItem,
|
passengerFrontWiperLineItem,
|
||||||
rearWiperLineItem,
|
rearWiperLineItem,
|
||||||
rainDefenseLineItem,
|
rainRepelLineItem,
|
||||||
];
|
];
|
||||||
|
|
||||||
const isRepair = false;
|
const isRepair = false;
|
||||||
|
|
@ -702,7 +702,7 @@ describe("service-package-helper.js", () => {
|
||||||
damageLocations,
|
damageLocations,
|
||||||
availableLineItems,
|
availableLineItems,
|
||||||
isRepair,
|
isRepair,
|
||||||
partTypeStrings.RAIN_DEFENSE
|
partTypeStrings.RAIN_REPEL
|
||||||
);
|
);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
|
|
@ -717,7 +717,7 @@ describe("service-package-helper.js", () => {
|
||||||
driverFrontWiperLineItem,
|
driverFrontWiperLineItem,
|
||||||
passengerFrontWiperLineItem,
|
passengerFrontWiperLineItem,
|
||||||
rearWiperLineItem,
|
rearWiperLineItem,
|
||||||
rainDefenseLineItem,
|
rainRepelLineItem,
|
||||||
];
|
];
|
||||||
|
|
||||||
const isRepair = false;
|
const isRepair = false;
|
||||||
|
|
@ -758,7 +758,7 @@ describe("service-package-helper.js", () => {
|
||||||
damageLocations,
|
damageLocations,
|
||||||
availableLineItems,
|
availableLineItems,
|
||||||
isRepair,
|
isRepair,
|
||||||
partTypeStrings.RAIN_DEFENSE
|
partTypeStrings.RAIN_REPEL
|
||||||
);
|
);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
|
|
@ -774,14 +774,10 @@ describe("service-package-helper.js", () => {
|
||||||
driverFrontWiperLineItem,
|
driverFrontWiperLineItem,
|
||||||
passengerFrontWiperLineItem,
|
passengerFrontWiperLineItem,
|
||||||
rearWiperLineItem,
|
rearWiperLineItem,
|
||||||
rainDefenseLineItem,
|
rainRepelLineItem,
|
||||||
];
|
];
|
||||||
const isRepair = false;
|
const isRepair = false;
|
||||||
const vaps = [
|
const vaps = [driverFrontWiperLineItem, passengerFrontWiperLineItem, rainRepelLineItem];
|
||||||
driverFrontWiperLineItem,
|
|
||||||
passengerFrontWiperLineItem,
|
|
||||||
rainDefenseLineItem,
|
|
||||||
];
|
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const result = servicePackageHelper.getHighestRequiredTier(
|
const result = servicePackageHelper.getHighestRequiredTier(
|
||||||
|
|
@ -802,7 +798,7 @@ describe("service-package-helper.js", () => {
|
||||||
driverFrontWiperLineItem,
|
driverFrontWiperLineItem,
|
||||||
passengerFrontWiperLineItem,
|
passengerFrontWiperLineItem,
|
||||||
rearWiperLineItem,
|
rearWiperLineItem,
|
||||||
rainDefenseLineItem,
|
rainRepelLineItem,
|
||||||
];
|
];
|
||||||
const isRepair = false;
|
const isRepair = false;
|
||||||
const vaps = [driverFrontWiperLineItem, passengerFrontWiperLineItem];
|
const vaps = [driverFrontWiperLineItem, passengerFrontWiperLineItem];
|
||||||
|
|
@ -826,7 +822,7 @@ describe("service-package-helper.js", () => {
|
||||||
driverFrontWiperLineItem,
|
driverFrontWiperLineItem,
|
||||||
passengerFrontWiperLineItem,
|
passengerFrontWiperLineItem,
|
||||||
rearWiperLineItem,
|
rearWiperLineItem,
|
||||||
rainDefenseLineItem,
|
rainRepelLineItem,
|
||||||
];
|
];
|
||||||
const isRepair = false;
|
const isRepair = false;
|
||||||
const vaps = [];
|
const vaps = [];
|
||||||
|
|
@ -850,7 +846,7 @@ describe("service-package-helper.js", () => {
|
||||||
driverFrontWiperLineItem,
|
driverFrontWiperLineItem,
|
||||||
passengerFrontWiperLineItem,
|
passengerFrontWiperLineItem,
|
||||||
rearWiperLineItem,
|
rearWiperLineItem,
|
||||||
rainDefenseLineItem,
|
rainRepelLineItem,
|
||||||
];
|
];
|
||||||
const isRepair = false;
|
const isRepair = false;
|
||||||
const vaps = [recalLineItem];
|
const vaps = [recalLineItem];
|
||||||
|
|
@ -876,13 +872,13 @@ describe("service-package-helper.js", () => {
|
||||||
driverFrontWiperLineItem,
|
driverFrontWiperLineItem,
|
||||||
passengerFrontWiperLineItem,
|
passengerFrontWiperLineItem,
|
||||||
rearWiperLineItem,
|
rearWiperLineItem,
|
||||||
rainDefenseLineItem,
|
rainRepelLineItem,
|
||||||
];
|
];
|
||||||
const isRepair = false;
|
const isRepair = false;
|
||||||
const vaps = [
|
const vaps = [
|
||||||
driverFrontWiperLineItem,
|
driverFrontWiperLineItem,
|
||||||
passengerFrontWiperLineItem,
|
passengerFrontWiperLineItem,
|
||||||
rainDefenseLineItem,
|
rainRepelLineItem,
|
||||||
rearWiperLineItem,
|
rearWiperLineItem,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -905,7 +901,7 @@ describe("service-package-helper.js", () => {
|
||||||
driverFrontWiperLineItem,
|
driverFrontWiperLineItem,
|
||||||
passengerFrontWiperLineItem,
|
passengerFrontWiperLineItem,
|
||||||
rearWiperLineItem,
|
rearWiperLineItem,
|
||||||
rainDefenseLineItem,
|
rainRepelLineItem,
|
||||||
];
|
];
|
||||||
const isRepair = false;
|
const isRepair = false;
|
||||||
const vaps = [driverFrontWiperLineItem, passengerFrontWiperLineItem];
|
const vaps = [driverFrontWiperLineItem, passengerFrontWiperLineItem];
|
||||||
|
|
@ -929,10 +925,10 @@ describe("service-package-helper.js", () => {
|
||||||
driverFrontWiperLineItem,
|
driverFrontWiperLineItem,
|
||||||
passengerFrontWiperLineItem,
|
passengerFrontWiperLineItem,
|
||||||
rearWiperLineItem,
|
rearWiperLineItem,
|
||||||
rainDefenseLineItem,
|
rainRepelLineItem,
|
||||||
];
|
];
|
||||||
const isRepair = false;
|
const isRepair = false;
|
||||||
const vaps = [rainDefenseLineItem];
|
const vaps = [rainRepelLineItem];
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const result = servicePackageHelper.getHighestFullySatisfiedTier(
|
const result = servicePackageHelper.getHighestFullySatisfiedTier(
|
||||||
|
|
@ -953,7 +949,7 @@ describe("service-package-helper.js", () => {
|
||||||
driverFrontWiperLineItem,
|
driverFrontWiperLineItem,
|
||||||
passengerFrontWiperLineItem,
|
passengerFrontWiperLineItem,
|
||||||
rearWiperLineItem,
|
rearWiperLineItem,
|
||||||
rainDefenseLineItem,
|
rainRepelLineItem,
|
||||||
];
|
];
|
||||||
const isRepair = false;
|
const isRepair = false;
|
||||||
const vaps = [];
|
const vaps = [];
|
||||||
|
|
@ -1003,10 +999,10 @@ const rearWiperLineItem = {
|
||||||
price: 24.48,
|
price: 24.48,
|
||||||
};
|
};
|
||||||
|
|
||||||
const rainDefenseLineItem = {
|
const rainRepelLineItem = {
|
||||||
partNumber: "RAIN DEFENSE",
|
partNumber: "RAIN REPEL",
|
||||||
description: null,
|
description: null,
|
||||||
partType: "RAIN DEFENSE",
|
partType: "RAIN REPEL",
|
||||||
price: 35.5,
|
price: 35.5,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -173,8 +173,8 @@ export default {
|
||||||
"confirmation"
|
"confirmation"
|
||||||
);
|
);
|
||||||
|
|
||||||
const rainDefensePromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
const rainRepelPromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
||||||
storeActions.GET_RAIN_DEFENSE,
|
storeActions.GET_RAIN_REPEL,
|
||||||
null,
|
null,
|
||||||
"confirmation"
|
"confirmation"
|
||||||
);
|
);
|
||||||
|
|
@ -190,13 +190,13 @@ export default {
|
||||||
promise: wipersPromise,
|
promise: wipersPromise,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
resultKey: "rainDefense",
|
resultKey: "rainRepel",
|
||||||
promise: rainDefensePromise,
|
promise: rainRepelPromise,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const resultMap = await settleAllPromises(promiseResultMap);
|
const resultMap = await settleAllPromises(promiseResultMap);
|
||||||
const availableVaps = [resultMap.rainDefense, ...resultMap.wipers];
|
const availableVaps = [resultMap.rainRepel, ...resultMap.wipers];
|
||||||
const lineItemsFromSubmittedOrder = deepClone(submittedOrder.lineItems);
|
const lineItemsFromSubmittedOrder = deepClone(submittedOrder.lineItems);
|
||||||
|
|
||||||
const isNoComp = submittedOrder?.policy?.isNoComp;
|
const isNoComp = submittedOrder?.policy?.isNoComp;
|
||||||
|
|
|
||||||
|
|
@ -201,8 +201,8 @@ export default {
|
||||||
"payment-method"
|
"payment-method"
|
||||||
);
|
);
|
||||||
|
|
||||||
const rainDefensePromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
const rainRepelPromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
||||||
storeActions.GET_RAIN_DEFENSE,
|
storeActions.GET_RAIN_REPEL,
|
||||||
null,
|
null,
|
||||||
"payment-method"
|
"payment-method"
|
||||||
);
|
);
|
||||||
|
|
@ -217,8 +217,8 @@ export default {
|
||||||
promise: wipersPromise,
|
promise: wipersPromise,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
resultKey: "rainDefense",
|
resultKey: "rainRepel",
|
||||||
promise: rainDefensePromise,
|
promise: rainRepelPromise,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -229,7 +229,7 @@ export default {
|
||||||
const supportingItems = lineItemsFromStore.supportingItems ?? [];
|
const supportingItems = lineItemsFromStore.supportingItems ?? [];
|
||||||
const vaps = lineItemsFromStore.vaps ?? [];
|
const vaps = lineItemsFromStore.vaps ?? [];
|
||||||
|
|
||||||
const availableVaps = [resultMap.rainDefense, ...resultMap.wipers];
|
const availableVaps = [resultMap.rainRepel, ...resultMap.wipers];
|
||||||
|
|
||||||
const pricedAvailableVaps = await baseMixin.methods.dispatchStoreActionWithLogging(
|
const pricedAvailableVaps = await baseMixin.methods.dispatchStoreActionWithLogging(
|
||||||
storeActions.PRICE_ORDER_ITEMS_AND_SAVE_SERVER_DATA,
|
storeActions.PRICE_ORDER_ITEMS_AND_SAVE_SERVER_DATA,
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ const testConstants = {
|
||||||
vapsCopy: {
|
vapsCopy: {
|
||||||
frontWiperCopy: "Front Wiper copy",
|
frontWiperCopy: "Front Wiper copy",
|
||||||
rearWiperCopy: "Rear Wiper copy",
|
rearWiperCopy: "Rear Wiper copy",
|
||||||
rainDefenseCopy: "Rain defense copy",
|
rainRepelCopy: "Rain repel copy",
|
||||||
},
|
},
|
||||||
parts: {
|
parts: {
|
||||||
frontWiperPart: {
|
frontWiperPart: {
|
||||||
|
|
@ -42,10 +42,10 @@ const testConstants = {
|
||||||
partType: "REAR WIPER",
|
partType: "REAR WIPER",
|
||||||
price: 24.48,
|
price: 24.48,
|
||||||
},
|
},
|
||||||
rainDefensePart: {
|
rainRepelPart: {
|
||||||
partNumber: "RAIN DEFENSE",
|
partNumber: "RAIN REPEL",
|
||||||
description: null,
|
description: null,
|
||||||
partType: "RAIN DEFENSE",
|
partType: "RAIN REPEL",
|
||||||
price: 35.5,
|
price: 35.5,
|
||||||
},
|
},
|
||||||
recalPart: {
|
recalPart: {
|
||||||
|
|
@ -78,7 +78,7 @@ const figmaScenarios = [
|
||||||
name: "05_01_CSR_Quote_Cash",
|
name: "05_01_CSR_Quote_Cash",
|
||||||
params: {
|
params: {
|
||||||
wiperResponse: [testConstants.parts.frontWiperPart, testConstants.parts.rearWiperPart],
|
wiperResponse: [testConstants.parts.frontWiperPart, testConstants.parts.rearWiperPart],
|
||||||
rainDefenseResponse: testConstants.parts.rainDefensePart,
|
rainRepelResponse: testConstants.parts.rainRepelPart,
|
||||||
damage: {
|
damage: {
|
||||||
isRepair: false,
|
isRepair: false,
|
||||||
glassToReplace: [testConstants.damages.frontWindshield],
|
glassToReplace: [testConstants.damages.frontWindshield],
|
||||||
|
|
@ -108,16 +108,13 @@ const figmaScenarios = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Premium",
|
name: "Premium",
|
||||||
vapsCombo: [
|
vapsCombo: [testConstants.parts.rainRepelPart, testConstants.parts.frontWiperPart],
|
||||||
testConstants.parts.rainDefensePart,
|
|
||||||
testConstants.parts.frontWiperPart,
|
|
||||||
],
|
|
||||||
expected: {
|
expected: {
|
||||||
packageNameWidget: testConstants.widgetNames.tierThreeTitle,
|
packageNameWidget: testConstants.widgetNames.tierThreeTitle,
|
||||||
displayContent: [
|
displayContent: [
|
||||||
...testConstants.defaultItemCopy.defaultItemCopyArray,
|
...testConstants.defaultItemCopy.defaultItemCopyArray,
|
||||||
testConstants.vapsCopy.frontWiperCopy,
|
testConstants.vapsCopy.frontWiperCopy,
|
||||||
testConstants.vapsCopy.rainDefenseCopy,
|
testConstants.vapsCopy.rainRepelCopy,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -140,7 +137,7 @@ const figmaScenarios = [
|
||||||
name: "05_01_CSR_Quote_Standard_Repair",
|
name: "05_01_CSR_Quote_Standard_Repair",
|
||||||
params: {
|
params: {
|
||||||
wiperResponse: [testConstants.parts.frontWiperPart, testConstants.parts.rearWiperPart],
|
wiperResponse: [testConstants.parts.frontWiperPart, testConstants.parts.rearWiperPart],
|
||||||
rainDefenseResponse: testConstants.parts.rainDefensePart,
|
rainRepelResponse: testConstants.parts.rainRepelPart,
|
||||||
damage: {
|
damage: {
|
||||||
isRepair: true,
|
isRepair: true,
|
||||||
glassToReplace: [],
|
glassToReplace: [],
|
||||||
|
|
@ -170,16 +167,13 @@ const figmaScenarios = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Premium",
|
name: "Premium",
|
||||||
vapsCombo: [
|
vapsCombo: [testConstants.parts.rainRepelPart, testConstants.parts.frontWiperPart],
|
||||||
testConstants.parts.rainDefensePart,
|
|
||||||
testConstants.parts.frontWiperPart,
|
|
||||||
],
|
|
||||||
expected: {
|
expected: {
|
||||||
packageNameWidget: testConstants.widgetNames.tierThreeTitle,
|
packageNameWidget: testConstants.widgetNames.tierThreeTitle,
|
||||||
displayContent: [
|
displayContent: [
|
||||||
...testConstants.defaultItemCopy.defaultItemCopyArray,
|
...testConstants.defaultItemCopy.defaultItemCopyArray,
|
||||||
testConstants.vapsCopy.frontWiperCopy,
|
testConstants.vapsCopy.frontWiperCopy,
|
||||||
testConstants.vapsCopy.rainDefenseCopy,
|
testConstants.vapsCopy.rainRepelCopy,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -201,7 +195,7 @@ const figmaScenarios = [
|
||||||
name: "05_01_CSR_Quote_Recal",
|
name: "05_01_CSR_Quote_Recal",
|
||||||
params: {
|
params: {
|
||||||
wiperResponse: [testConstants.parts.frontWiperPart, testConstants.parts.rearWiperPart],
|
wiperResponse: [testConstants.parts.frontWiperPart, testConstants.parts.rearWiperPart],
|
||||||
rainDefenseResponse: testConstants.parts.rainDefensePart,
|
rainRepelResponse: testConstants.parts.rainRepelPart,
|
||||||
damage: {
|
damage: {
|
||||||
isRepair: false,
|
isRepair: false,
|
||||||
glassToReplace: [testConstants.damages.frontWindshield],
|
glassToReplace: [testConstants.damages.frontWindshield],
|
||||||
|
|
@ -231,16 +225,13 @@ const figmaScenarios = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Premium",
|
name: "Premium",
|
||||||
vapsCombo: [
|
vapsCombo: [testConstants.parts.rainRepelPart, testConstants.parts.frontWiperPart],
|
||||||
testConstants.parts.rainDefensePart,
|
|
||||||
testConstants.parts.frontWiperPart,
|
|
||||||
],
|
|
||||||
expected: {
|
expected: {
|
||||||
packageNameWidget: testConstants.widgetNames.tierThreeTitle,
|
packageNameWidget: testConstants.widgetNames.tierThreeTitle,
|
||||||
displayContent: [
|
displayContent: [
|
||||||
...testConstants.defaultItemCopy.defaultItemCopyArray,
|
...testConstants.defaultItemCopy.defaultItemCopyArray,
|
||||||
testConstants.vapsCopy.frontWiperCopy,
|
testConstants.vapsCopy.frontWiperCopy,
|
||||||
testConstants.vapsCopy.rainDefenseCopy,
|
testConstants.vapsCopy.rainRepelCopy,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -263,7 +254,7 @@ const figmaScenarios = [
|
||||||
name: "05_01_CSR_Quote_RearGlass+NonWindshield",
|
name: "05_01_CSR_Quote_RearGlass+NonWindshield",
|
||||||
params: {
|
params: {
|
||||||
wiperResponse: [testConstants.parts.frontWiperPart, testConstants.parts.rearWiperPart],
|
wiperResponse: [testConstants.parts.frontWiperPart, testConstants.parts.rearWiperPart],
|
||||||
rainDefenseResponse: testConstants.parts.rainDefensePart,
|
rainRepelResponse: testConstants.parts.rainRepelPart,
|
||||||
damage: {
|
damage: {
|
||||||
isRepair: false,
|
isRepair: false,
|
||||||
glassToReplace: [testConstants.damages.rearWindshield],
|
glassToReplace: [testConstants.damages.rearWindshield],
|
||||||
|
|
@ -303,14 +294,14 @@ const figmaScenarios = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Standard+RainDefense",
|
name: "Standard+RainRepel",
|
||||||
vapsCombo: [testConstants.parts.rearWiperPart, testConstants.parts.rainDefensePart],
|
vapsCombo: [testConstants.parts.rearWiperPart, testConstants.parts.rainRepelPart],
|
||||||
expected: {
|
expected: {
|
||||||
packageNameWidget: testConstants.widgetNames.tierTwoTitle,
|
packageNameWidget: testConstants.widgetNames.tierTwoTitle,
|
||||||
displayContent: [
|
displayContent: [
|
||||||
...testConstants.defaultItemCopy.defaultItemCopyArray,
|
...testConstants.defaultItemCopy.defaultItemCopyArray,
|
||||||
testConstants.vapsCopy.rearWiperCopy,
|
testConstants.vapsCopy.rearWiperCopy,
|
||||||
testConstants.vapsCopy.rainDefenseCopy,
|
testConstants.vapsCopy.rainRepelCopy,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -332,7 +323,7 @@ const figmaScenarios = [
|
||||||
name: "05_01_CSR_Quote_RearGlass+Windshield",
|
name: "05_01_CSR_Quote_RearGlass+Windshield",
|
||||||
params: {
|
params: {
|
||||||
wiperResponse: [testConstants.parts.frontWiperPart, testConstants.parts.rearWiperPart],
|
wiperResponse: [testConstants.parts.frontWiperPart, testConstants.parts.rearWiperPart],
|
||||||
rainDefenseResponse: testConstants.parts.rainDefensePart,
|
rainRepelResponse: testConstants.parts.rainRepelPart,
|
||||||
damage: {
|
damage: {
|
||||||
isRepair: false,
|
isRepair: false,
|
||||||
glassToReplace: [
|
glassToReplace: [
|
||||||
|
|
@ -375,40 +366,37 @@ const figmaScenarios = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Economy+RainDefense",
|
name: "Economy+RainRepel",
|
||||||
vapsCombo: [testConstants.parts.rainDefensePart],
|
vapsCombo: [testConstants.parts.rainRepelPart],
|
||||||
expected: {
|
expected: {
|
||||||
packageNameWidget: testConstants.widgetNames.tierOneTitle,
|
packageNameWidget: testConstants.widgetNames.tierOneTitle,
|
||||||
displayContent: [
|
displayContent: [
|
||||||
...testConstants.defaultItemCopy.defaultItemCopyArray,
|
...testConstants.defaultItemCopy.defaultItemCopyArray,
|
||||||
testConstants.vapsCopy.rainDefenseCopy,
|
testConstants.vapsCopy.rainRepelCopy,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Economy+Frontwiper+RainDefense",
|
name: "Economy+Frontwiper+RainRepel",
|
||||||
vapsCombo: [
|
vapsCombo: [testConstants.parts.frontWiperPart, testConstants.parts.rainRepelPart],
|
||||||
testConstants.parts.frontWiperPart,
|
|
||||||
testConstants.parts.rainDefensePart,
|
|
||||||
],
|
|
||||||
expected: {
|
expected: {
|
||||||
packageNameWidget: testConstants.widgetNames.tierOneTitle,
|
packageNameWidget: testConstants.widgetNames.tierOneTitle,
|
||||||
displayContent: [
|
displayContent: [
|
||||||
...testConstants.defaultItemCopy.defaultItemCopyArray,
|
...testConstants.defaultItemCopy.defaultItemCopyArray,
|
||||||
testConstants.vapsCopy.frontWiperCopy,
|
testConstants.vapsCopy.frontWiperCopy,
|
||||||
testConstants.vapsCopy.rainDefenseCopy,
|
testConstants.vapsCopy.rainRepelCopy,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Economy+Rearwiper+RainDefense",
|
name: "Economy+Rearwiper+RainRepel",
|
||||||
vapsCombo: [testConstants.parts.rearWiperPart, testConstants.parts.rainDefensePart],
|
vapsCombo: [testConstants.parts.rearWiperPart, testConstants.parts.rainRepelPart],
|
||||||
expected: {
|
expected: {
|
||||||
packageNameWidget: testConstants.widgetNames.tierOneTitle,
|
packageNameWidget: testConstants.widgetNames.tierOneTitle,
|
||||||
displayContent: [
|
displayContent: [
|
||||||
...testConstants.defaultItemCopy.defaultItemCopyArray,
|
...testConstants.defaultItemCopy.defaultItemCopyArray,
|
||||||
testConstants.vapsCopy.rearWiperCopy,
|
testConstants.vapsCopy.rearWiperCopy,
|
||||||
testConstants.vapsCopy.rainDefenseCopy,
|
testConstants.vapsCopy.rainRepelCopy,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -429,7 +417,7 @@ const figmaScenarios = [
|
||||||
vapsCombo: [
|
vapsCombo: [
|
||||||
testConstants.parts.rearWiperPart,
|
testConstants.parts.rearWiperPart,
|
||||||
testConstants.parts.frontWiperPart,
|
testConstants.parts.frontWiperPart,
|
||||||
testConstants.parts.rainDefensePart,
|
testConstants.parts.rainRepelPart,
|
||||||
],
|
],
|
||||||
expected: {
|
expected: {
|
||||||
packageNameWidget: testConstants.widgetNames.tierThreeTitle,
|
packageNameWidget: testConstants.widgetNames.tierThreeTitle,
|
||||||
|
|
@ -437,7 +425,7 @@ const figmaScenarios = [
|
||||||
...testConstants.defaultItemCopy.defaultItemCopyArray,
|
...testConstants.defaultItemCopy.defaultItemCopyArray,
|
||||||
testConstants.vapsCopy.frontWiperCopy,
|
testConstants.vapsCopy.frontWiperCopy,
|
||||||
testConstants.vapsCopy.rearWiperCopy,
|
testConstants.vapsCopy.rearWiperCopy,
|
||||||
testConstants.vapsCopy.rainDefenseCopy,
|
testConstants.vapsCopy.rainRepelCopy,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -447,7 +435,7 @@ const figmaScenarios = [
|
||||||
name: "05_01_CSR_Quote_RearGlassNoFrontFit",
|
name: "05_01_CSR_Quote_RearGlassNoFrontFit",
|
||||||
params: {
|
params: {
|
||||||
wiperResponse: [testConstants.parts.rearWiperPart],
|
wiperResponse: [testConstants.parts.rearWiperPart],
|
||||||
rainDefenseResponse: testConstants.parts.rainDefensePart,
|
rainRepelResponse: testConstants.parts.rainRepelPart,
|
||||||
damage: {
|
damage: {
|
||||||
isRepair: false,
|
isRepair: false,
|
||||||
glassToReplace: [testConstants.damages.rearWindshield],
|
glassToReplace: [testConstants.damages.rearWindshield],
|
||||||
|
|
@ -465,13 +453,13 @@ const figmaScenarios = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Economy+Raindefense",
|
name: "Economy+Rainrepel",
|
||||||
vapsCombo: [testConstants.parts.rainDefensePart],
|
vapsCombo: [testConstants.parts.rainRepelPart],
|
||||||
expected: {
|
expected: {
|
||||||
packageNameWidget: testConstants.widgetNames.tierOneTitle,
|
packageNameWidget: testConstants.widgetNames.tierOneTitle,
|
||||||
displayContent: [
|
displayContent: [
|
||||||
...testConstants.defaultItemCopy.defaultItemCopyArray,
|
...testConstants.defaultItemCopy.defaultItemCopyArray,
|
||||||
testConstants.vapsCopy.rainDefenseCopy,
|
testConstants.vapsCopy.rainRepelCopy,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -488,13 +476,13 @@ const figmaScenarios = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Premium",
|
name: "Premium",
|
||||||
vapsCombo: [testConstants.parts.rearWiperPart, testConstants.parts.rainDefensePart],
|
vapsCombo: [testConstants.parts.rearWiperPart, testConstants.parts.rainRepelPart],
|
||||||
expected: {
|
expected: {
|
||||||
packageNameWidget: testConstants.widgetNames.tierThreeTitle,
|
packageNameWidget: testConstants.widgetNames.tierThreeTitle,
|
||||||
displayContent: [
|
displayContent: [
|
||||||
...testConstants.defaultItemCopy.defaultItemCopyArray,
|
...testConstants.defaultItemCopy.defaultItemCopyArray,
|
||||||
testConstants.vapsCopy.rearWiperCopy,
|
testConstants.vapsCopy.rearWiperCopy,
|
||||||
testConstants.vapsCopy.rainDefenseCopy,
|
testConstants.vapsCopy.rainRepelCopy,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -505,7 +493,7 @@ const figmaScenarios = [
|
||||||
name: "05_01_CSR_Quote_Windshield+SideGlass",
|
name: "05_01_CSR_Quote_Windshield+SideGlass",
|
||||||
params: {
|
params: {
|
||||||
wiperResponse: [testConstants.parts.frontWiperPart, testConstants.parts.rearWiperPart],
|
wiperResponse: [testConstants.parts.frontWiperPart, testConstants.parts.rearWiperPart],
|
||||||
rainDefenseResponse: testConstants.parts.rainDefensePart,
|
rainRepelResponse: testConstants.parts.rainRepelPart,
|
||||||
damage: {
|
damage: {
|
||||||
isRepair: false,
|
isRepair: false,
|
||||||
glassToReplace: [
|
glassToReplace: [
|
||||||
|
|
@ -538,16 +526,13 @@ const figmaScenarios = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Premium",
|
name: "Premium",
|
||||||
vapsCombo: [
|
vapsCombo: [testConstants.parts.rainRepelPart, testConstants.parts.frontWiperPart],
|
||||||
testConstants.parts.rainDefensePart,
|
|
||||||
testConstants.parts.frontWiperPart,
|
|
||||||
],
|
|
||||||
expected: {
|
expected: {
|
||||||
packageNameWidget: testConstants.widgetNames.tierThreeTitle,
|
packageNameWidget: testConstants.widgetNames.tierThreeTitle,
|
||||||
displayContent: [
|
displayContent: [
|
||||||
...testConstants.defaultItemCopy.defaultItemCopyArray,
|
...testConstants.defaultItemCopy.defaultItemCopyArray,
|
||||||
testConstants.vapsCopy.frontWiperCopy,
|
testConstants.vapsCopy.frontWiperCopy,
|
||||||
testConstants.vapsCopy.rainDefenseCopy,
|
testConstants.vapsCopy.rainRepelCopy,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -570,7 +555,7 @@ const figmaScenarios = [
|
||||||
name: "05_01_CSR_Quote_SideGlass",
|
name: "05_01_CSR_Quote_SideGlass",
|
||||||
params: {
|
params: {
|
||||||
wiperResponse: [testConstants.parts.frontWiperPart, testConstants.parts.rearWiperPart],
|
wiperResponse: [testConstants.parts.frontWiperPart, testConstants.parts.rearWiperPart],
|
||||||
rainDefenseResponse: testConstants.parts.rainDefensePart,
|
rainRepelResponse: testConstants.parts.rainRepelPart,
|
||||||
damage: {
|
damage: {
|
||||||
isRepair: false,
|
isRepair: false,
|
||||||
glassToReplace: [testConstants.damages.sideGlass],
|
glassToReplace: [testConstants.damages.sideGlass],
|
||||||
|
|
@ -599,13 +584,13 @@ const figmaScenarios = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Economy+RainDefense",
|
name: "Economy+RainRepel",
|
||||||
vapsCombo: [testConstants.parts.rainDefensePart],
|
vapsCombo: [testConstants.parts.rainRepelPart],
|
||||||
expected: {
|
expected: {
|
||||||
packageNameWidget: testConstants.widgetNames.tierOneTitle,
|
packageNameWidget: testConstants.widgetNames.tierOneTitle,
|
||||||
displayContent: [
|
displayContent: [
|
||||||
...testConstants.defaultItemCopy.defaultItemCopyArray,
|
...testConstants.defaultItemCopy.defaultItemCopyArray,
|
||||||
testConstants.vapsCopy.rainDefenseCopy,
|
testConstants.vapsCopy.rainRepelCopy,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -622,23 +607,20 @@ const figmaScenarios = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Premium",
|
name: "Premium",
|
||||||
vapsCombo: [
|
vapsCombo: [testConstants.parts.rainRepelPart, testConstants.parts.frontWiperPart],
|
||||||
testConstants.parts.rainDefensePart,
|
|
||||||
testConstants.parts.frontWiperPart,
|
|
||||||
],
|
|
||||||
expected: {
|
expected: {
|
||||||
packageNameWidget: testConstants.widgetNames.tierThreeTitle,
|
packageNameWidget: testConstants.widgetNames.tierThreeTitle,
|
||||||
displayContent: [
|
displayContent: [
|
||||||
...testConstants.defaultItemCopy.defaultItemCopyArray,
|
...testConstants.defaultItemCopy.defaultItemCopyArray,
|
||||||
testConstants.vapsCopy.frontWiperCopy,
|
testConstants.vapsCopy.frontWiperCopy,
|
||||||
testConstants.vapsCopy.rainDefenseCopy,
|
testConstants.vapsCopy.rainRepelCopy,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Premium+Rearwiper",
|
name: "Premium+Rearwiper",
|
||||||
vapsCombo: [
|
vapsCombo: [
|
||||||
testConstants.parts.rainDefensePart,
|
testConstants.parts.rainRepelPart,
|
||||||
testConstants.parts.frontWiperPart,
|
testConstants.parts.frontWiperPart,
|
||||||
testConstants.parts.rearWiperPart,
|
testConstants.parts.rearWiperPart,
|
||||||
],
|
],
|
||||||
|
|
@ -648,7 +630,7 @@ const figmaScenarios = [
|
||||||
...testConstants.defaultItemCopy.defaultItemCopyArray,
|
...testConstants.defaultItemCopy.defaultItemCopyArray,
|
||||||
testConstants.vapsCopy.frontWiperCopy,
|
testConstants.vapsCopy.frontWiperCopy,
|
||||||
testConstants.vapsCopy.rearWiperCopy,
|
testConstants.vapsCopy.rearWiperCopy,
|
||||||
testConstants.vapsCopy.rainDefenseCopy,
|
testConstants.vapsCopy.rainRepelCopy,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -659,7 +641,7 @@ const figmaScenarios = [
|
||||||
name: "05_01_CSR_Quote_NoWiperFit",
|
name: "05_01_CSR_Quote_NoWiperFit",
|
||||||
params: {
|
params: {
|
||||||
wiperResponse: [],
|
wiperResponse: [],
|
||||||
rainDefenseResponse: testConstants.parts.rainDefensePart,
|
rainRepelResponse: testConstants.parts.rainRepelPart,
|
||||||
damage: {
|
damage: {
|
||||||
isRepair: false,
|
isRepair: false,
|
||||||
glassToReplace: [testConstants.damages.frontWindshield],
|
glassToReplace: [testConstants.damages.frontWindshield],
|
||||||
|
|
@ -678,12 +660,12 @@ const figmaScenarios = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Premium",
|
name: "Premium",
|
||||||
vapsCombo: [testConstants.parts.rainDefensePart],
|
vapsCombo: [testConstants.parts.rainRepelPart],
|
||||||
expected: {
|
expected: {
|
||||||
packageNameWidget: testConstants.widgetNames.tierThreeTitle,
|
packageNameWidget: testConstants.widgetNames.tierThreeTitle,
|
||||||
displayContent: [
|
displayContent: [
|
||||||
...testConstants.defaultItemCopy.defaultItemCopyArray,
|
...testConstants.defaultItemCopy.defaultItemCopyArray,
|
||||||
testConstants.vapsCopy.rainDefenseCopy,
|
testConstants.vapsCopy.rainRepelCopy,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -771,8 +753,8 @@ describe("Service Package Review Block", () => {
|
||||||
SubWidgetName: "",
|
SubWidgetName: "",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: partTypeStrings.RAIN_DEFENSE,
|
Name: partTypeStrings.RAIN_REPEL,
|
||||||
Text: testConstants.vapsCopy.rainDefenseCopy,
|
Text: testConstants.vapsCopy.rainRepelCopy,
|
||||||
SubText: "",
|
SubText: "",
|
||||||
ImageId: testConstants.imageId,
|
ImageId: testConstants.imageId,
|
||||||
Image: "",
|
Image: "",
|
||||||
|
|
@ -788,15 +770,15 @@ describe("Service Package Review Block", () => {
|
||||||
// Should only return the highest tier where *every* offered VAP is part of the order.
|
// Should only return the highest tier where *every* offered VAP is part of the order.
|
||||||
// However, there may be vaps not offered in the qualifying tier. Hence rounding *down*.
|
// However, there may be vaps not offered in the qualifying tier. Hence rounding *down*.
|
||||||
//
|
//
|
||||||
// I.e. Economy=[], Standard=[front wipers], Premium=[front wipers, rain defense].
|
// I.e. Economy=[], Standard=[front wipers], Premium=[front wipers, rain repel].
|
||||||
// Current vaps=[rain defense]. Though rain defense is in Premium, we don't satisfy it or standard.
|
// Current vaps=[rain repel]. Though rain repel is in Premium, we don't satisfy it or standard.
|
||||||
// So our tier should still be Economy.
|
// So our tier should still be Economy.
|
||||||
// Should still display extra vaps.
|
// Should still display extra vaps.
|
||||||
|
|
||||||
// Arrange
|
// Arrange
|
||||||
let props = generateDefaultProps();
|
let props = generateDefaultProps();
|
||||||
|
|
||||||
props.lineItems.vaps = [testConstants.parts.rainDefensePart];
|
props.lineItems.vaps = [testConstants.parts.rainRepelPart];
|
||||||
|
|
||||||
const { wrapper } = setupMocks({
|
const { wrapper } = setupMocks({
|
||||||
propsData: props,
|
propsData: props,
|
||||||
|
|
@ -810,10 +792,10 @@ describe("Service Package Review Block", () => {
|
||||||
// Assert
|
// Assert
|
||||||
expect(wrapper.vm.packageNameWidget).toEqual(testConstants.widgetNames.tierOneTitle);
|
expect(wrapper.vm.packageNameWidget).toEqual(testConstants.widgetNames.tierOneTitle);
|
||||||
|
|
||||||
let containsRainDefenseCopy = wrapper.vm.displayContent.includes(
|
let containsRainRepelCopy = wrapper.vm.displayContent.includes(
|
||||||
testConstants.vapsCopy.rainDefenseCopy
|
testConstants.vapsCopy.rainRepelCopy
|
||||||
);
|
);
|
||||||
expect(containsRainDefenseCopy).toBe(true);
|
expect(containsRainRepelCopy).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Should display all default items from cms", async () => {
|
it("Should display all default items from cms", async () => {
|
||||||
|
|
@ -865,11 +847,11 @@ describe("Service Package Review Block", () => {
|
||||||
const includesFrontWiperCopy = wrapper.vm.displayContent.includes(
|
const includesFrontWiperCopy = wrapper.vm.displayContent.includes(
|
||||||
testConstants.vapsCopy.frontWiperCopy
|
testConstants.vapsCopy.frontWiperCopy
|
||||||
);
|
);
|
||||||
const includesRainDefenseCopy = wrapper.vm.displayContent.includes(
|
const includesRainRepelCopy = wrapper.vm.displayContent.includes(
|
||||||
testConstants.vapsCopy.rainDefenseCopy
|
testConstants.vapsCopy.rainRepelCopy
|
||||||
);
|
);
|
||||||
expect(includesFrontWiperCopy).toBe(true);
|
expect(includesFrontWiperCopy).toBe(true);
|
||||||
expect(includesRainDefenseCopy).toBe(false);
|
expect(includesRainRepelCopy).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Should not error if cms content is missing (though may display poorly).", async () => {
|
it("Should not error if cms content is missing (though may display poorly).", async () => {
|
||||||
|
|
@ -908,7 +890,7 @@ describe("Service Package Review Block", () => {
|
||||||
|
|
||||||
wrapper.vm.initializeComponent({
|
wrapper.vm.initializeComponent({
|
||||||
wipers: scenario.params.wiperResponse,
|
wipers: scenario.params.wiperResponse,
|
||||||
rainDefense: scenario.params.rainDefenseResponse,
|
rainRepel: scenario.params.rainRepelResponse,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
|
|
@ -928,7 +910,7 @@ describe("Service Package Review Block", () => {
|
||||||
function initializeWithDefault(wrapper) {
|
function initializeWithDefault(wrapper) {
|
||||||
wrapper.vm.initializeComponent({
|
wrapper.vm.initializeComponent({
|
||||||
wipers: [testConstants.parts.frontWiperPart],
|
wipers: [testConstants.parts.frontWiperPart],
|
||||||
rainDefense: testConstants.parts.rainDefensePart,
|
rainRepel: testConstants.parts.rainRepelPart,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,8 +40,8 @@ export default {
|
||||||
},
|
},
|
||||||
"review"
|
"review"
|
||||||
);
|
);
|
||||||
const rainDefensePromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
const rainRepelPromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
||||||
storeActions.GET_RAIN_DEFENSE,
|
storeActions.GET_RAIN_REPEL,
|
||||||
null,
|
null,
|
||||||
"review"
|
"review"
|
||||||
);
|
);
|
||||||
|
|
@ -52,15 +52,15 @@ export default {
|
||||||
promise: wipersPromise,
|
promise: wipersPromise,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
resultKey: "rainDefense",
|
resultKey: "rainRepel",
|
||||||
promise: rainDefensePromise,
|
promise: rainRepelPromise,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
return settleAllPromises(promiseResultMap);
|
return settleAllPromises(promiseResultMap);
|
||||||
},
|
},
|
||||||
initializeComponent(apiResponses) {
|
initializeComponent(apiResponses) {
|
||||||
const vapsFromApi = [...apiResponses.wipers, apiResponses.rainDefense];
|
const vapsFromApi = [...apiResponses.wipers, apiResponses.rainRepel];
|
||||||
|
|
||||||
this.availableVaps = vapsFromApi;
|
this.availableVaps = vapsFromApi;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -45,11 +45,11 @@ const parts = {
|
||||||
partType: "REAR WIPER",
|
partType: "REAR WIPER",
|
||||||
price: 24.48,
|
price: 24.48,
|
||||||
},
|
},
|
||||||
rainDefense: {
|
rainRepel: {
|
||||||
name: "rain defense",
|
name: "rain repel",
|
||||||
partNumber: "RAIN DEFENSE",
|
partNumber: "RAIN REPEL",
|
||||||
description: null,
|
description: null,
|
||||||
partType: "RAIN DEFENSE",
|
partType: "RAIN REPEL",
|
||||||
price: 35.5,
|
price: 35.5,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
@ -76,8 +76,8 @@ const pricedParts = {
|
||||||
salesTax: 0,
|
salesTax: 0,
|
||||||
sellingPrice: 24.48,
|
sellingPrice: 24.48,
|
||||||
},
|
},
|
||||||
rainDefense: {
|
rainRepel: {
|
||||||
...parts.rainDefense,
|
...parts.rainRepel,
|
||||||
kitPrice: 20,
|
kitPrice: 20,
|
||||||
laborAmount: 0,
|
laborAmount: 0,
|
||||||
salesTax: 0,
|
salesTax: 0,
|
||||||
|
|
@ -101,8 +101,8 @@ const taxedParts = {
|
||||||
salesTax: 6.0,
|
salesTax: 6.0,
|
||||||
subTotal: 100,
|
subTotal: 100,
|
||||||
},
|
},
|
||||||
rainDefense: {
|
rainRepel: {
|
||||||
...pricedParts.rainDefense,
|
...pricedParts.rainRepel,
|
||||||
salesTax: 1.0,
|
salesTax: 1.0,
|
||||||
subTotal: 100,
|
subTotal: 100,
|
||||||
},
|
},
|
||||||
|
|
@ -229,7 +229,7 @@ describe("payment.vue", () => {
|
||||||
startDate: "startDate",
|
startDate: "startDate",
|
||||||
},
|
},
|
||||||
[storeActions.GET_WIPERS]: [parts.frontWipers, parts.rearWipers],
|
[storeActions.GET_WIPERS]: [parts.frontWipers, parts.rearWipers],
|
||||||
[storeActions.GET_RAIN_DEFENSE]: parts.rainDefense,
|
[storeActions.GET_RAIN_REPEL]: parts.rainRepel,
|
||||||
[storeActions.PRICE_ORDER_ITEMS_AND_SAVE_SERVER_DATA]: [
|
[storeActions.PRICE_ORDER_ITEMS_AND_SAVE_SERVER_DATA]: [
|
||||||
pricedParts.windshield,
|
pricedParts.windshield,
|
||||||
pricedParts.frontWipers,
|
pricedParts.frontWipers,
|
||||||
|
|
@ -404,11 +404,7 @@ describe("payment.vue", () => {
|
||||||
test("Properly formatted output", () => {
|
test("Properly formatted output", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const wrapper = setupMocks({});
|
const wrapper = setupMocks({});
|
||||||
const cartItems = [
|
const cartItems = [taxedParts.windshield, taxedParts.frontWipers, taxedParts.rainRepel];
|
||||||
taxedParts.windshield,
|
|
||||||
taxedParts.frontWipers,
|
|
||||||
taxedParts.rainDefense,
|
|
||||||
];
|
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
wrapper.vm.getPiaLineItems(cartItems);
|
wrapper.vm.getPiaLineItems(cartItems);
|
||||||
|
|
@ -423,7 +419,7 @@ describe("payment.vue", () => {
|
||||||
store.getters.order.lineItems.glassParts = null;
|
store.getters.order.lineItems.glassParts = null;
|
||||||
|
|
||||||
const wrapper = setupMocks({});
|
const wrapper = setupMocks({});
|
||||||
const cartItems = [taxedParts.frontWipers, taxedParts.rainDefense];
|
const cartItems = [taxedParts.frontWipers, taxedParts.rainRepel];
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
wrapper.vm.getPiaLineItems(cartItems);
|
wrapper.vm.getPiaLineItems(cartItems);
|
||||||
|
|
@ -444,11 +440,7 @@ describe("payment.vue", () => {
|
||||||
];
|
];
|
||||||
|
|
||||||
const wrapper = setupMocks({});
|
const wrapper = setupMocks({});
|
||||||
const cartItems = [
|
const cartItems = [taxedParts.windshield, taxedParts.frontWipers, taxedParts.rainRepel];
|
||||||
taxedParts.windshield,
|
|
||||||
taxedParts.frontWipers,
|
|
||||||
taxedParts.rainDefense,
|
|
||||||
];
|
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
wrapper.vm.getPiaLineItems(cartItems);
|
wrapper.vm.getPiaLineItems(cartItems);
|
||||||
|
|
|
||||||
|
|
@ -330,8 +330,8 @@ export default {
|
||||||
"payment"
|
"payment"
|
||||||
);
|
);
|
||||||
|
|
||||||
const rainDefensePromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
const rainRepelPromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
||||||
storeActions.GET_RAIN_DEFENSE,
|
storeActions.GET_RAIN_REPEL,
|
||||||
null,
|
null,
|
||||||
"payment"
|
"payment"
|
||||||
);
|
);
|
||||||
|
|
@ -350,8 +350,8 @@ export default {
|
||||||
promise: wipersPromise,
|
promise: wipersPromise,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
resultKey: "rainDefense",
|
resultKey: "rainRepel",
|
||||||
promise: rainDefensePromise,
|
promise: rainRepelPromise,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -361,12 +361,12 @@ export default {
|
||||||
const supportingItems = lineItemsFromStore.supportingItems ?? [];
|
const supportingItems = lineItemsFromStore.supportingItems ?? [];
|
||||||
|
|
||||||
const lineItemsToTax = [
|
const lineItemsToTax = [
|
||||||
resultMap.rainDefense,
|
resultMap.rainRepel,
|
||||||
...supportingItems,
|
...supportingItems,
|
||||||
...resultMap.wipers,
|
...resultMap.wipers,
|
||||||
...glassParts,
|
...glassParts,
|
||||||
];
|
];
|
||||||
const availableVaps = [resultMap.rainDefense, ...resultMap.wipers];
|
const availableVaps = [resultMap.rainRepel, ...resultMap.wipers];
|
||||||
|
|
||||||
const pricedLineItemsToTax = await baseMixin.methods.dispatchStoreActionWithLogging(
|
const pricedLineItemsToTax = await baseMixin.methods.dispatchStoreActionWithLogging(
|
||||||
storeActions.PRICE_ORDER_ITEMS_AND_SAVE_SERVER_DATA,
|
storeActions.PRICE_ORDER_ITEMS_AND_SAVE_SERVER_DATA,
|
||||||
|
|
|
||||||
|
|
@ -141,9 +141,9 @@ const mockStoreActionResults = {};
|
||||||
mockStoreActionResults[storeActions.GET_WIPERS] = Promise.resolve([
|
mockStoreActionResults[storeActions.GET_WIPERS] = Promise.resolve([
|
||||||
{ partNumber: "SBB24", partType: "FRONT WIPER" },
|
{ partNumber: "SBB24", partType: "FRONT WIPER" },
|
||||||
]);
|
]);
|
||||||
mockStoreActionResults[storeActions.GET_RAIN_DEFENSE] = Promise.resolve({
|
mockStoreActionResults[storeActions.GET_RAIN_REPEL] = Promise.resolve({
|
||||||
partNumber: "RAIN DEFENSE",
|
partNumber: "RAIN REPEL",
|
||||||
partType: "RAIN DEFENSE",
|
partType: "RAIN REPEL",
|
||||||
});
|
});
|
||||||
mockStoreActionResults[storeActions.GET_SUPPORTING_ITEMS] = Promise.resolve([
|
mockStoreActionResults[storeActions.GET_SUPPORTING_ITEMS] = Promise.resolve([
|
||||||
{ partNumber: "WSREPAIR", partType: "WSREPAIR" },
|
{ partNumber: "WSREPAIR", partType: "WSREPAIR" },
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="row justify-content-center">
|
<div class="row justify-content-center">
|
||||||
<div class="col-md-8 col-xl-6">
|
<div class="col-md-8 col-xl-6">
|
||||||
<contentGroupModal ref="RainDefenseModal" cmsWidgetName="RainDefenseModal" />
|
<contentGroupModal ref="RainRepelModal" cmsWidgetName="RainRepelModal" />
|
||||||
<contentGroupModal ref="FrontWiperModal" cmsWidgetName="FrontWiperModal" />
|
<contentGroupModal ref="FrontWiperModal" cmsWidgetName="FrontWiperModal" />
|
||||||
<contentGroupModal ref="RearWiperModal" cmsWidgetName="RearWiperModal" />
|
<contentGroupModal ref="RearWiperModal" cmsWidgetName="RearWiperModal" />
|
||||||
<contentGroupModal ref="RecalModal" cmsWidgetName="RecalModal" />
|
<contentGroupModal ref="RecalModal" cmsWidgetName="RecalModal" />
|
||||||
|
|
@ -199,8 +199,8 @@ export default {
|
||||||
},
|
},
|
||||||
"quote"
|
"quote"
|
||||||
);
|
);
|
||||||
const rainDefensePromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
const rainRepelPromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
||||||
storeActions.GET_RAIN_DEFENSE,
|
storeActions.GET_RAIN_REPEL,
|
||||||
null,
|
null,
|
||||||
"quote"
|
"quote"
|
||||||
);
|
);
|
||||||
|
|
@ -275,8 +275,8 @@ export default {
|
||||||
promise: wipersPromise,
|
promise: wipersPromise,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
resultKey: "rainDefense",
|
resultKey: "rainRepel",
|
||||||
promise: rainDefensePromise,
|
promise: rainRepelPromise,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
resultKey: "supportingItems",
|
resultKey: "supportingItems",
|
||||||
|
|
@ -320,7 +320,7 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const availableLineItems = [
|
const availableLineItems = [
|
||||||
resultMap.rainDefense,
|
resultMap.rainRepel,
|
||||||
...resultMap.supportingItems,
|
...resultMap.supportingItems,
|
||||||
...resultMap.wipers,
|
...resultMap.wipers,
|
||||||
...nullSafeGlassParts,
|
...nullSafeGlassParts,
|
||||||
|
|
@ -358,7 +358,7 @@ export default {
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
lineItems.supportingItems = resultMap.supportingItems;
|
lineItems.supportingItems = resultMap.supportingItems;
|
||||||
const addableVaps = [...resultMap.wipers, resultMap.rainDefense];
|
const addableVaps = [...resultMap.wipers, resultMap.rainRepel];
|
||||||
|
|
||||||
// Promo logic
|
// Promo logic
|
||||||
// Populate the previous state of promos for toast message usage in "next()"
|
// Populate the previous state of promos for toast message usage in "next()"
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ export const mockProcessedCmsContent = {
|
||||||
HeaderText: "Premium service",
|
HeaderText: "Premium service",
|
||||||
SubheaderText: "",
|
SubheaderText: "",
|
||||||
BodyText:
|
BodyText:
|
||||||
"<ul><li>Expert windshield repair</li><li>Exclusive resin sealant</li><li>Nationwide lifetime guarantee</li><li>{if:custom:frontWipersApplicableForTierThree}{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateFrontWiperModal,front wiper blades}{else}New {textLink:EstimateFrontWiperModal,wiper blades}{end}{end}</li><li>{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateRearWiperModal,rear wiper blade}{end}</li><li>{if:custom:rainDefenseApplicableForTierThree}{textLink:EstimateRainDefenseModal,Rain Defense}™ treatment{end}</li></ul>",
|
"<ul><li>Expert windshield repair</li><li>Exclusive resin sealant</li><li>Nationwide lifetime guarantee</li><li>{if:custom:frontWipersApplicableForTierThree}{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateFrontWiperModal,front wiper blades}{else}New {textLink:EstimateFrontWiperModal,wiper blades}{end}{end}</li><li>{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateRearWiperModal,rear wiper blade}{end}</li><li>{if:custom:rainRepelApplicableForTierThree}{textLink:EstimateRainRepelModal,Rain Repel}™ treatment{end}</li></ul>",
|
||||||
Image: "",
|
Image: "",
|
||||||
FooterText: "",
|
FooterText: "",
|
||||||
},
|
},
|
||||||
|
|
@ -48,7 +48,7 @@ export const mockProcessedCmsContent = {
|
||||||
HeaderText: "Premium service",
|
HeaderText: "Premium service",
|
||||||
SubheaderText: "",
|
SubheaderText: "",
|
||||||
BodyText:
|
BodyText:
|
||||||
"<ul><li>New replacement windshield</li><li>Expert installation{if:custom:showRecalInServicePackages} and {textLink:EstimateRecalModal,recalibration}{end}</li><li>Nationwide lifetime warranty</li><li>{if:custom:frontWipersApplicableForTierThree}{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateFrontWiperModal,front wiper blades}{else}New {textLink:EstimateFrontWiperModal,wiper blades}{end}{end}</li><li>{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateRearWiperModal,rear wiper blade}{end}</li><li>{if:custom:rainDefenseApplicableForTierThree}{textLink:EstimateRainDefenseModal,Rain Defense}™ treatment{end}</li></ul>",
|
"<ul><li>New replacement windshield</li><li>Expert installation{if:custom:showRecalInServicePackages} and {textLink:EstimateRecalModal,recalibration}{end}</li><li>Nationwide lifetime warranty</li><li>{if:custom:frontWipersApplicableForTierThree}{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateFrontWiperModal,front wiper blades}{else}New {textLink:EstimateFrontWiperModal,wiper blades}{end}{end}</li><li>{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateRearWiperModal,rear wiper blade}{end}</li><li>{if:custom:rainRepelApplicableForTierThree}{textLink:EstimateRainRepelModal,Rain Repel}™ treatment{end}</li></ul>",
|
||||||
Image: "",
|
Image: "",
|
||||||
FooterText: "",
|
FooterText: "",
|
||||||
},
|
},
|
||||||
|
|
@ -75,7 +75,7 @@ export const mockProcessedCmsContent = {
|
||||||
HeaderText: "Premium service",
|
HeaderText: "Premium service",
|
||||||
SubheaderText: "",
|
SubheaderText: "",
|
||||||
BodyText:
|
BodyText:
|
||||||
"<ul><li>New replacement glass</li><li>Expert installation{if:custom:showRecalInServicePackages} and {textLink:EstimateRecalModal,recalibration}{end}</li><li>Nationwide lifetime warranty</li><li>{if:custom:frontWipersApplicableForTierThree}{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateFrontWiperModal,front wiper blades}{else}New {textLink:EstimateFrontWiperModal,wiper blades}{end}{end}</li><li>{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateRearWiperModal,rear wiper blade}{end}</li><li>{if:custom:rainDefenseApplicableForTierThree}{textLink:EstimateRainDefenseModal,Rain Defense}™ treatment{end}</li></ul>",
|
"<ul><li>New replacement glass</li><li>Expert installation{if:custom:showRecalInServicePackages} and {textLink:EstimateRecalModal,recalibration}{end}</li><li>Nationwide lifetime warranty</li><li>{if:custom:frontWipersApplicableForTierThree}{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateFrontWiperModal,front wiper blades}{else}New {textLink:EstimateFrontWiperModal,wiper blades}{end}{end}</li><li>{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateRearWiperModal,rear wiper blade}{end}</li><li>{if:custom:rainRepelApplicableForTierThree}{textLink:EstimateRainRepelModal,Rain Repel}™ treatment{end}</li></ul>",
|
||||||
Image: "",
|
Image: "",
|
||||||
FooterText: "",
|
FooterText: "",
|
||||||
},
|
},
|
||||||
|
|
@ -102,7 +102,7 @@ export const mockProcessedCmsContent = {
|
||||||
HeaderText: "Premium service",
|
HeaderText: "Premium service",
|
||||||
SubheaderText: "",
|
SubheaderText: "",
|
||||||
BodyText:
|
BodyText:
|
||||||
"<ul><li>New replacement glass</li><li>Expert installation{if:custom:showRecalInServicePackages} and {textLink:EstimateRecalModal,recalibration}{end}</li><li>Nationwide lifetime warranty</li><li>{if:custom:frontWipersApplicableForTierThree}{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateFrontWiperModal,front wiper blades}{else}New {textLink:EstimateFrontWiperModal,wiper blades}{end}{end}</li><li>{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateRearWiperModal,rear wiper blade}{end}</li><li>{if:custom:rainDefenseApplicableForTierThree}{textLink:EstimateRainDefenseModal,Rain Defense}™ treatment{end}</li></ul>",
|
"<ul><li>New replacement glass</li><li>Expert installation{if:custom:showRecalInServicePackages} and {textLink:EstimateRecalModal,recalibration}{end}</li><li>Nationwide lifetime warranty</li><li>{if:custom:frontWipersApplicableForTierThree}{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateFrontWiperModal,front wiper blades}{else}New {textLink:EstimateFrontWiperModal,wiper blades}{end}{end}</li><li>{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateRearWiperModal,rear wiper blade}{end}</li><li>{if:custom:rainRepelApplicableForTierThree}{textLink:EstimateRainRepelModal,Rain Repel}™ treatment{end}</li></ul>",
|
||||||
Image: "",
|
Image: "",
|
||||||
FooterText: "",
|
FooterText: "",
|
||||||
},
|
},
|
||||||
|
|
@ -129,7 +129,7 @@ export const mockProcessedCmsContent = {
|
||||||
HeaderText: "Premium service",
|
HeaderText: "Premium service",
|
||||||
SubheaderText: "",
|
SubheaderText: "",
|
||||||
BodyText:
|
BodyText:
|
||||||
"<ul><li>New replacement glass</li><li>Expert installation{if:custom:showRecalInServicePackages} and {textLink:EstimateRecalModal,recalibration}{end}</li><li>Nationwide lifetime warranty</li><li>{if:custom:frontWipersApplicableForTierThree}{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateFrontWiperModal,front wiper blades}{else}New {textLink:EstimateFrontWiperModal,wiper blades}{end}{end}</li><li>{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateRearWiperModal,rear wiper blade}{end}</li><li>{if:custom:rainDefenseApplicableForTierThree}{textLink:EstimateRainDefenseModal,Rain Defense}™ treatment{end}</li></ul>",
|
"<ul><li>New replacement glass</li><li>Expert installation{if:custom:showRecalInServicePackages} and {textLink:EstimateRecalModal,recalibration}{end}</li><li>Nationwide lifetime warranty</li><li>{if:custom:frontWipersApplicableForTierThree}{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateFrontWiperModal,front wiper blades}{else}New {textLink:EstimateFrontWiperModal,wiper blades}{end}{end}</li><li>{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateRearWiperModal,rear wiper blade}{end}</li><li>{if:custom:rainRepelApplicableForTierThree}{textLink:EstimateRainRepelModal,Rain Repel}™ treatment{end}</li></ul>",
|
||||||
Image: "",
|
Image: "",
|
||||||
FooterText: "",
|
FooterText: "",
|
||||||
},
|
},
|
||||||
|
|
@ -156,7 +156,7 @@ export const mockProcessedCmsContent = {
|
||||||
HeaderText: "Premium service",
|
HeaderText: "Premium service",
|
||||||
SubheaderText: "",
|
SubheaderText: "",
|
||||||
BodyText:
|
BodyText:
|
||||||
"<ul><li>New replacement glass</li><li>Expert installation{if:custom:showRecalInServicePackages} and {textLink:EstimateRecalModal,recalibration}{end}</li><li>Nationwide lifetime warranty</li><li>{if:custom:frontWipersApplicableForTierThree}{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateFrontWiperModal,front wiper blades}{else}New {textLink:EstimateFrontWiperModal,wiper blades}{end}{end}</li><li>{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateRearWiperModal,rear wiper blade}{end}</li><li>{if:custom:rainDefenseApplicableForTierThree}{textLink:EstimateRainDefenseModal,Rain Defense}™ treatment{end}</li></ul>",
|
"<ul><li>New replacement glass</li><li>Expert installation{if:custom:showRecalInServicePackages} and {textLink:EstimateRecalModal,recalibration}{end}</li><li>Nationwide lifetime warranty</li><li>{if:custom:frontWipersApplicableForTierThree}{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateFrontWiperModal,front wiper blades}{else}New {textLink:EstimateFrontWiperModal,wiper blades}{end}{end}</li><li>{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateRearWiperModal,rear wiper blade}{end}</li><li>{if:custom:rainRepelApplicableForTierThree}{textLink:EstimateRainRepelModal,Rain Repel}™ treatment{end}</li></ul>",
|
||||||
Image: "",
|
Image: "",
|
||||||
FooterText: "",
|
FooterText: "",
|
||||||
},
|
},
|
||||||
|
|
@ -183,7 +183,7 @@ export const mockProcessedCmsContent = {
|
||||||
HeaderText: "Premium service",
|
HeaderText: "Premium service",
|
||||||
SubheaderText: "",
|
SubheaderText: "",
|
||||||
BodyText:
|
BodyText:
|
||||||
"<ul><li>New replacement glass</li><li>Expert installation{if:custom:showRecalInServicePackages} and {textLink:EstimateRecalModal,recalibration}{end}</li><li>Nationwide lifetime warranty</li><li>{if:custom:frontWipersApplicableForTierThree}{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateFrontWiperModal,front wiper blades}{else}New {textLink:EstimateFrontWiperModal,wiper blades}{end}{end}</li><li>{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateRearWiperModal,rear wiper blade}{end}</li><li>{if:custom:rainDefenseApplicableForTierThree}{textLink:EstimateRainDefenseModal,Rain Defense}™ treatment{end}</li></ul>",
|
"<ul><li>New replacement glass</li><li>Expert installation{if:custom:showRecalInServicePackages} and {textLink:EstimateRecalModal,recalibration}{end}</li><li>Nationwide lifetime warranty</li><li>{if:custom:frontWipersApplicableForTierThree}{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateFrontWiperModal,front wiper blades}{else}New {textLink:EstimateFrontWiperModal,wiper blades}{end}{end}</li><li>{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateRearWiperModal,rear wiper blade}{end}</li><li>{if:custom:rainRepelApplicableForTierThree}{textLink:EstimateRainRepelModal,Rain Repel}™ treatment{end}</li></ul>",
|
||||||
Image: "",
|
Image: "",
|
||||||
FooterText: "",
|
FooterText: "",
|
||||||
},
|
},
|
||||||
|
|
@ -210,7 +210,7 @@ export const mockProcessedCmsContent = {
|
||||||
HeaderText: "Premium service",
|
HeaderText: "Premium service",
|
||||||
SubheaderText: "",
|
SubheaderText: "",
|
||||||
BodyText:
|
BodyText:
|
||||||
"<ul><li>New replacement glass</li><li>Expert installation{if:custom:showRecalInServicePackages} and {textLink:EstimateRecalModal,recalibration}{end}</li><li>Nationwide lifetime warranty</li><li>{if:custom:frontWipersApplicableForTierThree}{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateFrontWiperModal,front wiper blades}{else}New {textLink:EstimateFrontWiperModal,wiper blades}{end}{end}</li><li>{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateRearWiperModal,rear wiper blade}{end}</li><li>{if:custom:rainDefenseApplicableForTierThree}{textLink:EstimateRainDefenseModal,Rain Defense}™ treatment{end}</li></ul>",
|
"<ul><li>New replacement glass</li><li>Expert installation{if:custom:showRecalInServicePackages} and {textLink:EstimateRecalModal,recalibration}{end}</li><li>Nationwide lifetime warranty</li><li>{if:custom:frontWipersApplicableForTierThree}{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateFrontWiperModal,front wiper blades}{else}New {textLink:EstimateFrontWiperModal,wiper blades}{end}{end}</li><li>{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateRearWiperModal,rear wiper blade}{end}</li><li>{if:custom:rainRepelApplicableForTierThree}{textLink:EstimateRainRepelModal,Rain Repel}™ treatment{end}</li></ul>",
|
||||||
Image: "",
|
Image: "",
|
||||||
FooterText: "",
|
FooterText: "",
|
||||||
},
|
},
|
||||||
|
|
@ -237,7 +237,7 @@ export const mockProcessedCmsContent = {
|
||||||
HeaderText: "Premium service",
|
HeaderText: "Premium service",
|
||||||
SubheaderText: "",
|
SubheaderText: "",
|
||||||
BodyText:
|
BodyText:
|
||||||
"<ul><li>New replacement windshield</li><li>Expert installation{if:custom:showRecalInServicePackages} and {textLink:EstimateRecalModal,recalibration}{end}</li><li>Nationwide lifetime warranty</li><li>{if:custom:frontWipersApplicableForTierThree}{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateFrontWiperModal,front wiper blades}{else}New {textLink:EstimateFrontWiperModal,wiper blades}{end}{end}</li><li>{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateRearWiperModal,rear wiper blade}{end}</li><li>{if:custom:rainDefenseApplicableForTierThree}{textLink:EstimateRainDefenseModal,Rain Defense}™ treatment{end}</li></ul>",
|
"<ul><li>New replacement windshield</li><li>Expert installation{if:custom:showRecalInServicePackages} and {textLink:EstimateRecalModal,recalibration}{end}</li><li>Nationwide lifetime warranty</li><li>{if:custom:frontWipersApplicableForTierThree}{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateFrontWiperModal,front wiper blades}{else}New {textLink:EstimateFrontWiperModal,wiper blades}{end}{end}</li><li>{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateRearWiperModal,rear wiper blade}{end}</li><li>{if:custom:rainRepelApplicableForTierThree}{textLink:EstimateRainRepelModal,Rain Repel}™ treatment{end}</li></ul>",
|
||||||
Image: "",
|
Image: "",
|
||||||
FooterText: "",
|
FooterText: "",
|
||||||
},
|
},
|
||||||
|
|
@ -264,7 +264,7 @@ export const mockProcessedCmsContent = {
|
||||||
HeaderText: "Premium service",
|
HeaderText: "Premium service",
|
||||||
SubheaderText: "",
|
SubheaderText: "",
|
||||||
BodyText:
|
BodyText:
|
||||||
"<ul><li>{if:custom:badCustomValue}DO NOT SHOW{end}New replacement windshield</li><li>Expert installation{if:custom:showRecalInServicePackages} and {textLink:EstimateRecalModal,recalibration}{end}</li><li>Nationwide lifetime warranty</li><li>{if:custom:frontWipersApplicableForTierThree}{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateFrontWiperModal,front wiper blades}{else}New {textLink:EstimateFrontWiperModal,wiper blades}{end}{end}</li><li>{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateRearWiperModal,rear wiper blade}{end}</li><li>{if:custom:rainDefenseApplicableForTierThree}{textLink:EstimateRainDefenseModal,Rain Defense}™ treatment{end}</li></ul>",
|
"<ul><li>{if:custom:badCustomValue}DO NOT SHOW{end}New replacement windshield</li><li>Expert installation{if:custom:showRecalInServicePackages} and {textLink:EstimateRecalModal,recalibration}{end}</li><li>Nationwide lifetime warranty</li><li>{if:custom:frontWipersApplicableForTierThree}{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateFrontWiperModal,front wiper blades}{else}New {textLink:EstimateFrontWiperModal,wiper blades}{end}{end}</li><li>{if:custom:rearWiperApplicableForTierThree}New {textLink:EstimateRearWiperModal,rear wiper blade}{end}</li><li>{if:custom:rainRepelApplicableForTierThree}{textLink:EstimateRainRepelModal,Rain Repel}™ treatment{end}</li></ul>",
|
||||||
Image: "",
|
Image: "",
|
||||||
FooterText: "",
|
FooterText: "",
|
||||||
},
|
},
|
||||||
|
|
@ -332,7 +332,7 @@ export const expectedModifiedAnswers = {
|
||||||
buttonLabel: "Premium service",
|
buttonLabel: "Premium service",
|
||||||
buttonLabelSubCopy: "",
|
buttonLabelSubCopy: "",
|
||||||
buttonBodyCopy:
|
buttonBodyCopy:
|
||||||
"<ul><li>Expert windshield repair</li><li>Exclusive resin sealant</li><li>Nationwide lifetime guarantee</li><li>New {textLink:EstimateFrontWiperModal,wiper blades}</li><li></li><li>{textLink:EstimateRainDefenseModal,Rain Defense}™ treatment</li></ul>",
|
"<ul><li>Expert windshield repair</li><li>Exclusive resin sealant</li><li>Nationwide lifetime guarantee</li><li>New {textLink:EstimateFrontWiperModal,wiper blades}</li><li></li><li>{textLink:EstimateRainRepelModal,Rain Repel}™ treatment</li></ul>",
|
||||||
buttonAuxillaryCopy: "$621.40",
|
buttonAuxillaryCopy: "$621.40",
|
||||||
buttonFooterCopy: "",
|
buttonFooterCopy: "",
|
||||||
},
|
},
|
||||||
|
|
@ -362,7 +362,7 @@ export const expectedModifiedAnswers = {
|
||||||
buttonLabel: "Premium service",
|
buttonLabel: "Premium service",
|
||||||
buttonLabelSubCopy: "",
|
buttonLabelSubCopy: "",
|
||||||
buttonBodyCopy:
|
buttonBodyCopy:
|
||||||
"<ul><li>New replacement windshield</li><li>Expert installation and {textLink:EstimateRecalModal,recalibration}</li><li>Nationwide lifetime warranty</li><li>New {textLink:EstimateFrontWiperModal,wiper blades}</li><li></li><li>{textLink:EstimateRainDefenseModal,Rain Defense}™ treatment</li></ul>",
|
"<ul><li>New replacement windshield</li><li>Expert installation and {textLink:EstimateRecalModal,recalibration}</li><li>Nationwide lifetime warranty</li><li>New {textLink:EstimateFrontWiperModal,wiper blades}</li><li></li><li>{textLink:EstimateRainRepelModal,Rain Repel}™ treatment</li></ul>",
|
||||||
buttonAuxillaryCopy: "$621.40",
|
buttonAuxillaryCopy: "$621.40",
|
||||||
buttonFooterCopy: "",
|
buttonFooterCopy: "",
|
||||||
},
|
},
|
||||||
|
|
@ -452,7 +452,7 @@ export const expectedModifiedAnswers = {
|
||||||
buttonLabel: "Premium service",
|
buttonLabel: "Premium service",
|
||||||
buttonLabelSubCopy: "",
|
buttonLabelSubCopy: "",
|
||||||
buttonBodyCopy:
|
buttonBodyCopy:
|
||||||
"<ul><li>New replacement glass</li><li>Expert installation</li><li>Nationwide lifetime warranty</li><li>New {textLink:EstimateFrontWiperModal,front wiper blades}</li><li>New {textLink:EstimateRearWiperModal,rear wiper blade}</li><li>{textLink:EstimateRainDefenseModal,Rain Defense}™ treatment</li></ul>",
|
"<ul><li>New replacement glass</li><li>Expert installation</li><li>Nationwide lifetime warranty</li><li>New {textLink:EstimateFrontWiperModal,front wiper blades}</li><li>New {textLink:EstimateRearWiperModal,rear wiper blade}</li><li>{textLink:EstimateRainRepelModal,Rain Repel}™ treatment</li></ul>",
|
||||||
buttonAuxillaryCopy: "$495.88",
|
buttonAuxillaryCopy: "$495.88",
|
||||||
buttonFooterCopy: "",
|
buttonFooterCopy: "",
|
||||||
},
|
},
|
||||||
|
|
@ -482,7 +482,7 @@ export const expectedModifiedAnswers = {
|
||||||
buttonLabel: "Premium service",
|
buttonLabel: "Premium service",
|
||||||
buttonLabelSubCopy: "",
|
buttonLabelSubCopy: "",
|
||||||
buttonBodyCopy:
|
buttonBodyCopy:
|
||||||
"<ul><li>New replacement glass</li><li>Expert installation</li><li>Nationwide lifetime warranty</li><li></li><li>New {textLink:EstimateRearWiperModal,rear wiper blade}</li><li>{textLink:EstimateRainDefenseModal,Rain Defense}™ treatment</li></ul>",
|
"<ul><li>New replacement glass</li><li>Expert installation</li><li>Nationwide lifetime warranty</li><li></li><li>New {textLink:EstimateRearWiperModal,rear wiper blade}</li><li>{textLink:EstimateRainRepelModal,Rain Repel}™ treatment</li></ul>",
|
||||||
buttonAuxillaryCopy: "$410.20",
|
buttonAuxillaryCopy: "$410.20",
|
||||||
buttonFooterCopy: "",
|
buttonFooterCopy: "",
|
||||||
},
|
},
|
||||||
|
|
@ -512,7 +512,7 @@ export const expectedModifiedAnswers = {
|
||||||
buttonLabel: "Premium service",
|
buttonLabel: "Premium service",
|
||||||
buttonLabelSubCopy: "",
|
buttonLabelSubCopy: "",
|
||||||
buttonBodyCopy:
|
buttonBodyCopy:
|
||||||
"<ul><li>New replacement glass</li><li>Expert installation</li><li>Nationwide lifetime warranty</li><li>New {textLink:EstimateFrontWiperModal,wiper blades}</li><li></li><li>{textLink:EstimateRainDefenseModal,Rain Defense}™ treatment</li></ul>",
|
"<ul><li>New replacement glass</li><li>Expert installation</li><li>Nationwide lifetime warranty</li><li>New {textLink:EstimateFrontWiperModal,wiper blades}</li><li></li><li>{textLink:EstimateRainRepelModal,Rain Repel}™ treatment</li></ul>",
|
||||||
buttonAuxillaryCopy: "$471.40",
|
buttonAuxillaryCopy: "$471.40",
|
||||||
buttonFooterCopy: "",
|
buttonFooterCopy: "",
|
||||||
},
|
},
|
||||||
|
|
@ -532,7 +532,7 @@ export const expectedModifiedAnswers = {
|
||||||
buttonLabel: "Premium service",
|
buttonLabel: "Premium service",
|
||||||
buttonLabelSubCopy: "",
|
buttonLabelSubCopy: "",
|
||||||
buttonBodyCopy:
|
buttonBodyCopy:
|
||||||
"<ul><li>New replacement glass</li><li>Expert installation</li><li>Nationwide lifetime warranty</li><li>New {textLink:EstimateFrontWiperModal,wiper blades}</li><li></li><li>{textLink:EstimateRainDefenseModal,Rain Defense}™ treatment</li></ul>",
|
"<ul><li>New replacement glass</li><li>Expert installation</li><li>Nationwide lifetime warranty</li><li>New {textLink:EstimateFrontWiperModal,wiper blades}</li><li></li><li>{textLink:EstimateRainRepelModal,Rain Repel}™ treatment</li></ul>",
|
||||||
buttonAuxillaryCopy: "$471.40",
|
buttonAuxillaryCopy: "$471.40",
|
||||||
buttonFooterCopy: "",
|
buttonFooterCopy: "",
|
||||||
},
|
},
|
||||||
|
|
@ -552,7 +552,7 @@ export const expectedModifiedAnswers = {
|
||||||
buttonLabel: "Premium service",
|
buttonLabel: "Premium service",
|
||||||
buttonLabelSubCopy: "",
|
buttonLabelSubCopy: "",
|
||||||
buttonBodyCopy:
|
buttonBodyCopy:
|
||||||
"<ul><li>New replacement windshield</li><li>Expert installation</li><li>Nationwide lifetime warranty</li><li></li><li></li><li>{textLink:EstimateRainDefenseModal,Rain Defense}™ treatment</li></ul>",
|
"<ul><li>New replacement windshield</li><li>Expert installation</li><li>Nationwide lifetime warranty</li><li></li><li></li><li>{textLink:EstimateRainRepelModal,Rain Repel}™ treatment</li></ul>",
|
||||||
buttonAuxillaryCopy: "$385.72",
|
buttonAuxillaryCopy: "$385.72",
|
||||||
buttonFooterCopy: "",
|
buttonFooterCopy: "",
|
||||||
},
|
},
|
||||||
|
|
@ -572,7 +572,7 @@ export const expectedModifiedAnswers = {
|
||||||
buttonLabel: "Premium service",
|
buttonLabel: "Premium service",
|
||||||
buttonLabelSubCopy: "",
|
buttonLabelSubCopy: "",
|
||||||
buttonBodyCopy:
|
buttonBodyCopy:
|
||||||
"<ul><li>New replacement windshield</li><li>Expert installation</li><li>Nationwide lifetime warranty</li><li></li><li></li><li>{textLink:EstimateRainDefenseModal,Rain Defense}™ treatment</li></ul>",
|
"<ul><li>New replacement windshield</li><li>Expert installation</li><li>Nationwide lifetime warranty</li><li></li><li></li><li>{textLink:EstimateRainRepelModal,Rain Repel}™ treatment</li></ul>",
|
||||||
buttonAuxillaryCopy: "$385.72",
|
buttonAuxillaryCopy: "$385.72",
|
||||||
buttonFooterCopy: "",
|
buttonFooterCopy: "",
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -67,9 +67,9 @@ describe("service-package-question.vue", () => {
|
||||||
price: 350.22,
|
price: 350.22,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
partNumber: "RAIN DEFENSE",
|
partNumber: "RAIN REPEL",
|
||||||
description: null,
|
description: null,
|
||||||
partType: "RAIN DEFENSE",
|
partType: "RAIN REPEL",
|
||||||
price: 35.5,
|
price: 35.5,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -128,8 +128,8 @@ describe("service-package-question.vue", () => {
|
||||||
expect(wrapper.emitted()["vapsItemsSelected"][0][0]).toEqual([
|
expect(wrapper.emitted()["vapsItemsSelected"][0][0]).toEqual([
|
||||||
{
|
{
|
||||||
description: null,
|
description: null,
|
||||||
partNumber: "RAIN DEFENSE",
|
partNumber: "RAIN REPEL",
|
||||||
partType: "RAIN DEFENSE",
|
partType: "RAIN REPEL",
|
||||||
price: 35.5,
|
price: 35.5,
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
@ -296,9 +296,9 @@ describe("service-package-question.vue", () => {
|
||||||
// Assert
|
// Assert
|
||||||
expect(wrapper.vm.selectedPackageName).toBe("TierOne");
|
expect(wrapper.vm.selectedPackageName).toBe("TierOne");
|
||||||
});
|
});
|
||||||
it("should select TierThree default package if Rain Defense is on order", async () => {
|
it("should select TierThree default package if Rain Repel is on order", async () => {
|
||||||
// This tests the business intent that when returning to the page, the selected package is the lowest package that contains all VAPs on the order.
|
// This tests the business intent that when returning to the page, the selected package is the lowest package that contains all VAPs on the order.
|
||||||
// In this case Rain Defense is only in Premium so Tier Three should be defaulted to
|
// In this case Rain Repel is only in Premium so Tier Three should be defaulted to
|
||||||
const wrapper = setupMocks({
|
const wrapper = setupMocks({
|
||||||
mountOptionsMockData: {
|
mountOptionsMockData: {
|
||||||
store: {
|
store: {
|
||||||
|
|
@ -320,8 +320,8 @@ describe("service-package-question.vue", () => {
|
||||||
],
|
],
|
||||||
vaps: [
|
vaps: [
|
||||||
{
|
{
|
||||||
partNumber: "RAIN DEFENSE",
|
partNumber: "RAIN REPEL",
|
||||||
partType: "RAIN DEFENSE",
|
partType: "RAIN REPEL",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
supportingItems: [
|
supportingItems: [
|
||||||
|
|
@ -455,9 +455,9 @@ describe("service-package-question.vue, matching business rules for package disp
|
||||||
price: 350.22,
|
price: 350.22,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
partNumber: "RAIN DEFENSE",
|
partNumber: "RAIN REPEL",
|
||||||
description: null,
|
description: null,
|
||||||
partType: "RAIN DEFENSE",
|
partType: "RAIN REPEL",
|
||||||
price: 35.5,
|
price: 35.5,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ import { storeMutations } from "@/constants/store-mutations";
|
||||||
import {
|
import {
|
||||||
shouldFrontWipersBeAvailable,
|
shouldFrontWipersBeAvailable,
|
||||||
shouldRearWipersBeAvailable,
|
shouldRearWipersBeAvailable,
|
||||||
shouldRainDefenseBeAvailable,
|
shouldRainRepelBeAvailable,
|
||||||
getAvailablePackages,
|
getAvailablePackages,
|
||||||
getHighestRequiredTier,
|
getHighestRequiredTier,
|
||||||
getPackageContents,
|
getPackageContents,
|
||||||
|
|
@ -212,8 +212,8 @@ export default {
|
||||||
packageNames.TIER_THREE
|
packageNames.TIER_THREE
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
rainDefenseApplicableForTierThree() {
|
rainRepelApplicableForTierThree() {
|
||||||
return shouldRainDefenseBeAvailable(
|
return shouldRainRepelBeAvailable(
|
||||||
this.glassToReplace,
|
this.glassToReplace,
|
||||||
this.nullSafeAvailableLineItems,
|
this.nullSafeAvailableLineItems,
|
||||||
this.isRepair,
|
this.isRepair,
|
||||||
|
|
@ -429,8 +429,8 @@ export default {
|
||||||
return this.frontWipersApplicableForTierThree;
|
return this.frontWipersApplicableForTierThree;
|
||||||
case "rearWiperApplicableForTierThree":
|
case "rearWiperApplicableForTierThree":
|
||||||
return this.rearWiperApplicableForTierThree;
|
return this.rearWiperApplicableForTierThree;
|
||||||
case "rainDefenseApplicableForTierThree":
|
case "rainRepelApplicableForTierThree":
|
||||||
return this.rainDefenseApplicableForTierThree;
|
return this.rainRepelApplicableForTierThree;
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -576,8 +576,8 @@ export default {
|
||||||
lineItem.partType.indexOf("REAR WIPER") !== -1
|
lineItem.partType.indexOf("REAR WIPER") !== -1
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
var rainDefense = vaps.filter(function (lineItem) {
|
var rainRepel = vaps.filter(function (lineItem) {
|
||||||
return lineItem.partType.indexOf("RAIN DEFENSE") !== -1;
|
return lineItem.partType.indexOf("RAIN REPEL") !== -1;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Combine line items
|
// Combine line items
|
||||||
|
|
@ -600,8 +600,8 @@ export default {
|
||||||
if (wipers) {
|
if (wipers) {
|
||||||
combinedLineItems = combinedLineItems.concat(wipers);
|
combinedLineItems = combinedLineItems.concat(wipers);
|
||||||
}
|
}
|
||||||
if (rainDefense) {
|
if (rainRepel) {
|
||||||
combinedLineItems = combinedLineItems.concat(rainDefense);
|
combinedLineItems = combinedLineItems.concat(rainRepel);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Remove child Parts if any
|
//Remove child Parts if any
|
||||||
|
|
|
||||||
|
|
@ -62,11 +62,11 @@ const parts = {
|
||||||
laborAmount: 0,
|
laborAmount: 0,
|
||||||
salesTax: 2,
|
salesTax: 2,
|
||||||
},
|
},
|
||||||
rainDefense: {
|
rainRepel: {
|
||||||
name: "rain defense",
|
name: "rain repel",
|
||||||
partNumber: "RAIN DEFENSE",
|
partNumber: "RAIN REPEL",
|
||||||
description: null,
|
description: null,
|
||||||
partType: "RAIN DEFENSE",
|
partType: "RAIN REPEL",
|
||||||
sellingPrice: 35.5,
|
sellingPrice: 35.5,
|
||||||
kitPrice: 0,
|
kitPrice: 0,
|
||||||
laborAmount: 0,
|
laborAmount: 0,
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ export default {
|
||||||
return (
|
return (
|
||||||
lineItem.partType != partTypeStrings.FRONT_WIPER &&
|
lineItem.partType != partTypeStrings.FRONT_WIPER &&
|
||||||
lineItem.partType != partTypeStrings.REAR_WIPER &&
|
lineItem.partType != partTypeStrings.REAR_WIPER &&
|
||||||
lineItem.partType != partTypeStrings.RAIN_DEFENSE
|
lineItem.partType != partTypeStrings.RAIN_REPEL
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1746,10 +1746,10 @@ export const actions = {
|
||||||
return response;
|
return response;
|
||||||
},
|
},
|
||||||
|
|
||||||
async getRainDefense(context, { pageNameToLog }) {
|
async getRainRepel(context, { pageNameToLog }) {
|
||||||
const response = await globalMethods.callHttpClient({
|
const response = await globalMethods.callHttpClient({
|
||||||
method: endpoints.GetRainDefense.method,
|
method: endpoints.GetRainRepel.method,
|
||||||
endpoint: endpoints.GetRainDefense.url,
|
endpoint: endpoints.GetRainRepel.url,
|
||||||
logApiCall: true,
|
logApiCall: true,
|
||||||
pageNameToLog: pageNameToLog,
|
pageNameToLog: pageNameToLog,
|
||||||
});
|
});
|
||||||
|
|
@ -3024,7 +3024,7 @@ export const actions = {
|
||||||
return pricedLineItems;
|
return pricedLineItems;
|
||||||
},
|
},
|
||||||
|
|
||||||
// The <addableVaps> parameter is an array of ALL available front wipers and rain defense
|
// The <addableVaps> parameter is an array of ALL available front wipers and Rain Repel
|
||||||
// for the vehicle. There is no need to confirm an addableVap is not already on the order
|
// for the vehicle. There is no need to confirm an addableVap is not already on the order
|
||||||
// <lineItemsToUse> is an optional parameter if the lineItems in the store may not be up to date
|
// <lineItemsToUse> is an optional parameter if the lineItems in the store may not be up to date
|
||||||
async validateOrderPromoAndSaveServerData(
|
async validateOrderPromoAndSaveServerData(
|
||||||
|
|
|
||||||
|
|
@ -123,8 +123,8 @@ $body-color: $gray-600;
|
||||||
|
|
||||||
//Fonts
|
//Fonts
|
||||||
$font-family-sans-serif: UrbanistRegular, Arial, Helvetica, sans-serif;
|
$font-family-sans-serif: UrbanistRegular, Arial, Helvetica, sans-serif;
|
||||||
$font-family-monospace:
|
$font-family-monospace: UrbanistRegular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
|
||||||
UrbanistRegular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
monospace;
|
||||||
// stylelint-enable value-keyword-case
|
// stylelint-enable value-keyword-case
|
||||||
$font-family-base: $font-family-sans-serif;
|
$font-family-base: $font-family-sans-serif;
|
||||||
$font-family-code: $font-family-monospace;
|
$font-family-code: $font-family-monospace;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue