Merge pull request 'fix(pages): end the page at a closing footer, with no blank strip below' (#84) from fix-footer-flush-bottom into main
CI / build-and-publish (push) Failing after 0s
CI / build-and-publish (push) Failing after 0s
This commit was merged in pull request #84.
This commit is contained in:
commit
3597adb94c
2 files changed
+11
-1
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) => (
|
||||
|
||||
Reference in new issue
Block a user