Restore the folder header to Figma layout without cloning the nav, and page-center inner-page links with the home cluster.
Park the skip link in the Tailwind sheet so it cannot sit in document flow and push the yellow tab down. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -172,7 +172,40 @@ describe("Top header chrome", () => {
|
||||
renderWithProviders(<Top folderTop={false} loggedIn />);
|
||||
const logo = document.querySelector("[data-top='logo']");
|
||||
const nav = document.querySelector("[data-top='nav']");
|
||||
const headerNav = document.querySelector("header nav");
|
||||
expect(logo?.className).not.toMatch(/\bz-20\b/);
|
||||
expect(nav?.className).not.toMatch(/\babsolute\b/);
|
||||
expect(headerNav?.className).toContain(
|
||||
"md:grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)]",
|
||||
);
|
||||
});
|
||||
|
||||
it("hugs the home folder tab below md and page-centers nav from md", () => {
|
||||
renderWithProviders(<Top folderTop />);
|
||||
const tab = document.querySelector(".HeaderTab");
|
||||
const nav = document.querySelector("[data-top='nav']");
|
||||
expect(tab?.className).toContain("w-fit");
|
||||
expect(tab?.className).toContain("sm:w-auto");
|
||||
expect(tab?.className).toContain("sm:flex-1");
|
||||
expect(nav?.className).toContain("md:absolute");
|
||||
expect(nav?.className).toContain(
|
||||
"md:left-[calc(50vw-var(--spacing-scale-016))]",
|
||||
);
|
||||
expect(nav?.className).not.toContain("ml-auto");
|
||||
});
|
||||
|
||||
it("keeps a single home nav cluster and shows the folder wordmark", () => {
|
||||
renderWithProviders(<Top folderTop />);
|
||||
expect(
|
||||
screen.getAllByRole("menuitem", {
|
||||
name: /navigate to use cases page/i,
|
||||
hidden: true,
|
||||
}),
|
||||
).toHaveLength(1);
|
||||
const wordmark = screen.getByText("CommunityRule");
|
||||
expect(wordmark.className).not.toMatch(/\bhidden\b/);
|
||||
expect(
|
||||
screen.getByRole("button", { name: /create a new rule/i }).className,
|
||||
).toContain("md:text-x-small-label");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user