Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

test(budget): match applySettlementUpdate's new settled_at SQL args

RemEx3a8ae6334c41
diff --git a/server/tests/unit/nest/budget.service.calc.test.ts b/server/tests/unit/nest/budget.service.calc.test.ts
index 8c57c804d..9b53a5d52 100644
--- a/server/tests/unit/nest/budget.service.calc.test.ts
+++ b/server/tests/unit/nest/budget.service.calc.test.ts
@@ -837,9 +837,10 @@ describe('applySettlementUpdate', () => {
});
const res = budget.applySettlementUpdate(7, 1, { from_user_id: 2, to_user_id: 1, amount: 10.126 });
- // from, to, rounded amount, currency-flag(0)/value(null), rate-flag(null)/value(1), id.
- // No currency/exchange_rate passed → both CASE guards keep the existing columns.
- expect(run).toHaveBeenCalledWith(2, 1, 10.13, 0, null, null, 1, 7);
+ // from, to, rounded amount, currency-flag(0)/value(null), rate-flag(null)/value(1),
+ // settled_at-flag(0)/value(null), id.
+ // No currency/exchange_rate/settled_at passed → all three CASE guards keep the existing columns.
+ expect(run).toHaveBeenCalledWith(2, 1, 10.13, 0, null, null, 1, 0, null, 7);
expect(res).toMatchObject({ id: 7, from_user_id: 2, to_user_id: 1, amount: 10.13 });
});
});