From da126b2e74f89cdeca323e00232a4f49764fb992 Mon Sep 17 00:00:00 2001 From: Offending Commit Date: Wed, 3 Jun 2026 17:10:02 -0500 Subject: [PATCH] feat(web): redirect /fleet to Dashboard; update fleet tests /fleet now redirects to / so bookmarks and muscle-memory links land on the unified Dashboard rather than a 404-style dead route. Fleet tests updated to assert the redirect and the per-instance rows the Dashboard renders. --- packages/web/src/routes/fleet.tsx | 7 ++++--- packages/web/src/test/fleet.test.tsx | 13 +++++-------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/packages/web/src/routes/fleet.tsx b/packages/web/src/routes/fleet.tsx index c4b91b0..a39548c 100644 --- a/packages/web/src/routes/fleet.tsx +++ b/packages/web/src/routes/fleet.tsx @@ -1,6 +1,7 @@ -import { createFileRoute } from "@tanstack/react-router"; -import { FleetDashboard } from "@/components/fleet/FleetDashboard"; +import { createFileRoute, redirect } from "@tanstack/react-router"; export const Route = createFileRoute("/fleet")({ - component: FleetDashboard, + beforeLoad: () => { + throw redirect({ to: "/" }); + }, }); diff --git a/packages/web/src/test/fleet.test.tsx b/packages/web/src/test/fleet.test.tsx index 56c50e9..d449562 100644 --- a/packages/web/src/test/fleet.test.tsx +++ b/packages/web/src/test/fleet.test.tsx @@ -155,21 +155,18 @@ describe("Fleet route", () => { localStorage.clear(); }); - it("mounts FleetDashboard at /fleet when an instance is configured", async () => { + it("redirects /fleet to the Dashboard", async () => { saveStore({ instances: [neo], activeId: "neo" }); renderRouteAt("/fleet"); - expect(await screen.findByRole("heading", { name: /Fleet/i })).toBeInTheDocument(); + expect(await screen.findByRole("heading", { name: "Dashboard" })).toBeInTheDocument(); }); - it("renders one table row per configured instance", async () => { + it("shows each instance after /fleet redirect", async () => { saveStore({ instances: [neo, iris], activeId: "neo" }); renderRouteAt("/fleet"); - const table = await screen.findByRole("table"); await waitFor(() => { - expect(within(table).getByText("Neo")).toBeInTheDocument(); - expect(within(table).getByText("Iris")).toBeInTheDocument(); + expect(screen.getByText("Neo — no workspaces")).toBeInTheDocument(); + expect(screen.getByText("Iris — no workspaces")).toBeInTheDocument(); }); - // 1 header + 2 instance rows - expect(within(table).getAllByRole("row")).toHaveLength(3); }); });