test(collection-ai): sharpen tick qty/price cases
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
5262de97fd
commit
084e0951c7
1 changed files with 13 additions and 1 deletions
|
|
@ -81,7 +81,16 @@ describe("computeLineTicks", () => {
|
|||
computeLineTicks(row(), check({ doc_line: line({ quantity: null }) })).qty,
|
||||
).toBe("grey");
|
||||
expect(
|
||||
computeLineTicks(row({ order_qty: 0, quantity: 40 }), check()).qty,
|
||||
computeLineTicks(
|
||||
row({ order_qty: 0, quantity: 8, qty_collected: 5 }),
|
||||
check({ doc_line: line({ quantity: 5 }) }),
|
||||
).qty,
|
||||
).toBe("amber");
|
||||
expect(
|
||||
computeLineTicks(
|
||||
row({ order_qty: 0, quantity: 0, qty_collected: 5 }),
|
||||
check({ doc_line: line({ quantity: 5 }) }),
|
||||
).qty,
|
||||
).toBe("green");
|
||||
});
|
||||
it("desc ticks", () => {
|
||||
|
|
@ -98,6 +107,9 @@ describe("computeLineTicks", () => {
|
|||
expect(
|
||||
computeLineTicks(row({ cost_price: 14.515 }), check({ doc_line: line({ unit_price: 14.51 }) })).price,
|
||||
).toBe("green");
|
||||
expect(
|
||||
computeLineTicks(row({ cost_price: 14.51 }), check({ doc_line: line({ unit_price: 14.52 }) })).price,
|
||||
).toBe("green");
|
||||
expect(computeLineTicks(row(), check({ doc_type: "delivery_note" })).price).toBe("grey");
|
||||
expect(
|
||||
computeLineTicks(row(), check({ doc_line: line({ unit_price: null }) })).price,
|
||||
|
|
|
|||
Loading…
Reference in a new issue