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:
@@ -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();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user