feat: Proxy-APIs und Integrationstests für WebServices hinzugefügt

- Vier Proxy-Endpunkte implementiert:
  1. gisStationsStatusDistrict
  2. gisStationsStaticDistrict
  3. gisStationsMeasurements
  4. gisSystemStatic

- API-Integrationstests mit Jest für alle Endpunkte erstellt:
  - Tests verwenden echte API-Responses statt Mock-Daten.
  - Erfolgreiche Anfragen mit gültigen Parametern getestet.
  - Fehlende Parameter und ungültige Parameter getestet.

- Code enthält:
  - Dynamische URL-Generierung für Proxy-Weiterleitungen.
  - Prüfung von Headern, Statuscodes und JSON-Strukturen.
  - Unterstützung für CORS und OPTIONS-Anfragen.

- Ergebnis:
  - Alle Tests erfolgreich bestanden.
  - APIs bereit für produktive Nutzung und Erweiterungen.
This commit is contained in:
ISA
2025-01-03 14:02:29 +01:00
parent 2a1f885190
commit d7978790e1
13 changed files with 600 additions and 171 deletions

View File

@@ -1,17 +0,0 @@
import { renderHook } from "@testing-library/react-hooks";
import useTkComponentsMarkersLayer from "./useTkComponentsMarkersLayer";
jest.mock("leaflet");
describe("useTkComponentsMarkersLayer", () => {
it("should initialize markers", () => {
const mapMock = { addLayer: jest.fn(), removeLayer: jest.fn() };
const omsMock = { addMarker: jest.fn() };
const gisSystemStatic = [{ IdSystem: 30, Latitude: 50.0, Longitude: 8.0 }];
const priorityConfig = {};
const { result } = renderHook(() => useTkComponentsMarkersLayer(mapMock, omsMock, gisSystemStatic, priorityConfig));
expect(result.current).toBeDefined();
});
});