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:
@@ -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();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user