diff --git a/client/src/components/Map/MapView.test.tsx b/client/src/components/Map/MapView.test.tsx index 36ee4869..af0b5449 100644 --- a/client/src/components/Map/MapView.test.tsx +++ b/client/src/components/Map/MapView.test.tsx @@ -32,6 +32,7 @@ vi.mock('react-leaflet', () => ({ off: vi.fn(), panBy: vi.fn(), }), + useMapEvents: () => ({}), })) vi.mock('react-leaflet-cluster', () => ({ diff --git a/client/src/components/Map/ReservationOverlay.tsx b/client/src/components/Map/ReservationOverlay.tsx index 74b41714..09e27703 100644 --- a/client/src/components/Map/ReservationOverlay.tsx +++ b/client/src/components/Map/ReservationOverlay.tsx @@ -25,6 +25,7 @@ const TYPE_META: Record { + if (typeof map?.getPane !== 'function' || typeof map?.createPane !== 'function') return if (!map.getPane(ENDPOINT_PANE)) { const pane = map.createPane(ENDPOINT_PANE) pane.style.zIndex = '650' diff --git a/client/src/components/Planner/ReservationModal.test.tsx b/client/src/components/Planner/ReservationModal.test.tsx index 0ec10cdf..c5bcfbaa 100644 --- a/client/src/components/Planner/ReservationModal.test.tsx +++ b/client/src/components/Planner/ReservationModal.test.tsx @@ -575,16 +575,14 @@ describe('ReservationModal', () => { expect(screen.queryByPlaceholderText('0.00')).not.toBeInTheDocument(); }); - it('FE-PLANNER-RESMODAL-042: flight type metadata saved with airline and airports', async () => { + it('FE-PLANNER-RESMODAL-042: flight type metadata saved with airline and flight number', async () => { const onSave = vi.fn().mockResolvedValue(undefined); render(); await userEvent.click(screen.getByRole('button', { name: /Flight/i })); - await userEvent.type(screen.getByPlaceholderText(/e\.g\. Lufthansa/i), 'AF 447'); + await userEvent.type(screen.getByPlaceholderText(/e\.g\. Lufthansa/i), 'AF 447 CDG → JFK'); await userEvent.type(screen.getByPlaceholderText('Lufthansa'), 'Air France'); await userEvent.type(screen.getByPlaceholderText('LH 123'), 'AF 447'); - await userEvent.type(screen.getByPlaceholderText('FRA'), 'CDG'); - await userEvent.type(screen.getByPlaceholderText('NRT'), 'JFK'); await userEvent.click(screen.getByRole('button', { name: /^Add$/i })); @@ -595,8 +593,6 @@ describe('ReservationModal', () => { metadata: expect.objectContaining({ airline: 'Air France', flight_number: 'AF 447', - departure_airport: 'CDG', - arrival_airport: 'JFK', }), }) );