Verschiebemodus eingebaut
Test and publish container images / test (push) Successful in 2m16s
Test and publish container images / publish (push) Successful in 1m6s

This commit is contained in:
BuTzZ
2026-08-03 08:31:45 +02:00
parent 6801fa9089
commit 5994d1e71c
4 changed files with 142 additions and 5 deletions
+65
View File
@@ -788,6 +788,71 @@ describe("MapView marine feature information", () => {
);
expect(maplibreState.markerConstructions).toBe(0);
});
it("keeps the GPS position centered while navigation follow mode is active", async () => {
const onFollowPositionChange = vi.fn();
const onMapReady = vi.fn();
const onPickCoordinate = vi.fn();
const view = render(
<MapView
config={config}
position={{ lat: 52, lon: 7 }}
accuracyM={5}
startPoint={null}
destination={null}
pickMode={null}
route={null}
navigationActive
followPosition={false}
onFollowPositionChange={onFollowPositionChange}
onPickCoordinate={onPickCoordinate}
onMapReady={onMapReady}
/>
);
await act(async () => maplibreState.current.emit("load"));
const followButton = screen.getByRole("button", {
name: "GPS-Folge-Modus aktivieren"
});
expect(followButton).toHaveAttribute("aria-pressed", "false");
fireEvent.click(followButton);
expect(onFollowPositionChange).toHaveBeenCalledWith(true);
expect(maplibreState.current.flyTo).toHaveBeenCalledWith({
center: [7, 52],
zoom: 13,
essential: true
});
view.rerender(
<MapView
config={config}
position={{ lat: 52.01, lon: 7.02 }}
accuracyM={5}
startPoint={null}
destination={null}
pickMode={null}
route={null}
navigationActive
followPosition
onFollowPositionChange={onFollowPositionChange}
onPickCoordinate={onPickCoordinate}
onMapReady={onMapReady}
/>
);
expect(
screen.getByRole("button", { name: "GPS-Folge-Modus beenden" })
).toHaveAttribute("aria-pressed", "true");
expect(maplibreState.current.easeTo).toHaveBeenLastCalledWith({
center: [7.02, 52.01],
zoom: 13,
duration: 500,
essential: true
});
await act(async () => maplibreState.current.emit("dragstart"));
expect(onFollowPositionChange).toHaveBeenLastCalledWith(false);
});
});
describe("MapView anchor watch", () => {