islandflow/apps/web/app/routes.test.ts
dirtydishes c0219233d3 Simplify web terminal routes and home layout
- Redirect legacy signals/charts/replay pages to home
- Trim nav and update live subscriptions for home and tape
- Refresh terminal topbar and layout behavior
2026-05-04 13:42:47 -04:00

31 lines
945 B
TypeScript

import { beforeEach, describe, expect, it, mock } from "bun:test";
const redirect = mock((path: string) => {
throw new Error(`NEXT_REDIRECT:${path}`);
});
mock.module("next/navigation", () => ({ redirect }));
describe("legacy page redirects", () => {
beforeEach(() => {
redirect.mockClear();
});
it("redirects /signals to home", async () => {
const mod = await import("./signals/page");
expect(() => mod.default()).toThrow("NEXT_REDIRECT:/");
expect(redirect).toHaveBeenCalledWith("/");
});
it("redirects /charts to home", async () => {
const mod = await import("./charts/page");
expect(() => mod.default()).toThrow("NEXT_REDIRECT:/");
expect(redirect).toHaveBeenCalledWith("/");
});
it("redirects /replay to home", async () => {
const mod = await import("./replay/page");
expect(() => mod.default()).toThrow("NEXT_REDIRECT:/");
expect(redirect).toHaveBeenCalledWith("/");
});
});