mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
65a657347e
On the phone, a ticket split where a receipt line named someone who was not ticked as a participant saved only the ticked people as members. Their share of the line was dropped, the member amounts no longer added up to total_price, and the settlement kept a difference nobody could clear. The desktop editor had been fixed for this in #1382. Cause: useExpenseForm only added the people named on ticket lines when the caller passed ticketShareMembers, and only the desktop CostsPanel did. The phone MCostSheet kept the old behaviour. Fix: the hook always sends everyone a ticket line names, and the ticketShareMembers option is gone, so both editors save the same members. Red test: src/components/Budget/useExpenseForm.test.ts FE-BUDGET-EXPFORM-021 failed on the unfixed code with "AssertionError: expected { name: 'Lunch', ... } to match object { ... }": member_ids was [1] and members held only user 1, without user 2's 6. Changed assertions: useExpenseForm.test.ts FE-BUDGET-EXPFORM-017 used to expect the phone run (ticketShareMembers false) to send members [{ user_id: 1, amount: 6 }] and member_ids [1]; that phone half is removed and the test now expects every editor to send members for users 1 and 2 with 6 each and member_ids [1, 2].