Skip to content

Commit da126b2

Browse files
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.
1 parent 699ec38 commit da126b2

2 files changed

Lines changed: 9 additions & 11 deletions

File tree

packages/web/src/routes/fleet.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { createFileRoute } from "@tanstack/react-router";
2-
import { FleetDashboard } from "@/components/fleet/FleetDashboard";
1+
import { createFileRoute, redirect } from "@tanstack/react-router";
32

43
export const Route = createFileRoute("/fleet")({
5-
component: FleetDashboard,
4+
beforeLoad: () => {
5+
throw redirect({ to: "/" });
6+
},
67
});

packages/web/src/test/fleet.test.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,21 +155,18 @@ describe("Fleet route", () => {
155155
localStorage.clear();
156156
});
157157

158-
it("mounts FleetDashboard at /fleet when an instance is configured", async () => {
158+
it("redirects /fleet to the Dashboard", async () => {
159159
saveStore({ instances: [neo], activeId: "neo" });
160160
renderRouteAt("/fleet");
161-
expect(await screen.findByRole("heading", { name: /Fleet/i })).toBeInTheDocument();
161+
expect(await screen.findByRole("heading", { name: "Dashboard" })).toBeInTheDocument();
162162
});
163163

164-
it("renders one table row per configured instance", async () => {
164+
it("shows each instance after /fleet redirect", async () => {
165165
saveStore({ instances: [neo, iris], activeId: "neo" });
166166
renderRouteAt("/fleet");
167-
const table = await screen.findByRole("table");
168167
await waitFor(() => {
169-
expect(within(table).getByText("Neo")).toBeInTheDocument();
170-
expect(within(table).getByText("Iris")).toBeInTheDocument();
168+
expect(screen.getByText("Neo — no workspaces")).toBeInTheDocument();
169+
expect(screen.getByText("Iris — no workspaces")).toBeInTheDocument();
171170
});
172-
// 1 header + 2 instance rows
173-
expect(within(table).getAllByRole("row")).toHaveLength(3);
174171
});
175172
});

0 commit comments

Comments
 (0)