fix(bookings): the delete question for a booking with a linked expense says the expense is deleted too

Deleting a booking also deletes the expenses linked to it, but the
question only said the booking would be deleted. A booking with a linked
expense now says so in every place that asks: the bookings list and detail,
the transport and transit dialogs, and the phone's booking cards. The MCP
delete_reservation description names the linked expenses and the stay a
hotel booking created as well.

Refs #2604
This commit is contained in:
Maurice
2026-10-12 20:42:55 +02:00
parent 62a80f420c
commit d4f4ab3891
38 changed files with 94 additions and 13 deletions
@@ -1,4 +1,4 @@
// FE-COMP-MRESCARD-001 to FE-COMP-MRESCARD-008
// FE-COMP-MRESCARD-001 to FE-COMP-MRESCARD-009
import { fireEvent, render, screen } from '@testing-library/react';
import { Hotel, Plane } from 'lucide-react';
import { describe, expect, it, vi } from 'vitest';
@@ -120,6 +120,12 @@ describe('MReservationCardParts', () => {
expect(card.confirmDelete).toHaveBeenCalledOnce();
});
it('FE-COMP-MRESCARD-009: a booking with a linked expense says the expense is deleted with it (#2604)', () => {
render(<CardDeleteSheet title="LH 400" card={cardState({ confirmingDelete: true, deleteTakesExpense: true })} t={t} />);
expect(screen.getByText('reservations.confirm.deleteBodyWithExpense:LH 400')).toBeInTheDocument();
});
it('FE-COMP-MRESCARD-008: the date sits beside the day title and never shrinks, a range stacks the time under it (#2590)', () => {
const { container } = render(
<CardWhenAndCode
@@ -161,7 +161,7 @@ export function CardDeleteSheet({ title, card, t }: { title: string; card: CardS
open={card.confirmingDelete}
onClose={card.cancelDelete}
title={t('reservations.confirm.deleteTitle')}
message={t('reservations.confirm.deleteBody', { name: title })}
message={t(card.deleteTakesExpense ? 'reservations.confirm.deleteBodyWithExpense' : 'reservations.confirm.deleteBody', { name: title })}
confirmLabel={t('common.delete')}
cancelLabel={t('common.cancel')}
danger