Bootssymbol hinzugefügt
Test and publish container images / test (push) Successful in 2m20s
Test and publish container images / publish (push) Failing after 4s

This commit is contained in:
BuTzZ
2026-07-26 12:31:49 +02:00
parent c9a20aacd7
commit 55ce94066e
19 changed files with 1969 additions and 122 deletions
+16 -5
View File
@@ -2,12 +2,13 @@ import "@testing-library/jest-dom/vitest";
import { act, cleanup, fireEvent, render, screen } from "@testing-library/react";
import { afterEach, describe, expect, it, vi } from "vitest";
import { RoutePlanner } from "../src/components/RoutePlanner";
import { DEFAULT_BOAT_PROFILE } from "../src/lib/boat-profile";
import type { RouteWeatherReport } from "../src/routeWeatherReport";
afterEach(() => cleanup());
describe("RoutePlanner", () => {
it("submits vessel profile when start and destination exist", () => {
it("uses the current boat while submitting route coordinates", () => {
const onSubmit = vi.fn();
render(
<RoutePlanner
@@ -19,6 +20,16 @@ describe("RoutePlanner", () => {
weatherReport={null}
weatherLoading={false}
weatherError={null}
boatProfile={{
...DEFAULT_BOAT_PROFILE,
name: "Seestern",
category: "sailboat",
lengthM: 9.4,
draughtM: 1.8,
airDraftM: 13.2,
beamM: 3.3,
cruiseSpeedKn: 6.5
}}
loading={false}
error={null}
pickMode={null}
@@ -39,9 +50,10 @@ describe("RoutePlanner", () => {
start: { lat: 54.18, lon: 12.08 },
destination: { lat: 54.2, lon: 12.1 },
waypoints: [],
departureTime: expect.any(String),
vesselProfile: { draughtM: 1.4, safetyReserveM: 0.5, airDraftM: 2.5, beamM: 3.2, cruiseSpeedKn: 6 }
departureTime: expect.any(String)
});
expect(screen.getByRole("region", { name: "Aktuelles Boot: Seestern" })).toBeVisible();
expect(screen.queryByLabelText("Tiefgang (m)")).not.toBeInTheDocument();
});
it("submits ordered waypoints together with the selected departure time", () => {
@@ -86,8 +98,7 @@ describe("RoutePlanner", () => {
start: { lat: 53.344167, lon: 7.186111 },
destination: { lat: 51.6814536, lon: 7.8042615 },
waypoints,
departureTime: new Date(localDeparture).toISOString(),
vesselProfile: { draughtM: 1.4, safetyReserveM: 0.5, airDraftM: 2.5, beamM: 3.2, cruiseSpeedKn: 6 }
departureTime: new Date(localDeparture).toISOString()
});
});