import { render } from "@testing-library/react"; import { describe, it, expect, vi } from "vitest"; vi.mock("next/navigation", () => ({ usePathname: () => "/", })); import ClientMain from "./ClientMain"; describe("ClientMain", () => { it("pads the scroll region past the nav height plus the bottom safe-area inset", () => { const { container } = render(
content
, ); const main = container.querySelector("main"); expect(main).not.toBeNull(); // Underscores are Tailwind's spaces → calc(6rem + env(safe-area-inset-bottom)). expect(main!.className).toContain("pb-[calc(6rem_+_env(safe-area-inset-bottom))]"); // The fixed pb-24 must be gone so content clears the home indicator. expect(main!.className).not.toContain("pb-24"); }); });