fix(bookings): client test failures after map overlay refactor

- Make useEndpointPane tolerant when map mock lacks getPane/createPane
- Add useMapEvents to react-leaflet mock in MapView.test
- Rewrite RESMODAL-042 to use the new AirportSelect flow (airline and
  flight number only; airport codes are now saved as endpoints, not
  metadata)
This commit is contained in:
Maurice
2026-04-17 19:03:21 +02:00
parent 8defc90e95
commit 5e9c8d2c43
3 changed files with 4 additions and 6 deletions
@@ -32,6 +32,7 @@ vi.mock('react-leaflet', () => ({
off: vi.fn(),
panBy: vi.fn(),
}),
useMapEvents: () => ({}),
}))
vi.mock('react-leaflet-cluster', () => ({
@@ -25,6 +25,7 @@ const TYPE_META: Record<TransportType, { color: string; icon: typeof Plane; geod
function useEndpointPane() {
const map = useMap()
useMemo(() => {
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'