fix: POI-Icons erscheinen nun korrekt je nach Typ

- Fehler behoben: Alle POIs zeigten immer dasselbe Icon (z. B. poi-marker-icon-4.png)
- Ursache: In setupPOIs.js wurde iconPath fälschlich anhand von idPoiTyp gesucht, obwohl nur idPoi verfügbar war
- Lösung: Icon-Zuordnung erfolgt jetzt über Mapping idPoi → path (Map)
- Kein Backend-Änderung nötig
- Standard-Icon wird verwendet, wenn kein Eintrag im Mapping vorhanden ist

# Version: 1.1.166
This commit is contained in:
ISA
2025-05-26 08:45:28 +02:00
parent 064423d4eb
commit 1a37aa7a3a
5 changed files with 94 additions and 41 deletions

View File

@@ -0,0 +1,16 @@
describe("setupPOIs Icon-Mapping intern", () => {
it("ordnet korrektes Icon anhand idPoi zu", () => {
const mockPoiData = [{ idPoi: 7, path: "poi-marker-icon-2.png" }];
const iconMap = new Map();
mockPoiData.forEach((item) => iconMap.set(item.idPoi, item.path));
const result = iconMap.get(7);
expect(result).toBe("poi-marker-icon-2.png");
});
it("gibt undefined zurück wenn idPoi nicht existiert", () => {
const iconMap = new Map();
iconMap.set(1, "icon-1.png");
const result = iconMap.get(99);
expect(result).toBeUndefined();
});
});