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:
16
__tests__/setupPOIs.test.js
Normal file
16
__tests__/setupPOIs.test.js
Normal 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();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user