From bb0d65bb19a9a58bbe8623a6de118de43897f68d Mon Sep 17 00:00:00 2001 From: Maurice Date: Thu, 20 Aug 2026 17:44:15 +0200 Subject: [PATCH] fix(map): read the last fitBounds call without Array.at The client's tsconfig targets a lib without Array.prototype.at, so the two new assertions typechecked locally against the test runner but not against tsc. Index arithmetic instead. --- client/src/components/Map/MapView.test.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/src/components/Map/MapView.test.tsx b/client/src/components/Map/MapView.test.tsx index f0fe2149e..4d92f63f0 100644 --- a/client/src/components/Map/MapView.test.tsx +++ b/client/src/components/Map/MapView.test.tsx @@ -935,7 +935,8 @@ describe('MapView bounds fitting', () => { rerender() expect(mapMock.fitBounds).toHaveBeenCalled() - const opts = mapMock.fitBounds.mock.calls.at(-1)?.[1] as { paddingBottomRight?: [number, number] } + const calls = mapMock.fitBounds.mock.calls + const opts = calls[calls.length - 1]?.[1] as { paddingBottomRight?: [number, number] } expect(opts?.paddingBottomRight?.[1]).toBe(280) // Long enough that the old 300ms nudge would have fired by now. @@ -951,7 +952,8 @@ describe('MapView bounds fitting', () => { const { rerender } = render() rerender() - const opts = mapMock.fitBounds.mock.calls.at(-1)?.[1] as { paddingBottomRight?: [number, number] } + const calls = mapMock.fitBounds.mock.calls + const opts = calls[calls.length - 1]?.[1] as { paddingBottomRight?: [number, number] } expect(opts?.paddingBottomRight?.[1]).toBe(60) })