MAP_VERSION = "1.0.12"

feat: Integrationstest für openInNewTab erfolgreich implementiert

- Mocking für Leaflet-Objekte (Marker, Polyline) erstellt.
- Tests hinzugefügt, die sicherstellen:
  - Marker-Links werden korrekt generiert und geöffnet.
  - Polyline-Links werden korrekt generiert und geöffnet.
  - Fehler ausgegeben werden, wenn kein gültiger Link gefunden wird.
- Jest-Konfiguration angepasst, um globale Objekte wie window zu mocken.
- Funktionalität und Tests erfolgreich überprüft.
This commit is contained in:
ISA
2024-12-06 14:18:05 +01:00
parent 6fa4d86cd1
commit df5289cc38
19 changed files with 57 additions and 1040 deletions

View File

@@ -1,23 +0,0 @@
// __mocks__/leaflet.js
const L = {
divIcon: jest.fn(() => new L.DivIcon()),
DivIcon: function () {
this.options = {
className: "custom-start-icon",
html: `
<svg width="18" height="18" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
<polygon points="10,2 18,18 2,18" fill="black" />
<polygon points="10,5 16,16 4,16" fill="gray" />
</svg>
`,
iconSize: [18, 18],
iconAnchor: [9, 10],
};
},
};
L.DivIcon.prototype = {
constructor: L.DivIcon,
};
module.exports = L;