Give the shell one header, a skip link, and a cookie-aware first paint.

Breakpoint clones were still in the tab order, marketing always painted Log in, and at 430px the logo overlay covered Use cases and Learn.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
adilallo
2026-09-09 17:12:59 -06:00
co-authored by Cursor
parent aecb890cc8
commit 5242f8c6bb
22 changed files with 309 additions and 320 deletions
+34
View File
@@ -0,0 +1,34 @@
import { describe, expect, it, vi } from "vitest";
import "@testing-library/jest-dom/vitest";
import TopWithPathname from "../../app/components/navigation/Top/TopWithPathname";
import { renderWithProviders, screen } from "../utils/test-utils";
const { pushMock } = vi.hoisted(() => ({ pushMock: vi.fn() }));
vi.mock("next/navigation", () => ({
useRouter: () => ({
push: pushMock,
replace: vi.fn(),
prefetch: vi.fn(),
back: vi.fn(),
forward: vi.fn(),
refresh: vi.fn(),
}),
usePathname: () => "/learn",
}));
vi.mock("../../lib/create/api", () => ({
fetchAuthSession: () => new Promise(() => {}),
}));
describe("TopWithPathname", () => {
it("renders Profile from the server session before /api/auth/session resolves", () => {
renderWithProviders(<TopWithPathname initialSignedIn />);
expect(
screen.getByRole("menuitem", { name: /go to your profile/i }),
).toBeInTheDocument();
expect(
screen.queryByRole("button", { name: /log in to your account/i }),
).not.toBeInTheDocument();
});
});