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); }); });