20 lines
515 B
React
20 lines
515 B
React
import { describe, test, expect, vi } from "vitest";
|
|
import UseCasesPage from "../../app/(marketing)/use-cases/page";
|
|
|
|
const { redirect } = vi.hoisted(() => ({
|
|
redirect: vi.fn((url) => {
|
|
throw new Error(`NEXT_REDIRECT:${url}`);
|
|
}),
|
|
}));
|
|
|
|
vi.mock("next/navigation", () => ({
|
|
redirect,
|
|
}));
|
|
|
|
describe("UseCasesPage", () => {
|
|
test("sends the use cases index to Learn", () => {
|
|
expect(() => UseCasesPage()).toThrow("NEXT_REDIRECT:/learn");
|
|
expect(redirect).toHaveBeenCalledWith("/learn");
|
|
});
|
|
});
|