import { describe, it, expect, vi } from "vitest"; import { renderWithProviders, screen } from "@/test/render"; // UserProfileMenu reads `useAuth().logout`, which requires the app's // AuthProvider — absent from the unit harness. Partially mock app-shell to // stub `useAuth` while preserving AppShell / useNavigate for renderWithProviders. vi.mock("@tailor-platform/app-shell", async (importOriginal) => { const actual = await importOriginal(); return { ...actual, useAuth: () => ({ logout: vi.fn(), login: vi.fn(), isReady: true, isAuthenticated: true }), }; }); const { UserProfileMenu } = await import("./user-profile-menu"); describe("UserProfileMenu", () => { it("renders the view-profile and sign-out affordances", async () => { await renderWithProviders(, { waitForButton: false }); expect(await screen.findByTitle("View profile")).toBeInTheDocument(); expect(screen.getByTitle("Sign out")).toBeInTheDocument(); }); });