Keep space under the guide logo and align header and body.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -179,15 +179,44 @@ describe("ContentBanner", () => {
|
||||
expect(screen.getByText("Test description")).toBeInTheDocument();
|
||||
expect(screen.queryByText("Test Author")).not.toBeInTheDocument();
|
||||
|
||||
const copyColumn = container.querySelector('[data-node-id="19189:9171"]');
|
||||
expect(copyColumn).toHaveClass(
|
||||
"md:max-w-[280px]",
|
||||
"lg:max-w-[365px]",
|
||||
"xl:max-w-[623px]",
|
||||
);
|
||||
expect(copyColumn).not.toHaveClass("max-w-[365px]");
|
||||
|
||||
const bannerRow = container.querySelector('[data-node-id="19189:9358"]');
|
||||
expect(bannerRow).toHaveClass("md:flex-row");
|
||||
expect(bannerRow?.className).toMatch(/xl:max-w-\[1312px\]/);
|
||||
|
||||
const logoMark = container.querySelector(
|
||||
'[data-node-id="22078:806960"] img',
|
||||
const logoMarkWrap = container.querySelector(
|
||||
'[data-node-id="22078:806960"]',
|
||||
);
|
||||
expect(logoMarkWrap?.className).toMatch(
|
||||
/max-sm:pb-\[var\(--spacing-scale-024\)\]/,
|
||||
);
|
||||
expect(logoMarkWrap).toHaveClass("md:justify-end");
|
||||
const logoMark = logoMarkWrap?.querySelector("img");
|
||||
expect(logoMark).toHaveAttribute(
|
||||
"src",
|
||||
expect.stringContaining("guide-banner-logo-arrow.svg"),
|
||||
);
|
||||
});
|
||||
|
||||
it("renders guide metadata under the title when updatedLabel is set", () => {
|
||||
render(
|
||||
<ContentBanner
|
||||
post={mockPost}
|
||||
variant="guide"
|
||||
updatedLabel="Last updated August 15, 2026."
|
||||
/>,
|
||||
);
|
||||
|
||||
expect(screen.getByText("Test Author")).toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByText("Last updated August 15, 2026."),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -7,10 +7,16 @@ import CookiesPage from "../../app/(marketing)/cookies/page";
|
||||
import messages from "../../messages/en/index";
|
||||
|
||||
vi.mock("../../app/components/sections/ContentBanner", () => ({
|
||||
default: ({ post, variant }) => (
|
||||
default: ({ post, variant, updatedLabel }) => (
|
||||
<section data-testid="content-banner" data-variant={variant}>
|
||||
<h1>{post.frontmatter.title}</h1>
|
||||
<p>{post.frontmatter.description}</p>
|
||||
{updatedLabel ? (
|
||||
<div>
|
||||
<span>{post.frontmatter.author}</span>
|
||||
<span>{updatedLabel}</span>
|
||||
</div>
|
||||
) : null}
|
||||
</section>
|
||||
),
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user