Merge pull request #1973 from Safelite/feature/CSR-2179-ajc
Feature/CSR-2179-ajc
This commit is contained in:
commit
cb4d85b48d
7 changed files with 28 additions and 52 deletions
|
|
@ -305,9 +305,9 @@ export default {
|
||||||
if (!this.lineItems || this.lineItems.length < 1) return;
|
if (!this.lineItems || this.lineItems.length < 1) return;
|
||||||
|
|
||||||
const lineItemsCopy = deepClone(this.lineItems);
|
const lineItemsCopy = deepClone(this.lineItems);
|
||||||
lineItemsCopy.supportingItems = lineItemsCopy.supportingItems ? baseMixin.methods.filterOutRecalibration(
|
lineItemsCopy.supportingItems = lineItemsCopy.supportingItems
|
||||||
lineItemsCopy?.supportingItems
|
? baseMixin.methods.filterOutRecalibration(lineItemsCopy?.supportingItems)
|
||||||
) : [];
|
: [];
|
||||||
return lineItemsCopy;
|
return lineItemsCopy;
|
||||||
},
|
},
|
||||||
showCoverageAsPending() {
|
showCoverageAsPending() {
|
||||||
|
|
@ -438,13 +438,15 @@ export default {
|
||||||
packagePrice() {
|
packagePrice() {
|
||||||
let packagePrice = 0;
|
let packagePrice = 0;
|
||||||
|
|
||||||
if (!this.isInsurance && this.shouldHideRecalibration) { // Update packagePrice if Cash only && is part of RemoveRecal experiment
|
if (!this.isInsurance && this.shouldHideRecalibration) {
|
||||||
|
// Update packagePrice if Cash only && is part of RemoveRecal experiment
|
||||||
packagePrice = baseMixin.methods.getTierOnePackagePrice(
|
packagePrice = baseMixin.methods.getTierOnePackagePrice(
|
||||||
baseMixin.methods.filterOutFees(
|
baseMixin.methods.filterOutFees(
|
||||||
baseMixin.methods.filterOutRecalibration(this.availableLineItems) // Strip out recal before filtering out fees
|
baseMixin.methods.filterOutRecalibration(this.availableLineItems) // Strip out recal before filtering out fees
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
} else if (!this.showCoverageAsVerified && !this.showCoverageAsPending) { // Update packagePrice if is verified insurance OR if Cash && not part of RemoveRecal experiment
|
} else if (!this.showCoverageAsVerified && !this.showCoverageAsPending) {
|
||||||
|
// Update packagePrice if is verified insurance OR if Cash && not part of RemoveRecal experiment
|
||||||
packagePrice = baseMixin.methods.getTierOnePackagePrice(
|
packagePrice = baseMixin.methods.getTierOnePackagePrice(
|
||||||
baseMixin.methods.filterOutFees(this.availableLineItems)
|
baseMixin.methods.filterOutFees(this.availableLineItems)
|
||||||
);
|
);
|
||||||
|
|
@ -1001,7 +1003,7 @@ export default {
|
||||||
if (!this.lineItems || this.lineItems.length < 1) return;
|
if (!this.lineItems || this.lineItems.length < 1) return;
|
||||||
return this.isInsurance || !this.shouldHideRecalibration
|
return this.isInsurance || !this.shouldHideRecalibration
|
||||||
? baseMixin.methods.getSubTotal(this.lineItems) // calculate with recal (if on order)
|
? baseMixin.methods.getSubTotal(this.lineItems) // calculate with recal (if on order)
|
||||||
: baseMixin.methods.getSubTotal(this.lineItemsWithoutRecal); // calculated without recal
|
: baseMixin.methods.getSubTotal(this.lineItemsWithoutRecal); // calculate without recal
|
||||||
},
|
},
|
||||||
salesTax() {
|
salesTax() {
|
||||||
if (!this.lineItems || this.lineItems.length < 1) return;
|
if (!this.lineItems || this.lineItems.length < 1) return;
|
||||||
|
|
|
||||||
|
|
@ -170,9 +170,7 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
shouldHideRecalibration() {
|
shouldHideRecalibration() {
|
||||||
return this.getSettingValue(
|
return this.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE);
|
||||||
experimentSettings.RECAL_PRICE_REMOVE
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
ShowCart() {
|
ShowCart() {
|
||||||
if (this.isPia && this.submittedOrder?.settledTenderAmount == 0) {
|
if (this.isPia && this.submittedOrder?.settledTenderAmount == 0) {
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,9 @@
|
||||||
class="service-questions" />
|
class="service-questions" />
|
||||||
<textBlock cmsWidgetName="CallOrTextWidget" justifyText="left" />
|
<textBlock cmsWidgetName="CallOrTextWidget" justifyText="left" />
|
||||||
<hr class="my-5" />
|
<hr class="my-5" />
|
||||||
<div class="d-flex flex-row checkbox-group" v-if="isRecalibrationOnOrder && shouldHideRecalibration">
|
<div
|
||||||
|
class="d-flex flex-row checkbox-group"
|
||||||
|
v-if="isRecalibrationOnOrder && shouldHideRecalibration">
|
||||||
<checkboxQuestion
|
<checkboxQuestion
|
||||||
cmsWidgetName="RecalConfirmWidget"
|
cmsWidgetName="RecalConfirmWidget"
|
||||||
class="mb-5"
|
class="mb-5"
|
||||||
|
|
@ -592,9 +594,7 @@ export default {
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
shouldHideRecalibration() {
|
shouldHideRecalibration() {
|
||||||
return this.getSettingValue(
|
return this.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE);
|
||||||
experimentSettings.RECAL_PRICE_REMOVE
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
showApplePay() {
|
showApplePay() {
|
||||||
return baseMixin.methods.showApplePay();
|
return baseMixin.methods.showApplePay();
|
||||||
|
|
|
||||||
|
|
@ -750,7 +750,10 @@ function setupMocks({ customMountOptions }) {
|
||||||
baseMixin.methods.ResetExternalParamsAndHideModal = jest.fn();
|
baseMixin.methods.ResetExternalParamsAndHideModal = jest.fn();
|
||||||
baseMixin.methods.isFormValid = jest.fn().mockReturnValue(true);
|
baseMixin.methods.isFormValid = jest.fn().mockReturnValue(true);
|
||||||
mountOptions.global.mocks["$store"] = store;
|
mountOptions.global.mocks["$store"] = store;
|
||||||
|
store.getters.experimentSettings = "test value";
|
||||||
|
|
||||||
mountOptions["attachTo"] = document.body;
|
mountOptions["attachTo"] = document.body;
|
||||||
|
|
||||||
const wrapper = shallowMount(quote, mountOptions);
|
const wrapper = shallowMount(quote, mountOptions);
|
||||||
wrapper.vm.setCmsContent = jest.fn();
|
wrapper.vm.setCmsContent = jest.fn();
|
||||||
return { wrapper };
|
return { wrapper };
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@
|
||||||
groupName="ServicePackageQuestion"
|
groupName="ServicePackageQuestion"
|
||||||
:availableLineItems="availableLineItems"
|
:availableLineItems="availableLineItems"
|
||||||
:isInsuranceSelected="isInsuranceSelected"
|
:isInsuranceSelected="isInsuranceSelected"
|
||||||
|
:isRecalibrationOnOrder="isRecalibrationOnOrder"
|
||||||
|
:shouldHideRecalibration="shouldHideRecalibration"
|
||||||
@vapsItemsSelected="vapsItemsSelectedAction"
|
@vapsItemsSelected="vapsItemsSelectedAction"
|
||||||
@servicePackageDiscountSelected="servicePackageDiscountSelectedAction"
|
@servicePackageDiscountSelected="servicePackageDiscountSelectedAction"
|
||||||
:servicePackage="servicePackage"
|
:servicePackage="servicePackage"
|
||||||
|
|
@ -138,9 +140,6 @@ export default {
|
||||||
async beforeRouteEnter(to, from, next) {
|
async beforeRouteEnter(to, from, next) {
|
||||||
// Call APIs
|
// Call APIs
|
||||||
const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage);
|
const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage);
|
||||||
const experimentForLogging = store.getters.applicationUser.experiments.find(
|
|
||||||
(e) => e.universeName === experimentUniverses.RECAL_PRICE_REMOVAL
|
|
||||||
);
|
|
||||||
const wipersPromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
const wipersPromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
||||||
storeActions.GET_WIPERS,
|
storeActions.GET_WIPERS,
|
||||||
{
|
{
|
||||||
|
|
@ -208,33 +207,6 @@ export default {
|
||||||
...servicePackageDiscountPart,
|
...servicePackageDiscountPart,
|
||||||
];
|
];
|
||||||
|
|
||||||
// If the recal experiment is found then log the experiment exposure.
|
|
||||||
const isRecalibrationOnOrder = containsLineItemWithPartType(
|
|
||||||
partTypeStrings.RECALIBRATION,
|
|
||||||
availableLineItems
|
|
||||||
);
|
|
||||||
const canSafeliteRecalibrate = nullSafeGlassParts.some((glassPart) => {
|
|
||||||
return glassPart.partType === "WINDSHIELD" && glassPart.canSafeliteRecalibrate;
|
|
||||||
});
|
|
||||||
if (
|
|
||||||
experimentForLogging !== undefined &&
|
|
||||||
isRecalibrationOnOrder &&
|
|
||||||
canSafeliteRecalibrate
|
|
||||||
) {
|
|
||||||
// Log experiment exposure
|
|
||||||
baseMixin.methods.dispatchStoreActionWithLogging(
|
|
||||||
storeActions.LOG_EXPERIMENT_EXPOSURE,
|
|
||||||
{
|
|
||||||
userId: getUserIdValue(),
|
|
||||||
sessionKey: getSessionKeyValue(),
|
|
||||||
pageName: to.query.fmgPage,
|
|
||||||
experiment: experimentForLogging,
|
|
||||||
},
|
|
||||||
"quote",
|
|
||||||
false
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// When calling pricing from the quote page, always use the cash parent account
|
// When calling pricing from the quote page, always use the cash parent account
|
||||||
baseMixin.methods.dispatchStoreAction(
|
baseMixin.methods.dispatchStoreAction(
|
||||||
storeActions.SAVE_PARENT_ACCOUNT_NUMBER,
|
storeActions.SAVE_PARENT_ACCOUNT_NUMBER,
|
||||||
|
|
@ -366,10 +338,13 @@ export default {
|
||||||
return recalSettingValue;
|
return recalSettingValue;
|
||||||
},
|
},
|
||||||
showAfterpayBanner() {
|
showAfterpayBanner() {
|
||||||
return !this.isInsuranceSelected && (!this.isRecalibrationOnOrder || !this.shouldHideRecalibration)
|
return (
|
||||||
|
!this.isInsuranceSelected &&
|
||||||
|
(!this.isRecalibrationOnOrder || !this.shouldHideRecalibration)
|
||||||
|
);
|
||||||
},
|
},
|
||||||
showRecalDisclaimer() {
|
showRecalDisclaimer() {
|
||||||
return this.isRecalibrationOnOrder && this.shouldHideRecalibration
|
return this.isRecalibrationOnOrder && this.shouldHideRecalibration;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
||||||
|
|
@ -475,6 +475,7 @@ describe("service-package-question.vue, matching business rules for package disp
|
||||||
mockProps.availableLineItems.push(recalLineItem);
|
mockProps.availableLineItems.push(recalLineItem);
|
||||||
mockProps.availableLineItems.push(driverFrontWiperLineItem);
|
mockProps.availableLineItems.push(driverFrontWiperLineItem);
|
||||||
mockProps.availableLineItems.push(passengerFrontWiperLineItem);
|
mockProps.availableLineItems.push(passengerFrontWiperLineItem);
|
||||||
|
mockProps.isRecalibrationOnOrder = true;
|
||||||
Object.assign(processedCmsContent, mockProcessedCmsContent[packageNameKey]);
|
Object.assign(processedCmsContent, mockProcessedCmsContent[packageNameKey]);
|
||||||
const wrapper = setupMocks({
|
const wrapper = setupMocks({
|
||||||
mountOptionsMockData: {
|
mountOptionsMockData: {
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,8 @@ export default {
|
||||||
availableLineItems: null,
|
availableLineItems: null,
|
||||||
activePromos: null,
|
activePromos: null,
|
||||||
servicePackage: null,
|
servicePackage: null,
|
||||||
|
isRecalibrationOnOrder: Boolean,
|
||||||
|
shouldHideRecalibration: Boolean,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -141,12 +143,6 @@ export default {
|
||||||
}));
|
}));
|
||||||
return modifiedAnswers;
|
return modifiedAnswers;
|
||||||
},
|
},
|
||||||
isRecalibrationOnOrder() {
|
|
||||||
return containsLineItemWithPartType(
|
|
||||||
partTypeStrings.RECALIBRATION,
|
|
||||||
this.nullSafeAvailableLineItems
|
|
||||||
);
|
|
||||||
},
|
|
||||||
isServicePackageDiscountOnOrder() {
|
isServicePackageDiscountOnOrder() {
|
||||||
return containsLineItemWithPartType(
|
return containsLineItemWithPartType(
|
||||||
partTypeStrings.SERVICE_PACKAGE_DISCOUNT,
|
partTypeStrings.SERVICE_PACKAGE_DISCOUNT,
|
||||||
|
|
@ -242,7 +238,8 @@ export default {
|
||||||
},
|
},
|
||||||
getPackagePrice(packageName, { discountedPrice = false, servicePackageDiscount = false }) {
|
getPackagePrice(packageName, { discountedPrice = false, servicePackageDiscount = false }) {
|
||||||
var lineItemsToPrice = [...this.nullSafeAvailableLineItems];
|
var lineItemsToPrice = [...this.nullSafeAvailableLineItems];
|
||||||
if (this.isRecalibrationOnOrder) {
|
|
||||||
|
if (this.isRecalibrationOnOrder && this.shouldHideRecalibration) {
|
||||||
lineItemsToPrice = lineItemsToPrice.filter((item) => {
|
lineItemsToPrice = lineItemsToPrice.filter((item) => {
|
||||||
return item.partType != partTypeStrings.RECALIBRATION;
|
return item.partType != partTypeStrings.RECALIBRATION;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue