fix(pages): end the page at a closing footer, with no blank strip below #84

Merged
ngqile merged 1 commits from fix-footer-flush-bottom into main 2026-12-04 06:02:08 +00:00
2 changed files with 11 additions and 1 deletions

No files matched your search

@@ -222,6 +222,15 @@ describe("LandingPage thank-you text and footer", () => {
expect(within(foot).getByText(/^© 2026/)).toHaveClass("border-t");
});
it("ends the page at the footer: no blank strip below a closing footer", () => {
const { unmount } = render(<LandingPage company={company} page={page([{ type: "FAQ", items: [{ question: "Q", answer: "A" }] }, footer])} />);
expect(screen.getByRole("main")).not.toHaveClass("pb-8");
expect(screen.getByRole("main")).not.toHaveClass("py-8");
unmount();
render(<LandingPage company={company} page={page([footer, { type: "FAQ", items: [{ question: "Q", answer: "A" }] }])} />);
expect(screen.getByRole("main").className).toMatch(/p[by]-8/);
});
it("keeps markup in footer text as text", () => {
render(<LandingPage company={company} page={page([{ type: "FOOTER", cards: [{ title: "Call", text: "<b>Call</b> +60 12-833 2775" }] }])} />);
const foot = screen.getByRole("contentinfo");
@@ -334,7 +334,8 @@ export function LandingPage({ company, page, banner, preview, frameBase, edit }:
)}
</div>
</header>}
<main className={page.hideHeader ? "pb-8" : "py-8"}>
{/* A closing footer is the page's end: no padding below it. */}
<main className={`${page.hideHeader ? "" : "pt-8"} ${page.blocks.at(-1)?.type === "FOOTER" ? "" : "pb-8"}`}>
<h1 className={page.hideHeader ? "sr-only" : `${WIDTH} mb-10 text-3xl font-semibold sm:text-4xl`}>{page.title}</h1>
<div>
{page.blocks.map((block, i) => (