test(folio): cover merged-card parsing and unknown balances

This commit is contained in:
pj committed 2026-08-13 22:34:35 +05:30
1 parent 5b80c0701b
commit 94084d9992
2 files changed
+153 -4

No files matched your search

+4 -4
View File
@@ -34,7 +34,7 @@ test("off Home (no cards) with carrier still 0: returns 0", () => {
});
test("sequence: Home $30, off-Home, Home $50 tracks new Home totals", () => {
let carrier = 0;
let carrier: number | null = 0;
carrier = computeHomeTotalBalance({
cardBalanceTexts: ["$10.00", "$20.00"],
previousCarrier: carrier,
@@ -53,7 +53,7 @@ test("sequence: Home $30, off-Home, Home $50 tracks new Home totals", () => {
});
test("Ledger step (no Home cards) holds the carrier, ignores Ledger balance", () => {
let carrier = 0;
let carrier: number | null = 0;
carrier = computeHomeTotalBalance({
cardBalanceTexts: ["$10.00", "$20.00"],
previousCarrier: carrier,
@@ -86,12 +86,12 @@ test("single card on Home overrides any previous carrier", () => {
);
});
test("undefined card balance text is treated as 0", () => {
test("undefined card balance text makes the total unknown, not a partial sum", () => {
assert.equal(
computeHomeTotalBalance({
cardBalanceTexts: [undefined, "$10.00"],
previousCarrier: 0,
}),
1000,
null,
);
});