diff --git a/components/email/structured-mail/__tests__/structured-mail-cards.test.tsx b/components/email/structured-mail/__tests__/structured-mail-cards.test.tsx index a87b51475..26fd99dec 100644 --- a/components/email/structured-mail/__tests__/structured-mail-cards.test.tsx +++ b/components/email/structured-mail/__tests__/structured-mail-cards.test.tsx @@ -218,6 +218,17 @@ describe('StructuredMailCards', () => { await waitFor(() => expect(writeText).toHaveBeenCalledWith('SO-449120')); }); + it('drops the expected date once the order is delivered', () => { + const shipment = card('order-and-parcel'); + shipment.status = 'delivered'; + show([shipment]); + const region = screen.getByRole('region', { name: 'region_shipment' }); + expect(region).toHaveTextContent('order_status_delivered'); + expect(region).not.toHaveTextContent('expected_by'); + // Carrier and tracking number stay. + expect(region).toHaveTextContent('00340434161234567890'); + }); + it('lists three items and says how many more there are', () => { const shipment: Shipment = { kind: 'shipment', key: 's', merchant: 'Shop', orderNumber: 'A-1', source: 'json-ld', parcels: [], diff --git a/components/email/structured-mail/booking-cards.tsx b/components/email/structured-mail/booking-cards.tsx index 5558fc708..60a0ee27c 100644 --- a/components/email/structured-mail/booking-cards.tsx +++ b/components/email/structured-mail/booking-cards.tsx @@ -154,9 +154,11 @@ export function TransportCard({ booking, emailId, calendarActions }: BookingCard /> ) : undefined} > - {booking.legs.map((leg, i) => ( - - ))} +
+ {booking.legs.map((leg, i) => ( + + ))} +
); diff --git a/components/email/structured-mail/card-parts.tsx b/components/email/structured-mail/card-parts.tsx index 870a1efb6..79245c680 100644 --- a/components/email/structured-mail/card-parts.tsx +++ b/components/email/structured-mail/card-parts.tsx @@ -87,7 +87,7 @@ export function CardLink({ link, label, icon: Icon = ExternalLink, emailId }: { href={link.url} target="_blank" rel="noopener noreferrer" - className={ACTION_CLASS} + className={cn(ACTION_CLASS, "flex-wrap gap-y-0")} data-testid="structured-mail-link" onClick={async (e) => { e.preventDefault(); @@ -99,7 +99,8 @@ export function CardLink({ link, label, icon: Icon = ExternalLink, emailId }: { >