Update unit tests
This commit is contained in:
parent
fff25a4e9e
commit
8a86185206
1 changed files with 69 additions and 4 deletions
|
|
@ -175,9 +175,66 @@ describe("baseMixin.js", () => {
|
|||
promos: [],
|
||||
};
|
||||
|
||||
const payment = { insuranceCoverage: { isVerified: true } };
|
||||
const policy = { isNoComp: false, isItac: false, currentDeductible: 250 };
|
||||
|
||||
store.getters = {
|
||||
payment: { insuranceCoverage: { isVerified: true } },
|
||||
policy: { isNoComp: false, isItac: false, currentDeductible: 250 },
|
||||
payment: payment,
|
||||
policy: policy,
|
||||
order: {
|
||||
payment: payment,
|
||||
policy: policy,
|
||||
},
|
||||
hasSubmittedOrder: false,
|
||||
};
|
||||
|
||||
var amtDue = mixIn.methods.getAmountDue(lineItems);
|
||||
|
||||
expect(amtDue).toEqual("303.00");
|
||||
});
|
||||
|
||||
test("getAmountDue should function with a submitted order", () => {
|
||||
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.0,
|
||||
sellingPrice: 30.0,
|
||||
},
|
||||
{
|
||||
cartItemType: "FRONT WIPERS",
|
||||
description: 'WIPER BLADE STANDARD 26"',
|
||||
kitPrice: 0,
|
||||
laborAmount: 0,
|
||||
partNumber: "WB26",
|
||||
partType: "FRONT WIPER",
|
||||
salesTax: 1.0,
|
||||
sellingPrice: 20.0,
|
||||
},
|
||||
],
|
||||
promos: [],
|
||||
};
|
||||
|
||||
const payment = { insuranceCoverage: { isVerified: true } };
|
||||
const policy = { isNoComp: false, isItac: false, currentDeductible: 250 };
|
||||
|
||||
store.getters = {
|
||||
payment: {},
|
||||
policy: {},
|
||||
order: {},
|
||||
submittedOrder: {
|
||||
payment: payment,
|
||||
policy: policy,
|
||||
},
|
||||
hasSubmittedOrder: true,
|
||||
};
|
||||
|
||||
var amtDue = mixIn.methods.getAmountDue(lineItems);
|
||||
|
|
@ -241,9 +298,17 @@ describe("baseMixin.js", () => {
|
|||
promos: [],
|
||||
};
|
||||
|
||||
const payment = { isInsurance: null, insuranceCoverage: { isVerified: null } };
|
||||
const policy = { isNoComp: false, isItac: false, currentDeductible: 0 };
|
||||
|
||||
store.getters = {
|
||||
payment: { isInsurance: null, insuranceCoverage: { isVerified: null } },
|
||||
policy: { isNoComp: false, isItac: false, currentDeductible: 0 },
|
||||
payment: payment,
|
||||
policy: policy,
|
||||
order: {
|
||||
payment: payment,
|
||||
policy: policy,
|
||||
},
|
||||
hasSubmittedOrder: false,
|
||||
};
|
||||
|
||||
var amtDue = mixIn.methods.getAmountDue(lineItems);
|
||||
|
|
|
|||
Loading…
Reference in a new issue