Merge pull request #1828 from Safelite/feature/Digital/CSR-1953
CSR-1953
This commit is contained in:
commit
90bc8e06af
2 changed files with 43 additions and 28 deletions
|
|
@ -262,12 +262,23 @@ export default {
|
||||||
isPricingAvailable &&
|
isPricingAvailable &&
|
||||||
combinedLineItems.every((lineItem) => isDefined(lineItem.salesTax));
|
combinedLineItems.every((lineItem) => isDefined(lineItem.salesTax));
|
||||||
|
|
||||||
|
//unverified (in scenarios we don’t display the price)
|
||||||
if (
|
if (
|
||||||
order.payment.isInsurance &&
|
order.payment.isInsurance &&
|
||||||
isDefined(order.payment.insuranceCoverage.isVerified) &&
|
isDefined(order.payment.insuranceCoverage.isVerified) &&
|
||||||
!order.payment.insuranceCoverage.isVerified
|
!order.payment.insuranceCoverage.isVerified
|
||||||
) {
|
) {
|
||||||
payload.priceSubTotal = null;
|
payload.priceSubTotal = "";
|
||||||
|
}
|
||||||
|
//deductible (in scenarios we don’t display the price)
|
||||||
|
else if (
|
||||||
|
order.payment.isInsurance &&
|
||||||
|
isDefined(order.payment.insuranceCoverage.isVerified) &&
|
||||||
|
order.payment.insuranceCoverage.isVerified &&
|
||||||
|
isDefined(order.policy.currentDeductible) &&
|
||||||
|
order.policy.currentDeductible == 0
|
||||||
|
) {
|
||||||
|
payload.priceSubTotal = "";
|
||||||
} else if (isPricingAvailable) {
|
} else if (isPricingAvailable) {
|
||||||
const subtotal = baseMixin.methods
|
const subtotal = baseMixin.methods
|
||||||
.getTotalPriceOfAllLineItemsAndChildParts(combinedLineItems, false)
|
.getTotalPriceOfAllLineItemsAndChildParts(combinedLineItems, false)
|
||||||
|
|
@ -277,12 +288,23 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
payload.priceSubTotal = "";
|
payload.priceSubTotal = "";
|
||||||
}
|
}
|
||||||
|
//unverified (in scenarios we don’t display the price)
|
||||||
if (
|
if (
|
||||||
order.payment.isInsurance &&
|
order.payment.isInsurance &&
|
||||||
isDefined(order.payment.insuranceCoverage.isVerified) &&
|
isDefined(order.payment.insuranceCoverage.isVerified) &&
|
||||||
!order.payment.insuranceCoverage.isVerified
|
!order.payment.insuranceCoverage.isVerified
|
||||||
) {
|
) {
|
||||||
payload.priceTotal = null;
|
payload.priceTotal = "";
|
||||||
|
}
|
||||||
|
//deductible (in scenarios we don’t display the price)
|
||||||
|
else if (
|
||||||
|
order.payment.isInsurance &&
|
||||||
|
isDefined(order.payment.insuranceCoverage.isVerified) &&
|
||||||
|
order.payment.insuranceCoverage.isVerified &&
|
||||||
|
isDefined(order.policy.currentDeductible) &&
|
||||||
|
order.policy.currentDeductible == 0
|
||||||
|
) {
|
||||||
|
payload.priceTotal = "";
|
||||||
} else if (isTaxAvailable) {
|
} else if (isTaxAvailable) {
|
||||||
const total = baseMixin.methods
|
const total = baseMixin.methods
|
||||||
.getTotalPriceOfAllLineItemsAndChildParts(combinedLineItems, true)
|
.getTotalPriceOfAllLineItemsAndChildParts(combinedLineItems, true)
|
||||||
|
|
@ -310,26 +332,26 @@ export default {
|
||||||
if (order.payment.isInsurance) {
|
if (order.payment.isInsurance) {
|
||||||
payload.isInsuranceVerified = order.payment.insuranceCoverage.isVerified;
|
payload.isInsuranceVerified = order.payment.insuranceCoverage.isVerified;
|
||||||
if (!order.payment.insuranceCoverage.isVerified) {
|
if (!order.payment.insuranceCoverage.isVerified) {
|
||||||
payload.isInsuranceItac = null;
|
payload.isInsuranceItac = "";
|
||||||
payload.isInsuranceNoComp = null;
|
payload.isInsuranceNoComp = "";
|
||||||
} else {
|
} else {
|
||||||
payload.isInsuranceItac = order.policy.isItac || null;
|
payload.isInsuranceItac = order.policy.isItac || "";
|
||||||
payload.isInsuranceNoComp = order.policy.isNoComp || null;
|
payload.isInsuranceNoComp = order.policy.isNoComp || "";
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
order.policy.isItac ||
|
order.policy.isItac ||
|
||||||
order.policy.isNoComp ||
|
order.policy.isNoComp ||
|
||||||
!order.payment.insuranceCoverage.isVerified
|
!order.payment.insuranceCoverage.isVerified
|
||||||
) {
|
) {
|
||||||
payload.insuranceDeductible = null;
|
payload.insuranceDeductible = "";
|
||||||
} else {
|
} else {
|
||||||
payload.insuranceDeductible = order.policy.currentDeductible || null;
|
payload.insuranceDeductible = order.policy.currentDeductible || "";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
payload.isInsuranceVerified = null;
|
payload.isInsuranceVerified = "";
|
||||||
payload.insuranceDeductible = null;
|
payload.insuranceDeductible = "";
|
||||||
payload.isInsuranceItac = null;
|
payload.isInsuranceItac = "";
|
||||||
payload.isInsuranceNoComp = null;
|
payload.isInsuranceNoComp = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
pushToDataLayerIfDefined(payload);
|
pushToDataLayerIfDefined(payload);
|
||||||
|
|
|
||||||
|
|
@ -458,10 +458,10 @@ describe("analyticsMixin.js", () => {
|
||||||
result[key] === false ||
|
result[key] === false ||
|
||||||
!!result[key] ||
|
!!result[key] ||
|
||||||
(result["accountType"] === "cash"
|
(result["accountType"] === "cash"
|
||||||
? result["isInsuranceVerified"] === null &&
|
? result["isInsuranceVerified"] === "" &&
|
||||||
result["insuranceDeductible"] === null &&
|
result["insuranceDeductible"] === "" &&
|
||||||
result["isInsuranceItac"] === null &&
|
result["isInsuranceItac"] === "" &&
|
||||||
result["isInsuranceNoComp"] === null
|
result["isInsuranceNoComp"] === ""
|
||||||
: false)
|
: false)
|
||||||
);
|
);
|
||||||
expect(allFieldsPopulated).toBe(true);
|
expect(allFieldsPopulated).toBe(true);
|
||||||
|
|
@ -555,10 +555,10 @@ describe("analyticsMixin.js", () => {
|
||||||
result[key] === false ||
|
result[key] === false ||
|
||||||
!!result[key] ||
|
!!result[key] ||
|
||||||
(result["accountType"] === "cash"
|
(result["accountType"] === "cash"
|
||||||
? result["isInsuranceVerified"] === null &&
|
? result["isInsuranceVerified"] === "" &&
|
||||||
result["insuranceDeductible"] === null &&
|
result["insuranceDeductible"] === "" &&
|
||||||
result["isInsuranceItac"] === null &&
|
result["isInsuranceItac"] === "" &&
|
||||||
result["isInsuranceNoComp"] === null
|
result["isInsuranceNoComp"] === ""
|
||||||
: false)
|
: false)
|
||||||
);
|
);
|
||||||
expect(allFieldsPopulated).toBe(true);
|
expect(allFieldsPopulated).toBe(true);
|
||||||
|
|
@ -646,14 +646,7 @@ describe("analyticsMixin.js", () => {
|
||||||
// Assert
|
// Assert
|
||||||
console.log(result);
|
console.log(result);
|
||||||
const allFieldsPopulatedOrDefault = Object.keys(result).every(
|
const allFieldsPopulatedOrDefault = Object.keys(result).every(
|
||||||
(key) =>
|
(key) => result[key] === false || !!result[key] || result[key] === ""
|
||||||
result[key] === false ||
|
|
||||||
!!result[key] ||
|
|
||||||
result[key] === "" ||
|
|
||||||
(result["isInsuranceVerified"] === null &&
|
|
||||||
result["insuranceDeductible"] === null &&
|
|
||||||
result["isInsuranceItac"] === null &&
|
|
||||||
result["isInsuranceNoComp"] === null)
|
|
||||||
);
|
);
|
||||||
expect(allFieldsPopulatedOrDefault).toBe(true);
|
expect(allFieldsPopulatedOrDefault).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue