From 8a481316181c55a06b75cb2c4bdf9157cda75241 Mon Sep 17 00:00:00 2001 From: Maurice Date: Sun, 6 Sep 2026 14:18:08 +0200 Subject: [PATCH] test: pin the empty-metadata payload and the payer-less share Two suites encoded the behaviour this branch changes: MReservationSheet asserted the literal metadata: null the forms no longer send, and the new Your-share case reached for a label that is a card footer rather than a heading. --- client/src/components/Budget/CostsPanel.test.tsx | 11 +++++++---- .../tests/unit/mobile/trip/MReservationSheet.test.tsx | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/client/src/components/Budget/CostsPanel.test.tsx b/client/src/components/Budget/CostsPanel.test.tsx index 8483d58c9..adda0edaf 100644 --- a/client/src/components/Budget/CostsPanel.test.tsx +++ b/client/src/components/Budget/CostsPanel.test.tsx @@ -309,10 +309,13 @@ describe('CostsPanel — settlements in the ledger', () => { render() await screen.findByText('Taxi') - // 60 from the paid expense only — the 40 nobody has paid for is not a share. - const card = screen.getByText('Your share').closest('div[style*="border-radius: 22"]') - expect(card).toHaveTextContent('60') - expect(card).not.toHaveTextContent('100') + // "Your share" is the first of the two bold figures in the Total spend card's + // footer; the second is "You paid". 60 from the paid expense only — the 40 + // nobody has paid for is not a share, though it still counts as spend. + const card = screen.getByText('Total spend').closest('div[style*="border-radius: 22"]')! + const figures = [...card.querySelectorAll('b')].map(b => b.textContent ?? '') + expect(figures[0]).toContain('60') + expect(figures[0]).not.toContain('100') }) it('records a recorded-total expense with nobody to split with (#1286)', async () => { diff --git a/client/tests/unit/mobile/trip/MReservationSheet.test.tsx b/client/tests/unit/mobile/trip/MReservationSheet.test.tsx index 460d1070b..5b43cdd5f 100644 --- a/client/tests/unit/mobile/trip/MReservationSheet.test.tsx +++ b/client/tests/unit/mobile/trip/MReservationSheet.test.tsx @@ -210,7 +210,7 @@ describe('MReservationSheet', () => { reservation_time: null, reservation_end_time: null, location: '', confirmation_number: '', notes: '', url: '', assignment_id: null, accommodation_id: null, place_id: null, - metadata: null, endpoints: [], needs_review: false, + metadata: {}, endpoints: [], needs_review: false, }) }) @@ -447,7 +447,7 @@ describe('MReservationSheet', () => { setup(makePlanner({ editingReservation: { id: 57, title: 'Museum', type: undefined, status: undefined, - reservation_time: null, reservation_end_time: null, metadata: null, + reservation_time: null, reservation_end_time: null, metadata: {}, } as unknown as Reservation, })) expect(titleField()).toHaveValue('Museum')