CSR-2098
CSR-2098 unit test for verified deductible
This commit is contained in:
parent
67610544e0
commit
91b4036cd5
1 changed files with 40 additions and 0 deletions
|
|
@ -120,6 +120,46 @@ describe("baseMixin.js", () => {
|
||||||
|
|
||||||
expect(mixIn.methods.dispatchStoreActionWithLogging).toBeCalled();
|
expect(mixIn.methods.dispatchStoreActionWithLogging).toBeCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("getAmountDue for verified deductible should be deductible plus any lineitems", () => {
|
||||||
|
const mixIn = getMixInInstance({});
|
||||||
|
const lineItems = {
|
||||||
|
glassParts: [],
|
||||||
|
supportingItems: [],
|
||||||
|
vaps: [
|
||||||
|
{
|
||||||
|
cartItemType: "FRONT WIPERS",
|
||||||
|
description: 'WIPER BLADE STANDARD 18"',
|
||||||
|
kitPrice: 0,
|
||||||
|
laborAmount: 0,
|
||||||
|
partNumber: "WB18",
|
||||||
|
partType: "FRONT WIPER",
|
||||||
|
salesTax: 2.00,
|
||||||
|
sellingPrice: 30.00,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
cartItemType: "FRONT WIPERS",
|
||||||
|
description: 'WIPER BLADE STANDARD 26"',
|
||||||
|
kitPrice: 0,
|
||||||
|
laborAmount: 0,
|
||||||
|
partNumber: "WB26",
|
||||||
|
partType: "FRONT WIPER",
|
||||||
|
salesTax: 1.00,
|
||||||
|
sellingPrice: 20.00,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
promos: [],
|
||||||
|
};
|
||||||
|
|
||||||
|
store.getters = {
|
||||||
|
payment: {insuranceCoverage: { isVerified: true } },
|
||||||
|
policy: { isNoComp: false, isItac: false, currentDeductible: 250 },
|
||||||
|
};
|
||||||
|
|
||||||
|
var amtDue = mixIn.methods.getAmountDue(lineItems);
|
||||||
|
|
||||||
|
expect(amtDue).toEqual("303.00");
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function getMixInInstance({ isDispatchSuccess = true }) {
|
function getMixInInstance({ isDispatchSuccess = true }) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue