diff --git a/ApiCore-Frontend/src/app/page.spec.tsx b/ApiCore-Frontend/src/app/page.spec.tsx index 2171645..123e849 100644 --- a/ApiCore-Frontend/src/app/page.spec.tsx +++ b/ApiCore-Frontend/src/app/page.spec.tsx @@ -1,17 +1,14 @@ -import { describe, expect, it } from "vitest"; -import { render, screen } from "@testing-library/react"; -import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; +import { describe, expect, it, vi } from "vitest"; +import { redirect } from "next/navigation"; import Page from "./page"; +vi.mock("next/navigation", () => ({ + redirect: vi.fn(), +})); + describe("Home page", () => { - it("renders without crashing", () => { - const queryClient = new QueryClient(); - render( - - - , - ); - expect(document.body).toBeTruthy(); - expect(screen.getByRole("main")).toBeInTheDocument(); + it("redirects to the dashboard", () => { + Page(); + expect(redirect).toHaveBeenCalledWith("/dashboard"); }); }); diff --git a/ApiCore-Frontend/src/app/page.tsx b/ApiCore-Frontend/src/app/page.tsx index c887311..a74cb27 100644 --- a/ApiCore-Frontend/src/app/page.tsx +++ b/ApiCore-Frontend/src/app/page.tsx @@ -1,69 +1,5 @@ -import Image from "next/image"; +import { redirect } from "next/navigation"; export default function Home() { - return ( -
-
- Next.js logo -
-

- To get started, edit the{" "} - - page.tsx - {" "} - file. -

-

- Looking for a starting point or more instructions? Head over to{" "} - - Templates - {" "} - or the{" "} - - Learning - {" "} - center. -

-
-
- - Vercel logomark - Deploy Now - - - Documentation - -
-
-
- ); + redirect("/dashboard"); }