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,18 +1,13 @@
module.exports = {
setupFilesAfterEnv: ["<rootDir>/jest.setup.js"],
testEnvironment: "jsdom",
reporters: ["default", ["jest-junit", { outputDirectory: "./test-results/junit", outputName: "results.xml" }]],
testPathIgnorePatterns: ["<rootDir>/.next/", "<rootDir>/node_modules/"],
transform: {
"^.+\\.(js|jsx|ts|tsx)$": "babel-jest", // Unterstützt JS/TS/TSX
},
transformIgnorePatterns: [
"node_modules/(?!(leaflet|leaflet.smooth_marker_bouncing)/)", // Leaflet ausgenommen
testEnvironment: "node", // Da API-Tests laufen
reporters: [
"default", // Standard-Reporter
[
"jest-junit", // JUnit-Reporter
{
outputDirectory: "./reports/junit", // Ausgabeort für Berichte
outputName: "junit.xml", // Name der Report-Datei
},
],
],
moduleNameMapper: {
"\\.(css|less|scss|sass)$": "identity-obj-proxy", // Für CSS-Module-Mocking
"^leaflet$": "<rootDir>/__mocks__/leaflet.js", // Leaflet Mock hinzufügen
"^leaflet.smooth_marker_bouncing$": "<rootDir>/__mocks__/leaflet.smooth_marker_bouncing.js", // Smooth Marker Mock
},
};