14 lines
431 B
TypeScript
14 lines
431 B
TypeScript
import { describe, expect, it, vi } from "vitest";
|
|
|
|
vi.mock("next/navigation", () => ({ redirect: vi.fn() }));
|
|
import { redirect } from "next/navigation";
|
|
import Home from "./page";
|
|
|
|
describe("home redirect", () => {
|
|
it("uses the fixed same-site destination without a request URL or query", () => {
|
|
Home();
|
|
expect(redirect).toHaveBeenCalledTimes(1);
|
|
expect(redirect).toHaveBeenCalledWith("/generalsearch");
|
|
});
|
|
});
|