diff --git a/src/utils/splitOffset.test.ts b/src/utils/splitOffset.test.ts index e4572e1..b062f38 100644 --- a/src/utils/splitOffset.test.ts +++ b/src/utils/splitOffset.test.ts @@ -45,6 +45,11 @@ describe("isOffsetChild (#454)", () => { it("refuses an amount of zero", () => { expect(isOffsetChild(PARENT, child(0, A))).toBe(false); expect(isOffsetChild(PARENT, child(-0, A))).toBe(false); + // Under a parent of zero, a child of zero passes the sign test + // (Math.sign(0) === -Math.sign(0), since 0 === -0): only the amount refuses it. + const zero = { description: PARENT.description, amount: 0 }; + expect(isOffsetChild(zero, child(0, A))).toBe(false); + expect(isOffsetChild(zero, child(-0, A))).toBe(false); }); it("recognizes the offset line of a split income: a positive parent, a negative offset", () => {