Hinweise optimiert
Test and publish container images / test (push) Successful in 2m27s
Test and publish container images / publish (push) Failing after 4s

This commit is contained in:
BuTzZ
2026-07-27 13:04:32 +02:00
parent 9813a1fafb
commit b98ec8bc6f
34 changed files with 500 additions and 399 deletions
+53
View File
@@ -0,0 +1,53 @@
import { describe, expect, it } from "vitest";
import type { RouteWarning } from "@watermaps/shared";
import {
isOpenRouteWarning,
isRetainedRouteWarning
} from "../src/lib/route-warnings";
describe("route warning filters", () => {
it("filters every retired fairway and depth warning code centrally", () => {
const retiredCodes = [
"FAIRWAY_ROUTE",
"FAIRWAY_DATA_NOT_OFFICIAL",
"DEPTH_UNKNOWN",
"DEPTH_PARTIAL",
"NO_KNOWN_DEPTH",
"DEPTH_TOO_SHALLOW"
];
for (const code of retiredCodes) {
const warning: RouteWarning = {
code,
severity: "critical",
message: `Alter Hinweis ${code}`
};
expect(isRetainedRouteWarning(warning)).toBe(false);
expect(isOpenRouteWarning(warning)).toBe(false);
}
});
it("retains current warnings and only counts non-informational ones as open", () => {
expect(
isRetainedRouteWarning({
code: "ROUTE_SEARCH_LIMITED",
severity: "caution",
message: "Suche begrenzt"
})
).toBe(true);
expect(
isOpenRouteWarning({
code: "ROUTE_SEARCH_LIMITED",
severity: "caution",
message: "Suche begrenzt"
})
).toBe(true);
expect(
isOpenRouteWarning({
code: "ROUTING_SOURCE",
severity: "info",
message: "Routingquelle"
})
).toBe(false);
});
});