import { render, screen } from "@testing-library/react"; import { describe, it, expect, vi } from "vitest"; vi.mock("@/app/lib/AdminAuthContext", () => ({ useAdminAuth: () => ({ name: "Alice" }) })); import HomePage from "./page"; describe("HomePage", () => { it("shows the Co-Lite heading and welcomes the user by name", () => { render(); expect(screen.getByRole("heading", { name: "Co-Lite" })).toBeInTheDocument(); expect(screen.getByText("Welcome, Alice")).toBeInTheDocument(); }); });