Hinweise optimiert
This commit is contained in:
@@ -36,7 +36,6 @@ const testFairwayGraph = (
|
||||
from: `${id}-start`,
|
||||
to: `${id}-destination`,
|
||||
coordinates: [start, destination],
|
||||
minDepthM: null,
|
||||
source: "test-fairway-source"
|
||||
}
|
||||
]
|
||||
@@ -68,7 +67,6 @@ const boundedSnapSearchFixture = () => {
|
||||
from: "junction",
|
||||
to: `trap-${index + 1}`,
|
||||
coordinates: [{ lat: 52, lon: 7 }, coordinate],
|
||||
minDepthM: 4,
|
||||
oneway: true as const,
|
||||
source: `api-bounded-trap-${index + 1}`
|
||||
})),
|
||||
@@ -78,7 +76,6 @@ const boundedSnapSearchFixture = () => {
|
||||
from: "junction",
|
||||
to: "destination",
|
||||
coordinates: [{ lat: 52, lon: 7 }, destination],
|
||||
minDepthM: 4,
|
||||
oneway: true as const,
|
||||
source: "api-ninth-main-route"
|
||||
}
|
||||
@@ -220,26 +217,6 @@ describe("Watermaps API", () => {
|
||||
await app.close();
|
||||
});
|
||||
|
||||
it("returns critical route warnings for shallow samples", async () => {
|
||||
const app = await buildServer({ cache: createCache(), env: demoEnv });
|
||||
const response = await app.inject({
|
||||
method: "POST",
|
||||
url: "/api/routes",
|
||||
payload: {
|
||||
start: { lat: 53.344167, lon: 7.186111 },
|
||||
destination: { lat: 53.563776, lon: 6.750562 },
|
||||
vesselProfile: { draughtM: 1.5, safetyReserveM: 0.4 },
|
||||
depthSamples: [{ coordinate: { lat: 53.442996, lon: 6.833146 }, depthM: 1.6 }]
|
||||
}
|
||||
});
|
||||
|
||||
expect(response.statusCode).toBe(200);
|
||||
expect(response.json().warnings.some((warning: { severity: string }) => warning.severity === "critical")).toBe(
|
||||
true
|
||||
);
|
||||
await app.close();
|
||||
});
|
||||
|
||||
it("rejects routes without a known fairway instead of returning a straight line", async () => {
|
||||
const app = await buildServer({
|
||||
cache: createCache(),
|
||||
@@ -443,7 +420,6 @@ describe("Watermaps API", () => {
|
||||
expect(body.routingMode).toBe("fairway");
|
||||
expect(body.dataSources).toContain("fairway-graph:ems-borkum-seed");
|
||||
expect(body.geometry.coordinates.length).toBeGreaterThan(20);
|
||||
expect(body.warnings.some((warning: { code: string }) => warning.code === "FAIRWAY_ROUTE")).toBe(true);
|
||||
await app.close();
|
||||
});
|
||||
|
||||
@@ -469,7 +445,6 @@ describe("Watermaps API", () => {
|
||||
name: "Norddeich Fahrwasser",
|
||||
from: "norddeich",
|
||||
to: "fairway",
|
||||
minDepthM: null,
|
||||
source: "local-geofabrik-test",
|
||||
coordinates: [
|
||||
{ lat: 53.6234, lon: 7.1559 },
|
||||
@@ -481,7 +456,6 @@ describe("Watermaps API", () => {
|
||||
name: "Norderney Fahrwasser",
|
||||
from: "fairway",
|
||||
to: "norderney",
|
||||
minDepthM: null,
|
||||
source: "local-geofabrik-test",
|
||||
coordinates: [
|
||||
{ lat: 53.66, lon: 7.16 },
|
||||
@@ -605,7 +579,6 @@ describe("Watermaps API", () => {
|
||||
name: "AB",
|
||||
from: "a",
|
||||
to: "b",
|
||||
minDepthM: 4,
|
||||
source: "test-overpass",
|
||||
coordinates: [
|
||||
{ lat: 54, lon: 10 },
|
||||
@@ -617,7 +590,6 @@ describe("Watermaps API", () => {
|
||||
name: "BC",
|
||||
from: "b",
|
||||
to: "c",
|
||||
minDepthM: 4,
|
||||
source: "test-overpass",
|
||||
coordinates: [
|
||||
{ lat: 54.02, lon: 10.05 },
|
||||
@@ -679,7 +651,6 @@ describe("Watermaps API", () => {
|
||||
from: "start-decoy-a",
|
||||
to: "start-decoy-b",
|
||||
coordinates: [coordinate(53.3416, 7.186), coordinate(53.342, 7.187)],
|
||||
minDepthM: null,
|
||||
source: "closer-but-disconnected-start"
|
||||
},
|
||||
{
|
||||
@@ -688,7 +659,6 @@ describe("Watermaps API", () => {
|
||||
from: "destination-decoy-a",
|
||||
to: "destination-decoy-b",
|
||||
coordinates: [coordinate(53.3282, 6.9304), coordinate(53.3286, 6.9294)],
|
||||
minDepthM: null,
|
||||
source: "closer-but-disconnected-destination"
|
||||
},
|
||||
{
|
||||
@@ -697,7 +667,6 @@ describe("Watermaps API", () => {
|
||||
from: "shared-start",
|
||||
to: "shared-east",
|
||||
coordinates: [coordinate(53.34145, 7.18585), coordinate(53.3321722, 7.1329034)],
|
||||
minDepthM: null,
|
||||
source: "local-geofabrik-germany+netherlands"
|
||||
},
|
||||
{
|
||||
@@ -706,7 +675,6 @@ describe("Watermaps API", () => {
|
||||
from: "shared-east",
|
||||
to: "shared-south",
|
||||
coordinates: [coordinate(53.3321722, 7.1329034), coordinate(53.313849, 7.0011017)],
|
||||
minDepthM: null,
|
||||
source: "local-geofabrik-germany+netherlands"
|
||||
},
|
||||
{
|
||||
@@ -715,7 +683,6 @@ describe("Watermaps API", () => {
|
||||
from: "shared-south",
|
||||
to: "shared-destination",
|
||||
coordinates: [coordinate(53.313849, 7.0011017), coordinate(53.32805, 6.9302)],
|
||||
minDepthM: null,
|
||||
source: "local-geofabrik-germany+netherlands"
|
||||
}
|
||||
]
|
||||
@@ -765,7 +732,6 @@ describe("Watermaps API", () => {
|
||||
from,
|
||||
to,
|
||||
coordinates,
|
||||
minDepthM: 4,
|
||||
source: "test-alternatives"
|
||||
});
|
||||
const app = await buildServer({
|
||||
|
||||
Reference in New Issue
Block a user