diff --git a/app/components/_layouts/navbar/profile-menu.test.tsx b/app/components/_layouts/navbar/profile-menu.test.tsx
new file mode 100644
index 00000000..1e9fb810
--- /dev/null
+++ b/app/components/_layouts/navbar/profile-menu.test.tsx
@@ -0,0 +1,55 @@
+import userEvent from "@testing-library/user-event";
+import { screen } from "@testing-library/react";
+import type { User } from "~/lib/models/user.server";
+import { renderWithRouter } from "~/test/render-with-router";
+import ProfileMenu from "./profile-menu";
+
+describe("ProfileMenu", () => {
+ const baseUser: User = {
+ id: 1,
+ name: "Ícaro Harry",
+ email: "icaro@example.com",
+ github_id: "123",
+ is_pro: true,
+ github_user: "icaroharry",
+ settings: null,
+ avatar: {
+ avatar_url: "https://example.com/avatar.jpg",
+ name: "Ícaro Harry",
+ badge: null,
+ github_user: "icaroharry",
+ },
+ };
+
+ it("shows a Meu Perfil link when the user has a github username", async () => {
+ const user = userEvent.setup();
+
+ renderWithRouter(() => );
+
+ await user.click(screen.getByRole("button"));
+
+ expect(
+ screen.getByRole("menuitem", { name: "Meu Perfil" }),
+ ).toHaveAttribute("href", "/perfil/icaroharry");
+ });
+
+ it("hides the Meu Perfil link when the user has no github username", async () => {
+ const user = userEvent.setup();
+ const userWithoutGithub = {
+ ...baseUser,
+ github_user: undefined,
+ avatar: {
+ ...baseUser.avatar,
+ github_user: undefined,
+ },
+ };
+
+ renderWithRouter(() => );
+
+ await user.click(screen.getByRole("button"));
+
+ expect(
+ screen.queryByRole("menuitem", { name: "Meu Perfil" }),
+ ).not.toBeInTheDocument();
+ });
+});
diff --git a/app/components/_layouts/navbar/profile-menu.tsx b/app/components/_layouts/navbar/profile-menu.tsx
index 76dd635e..b979afce 100644
--- a/app/components/_layouts/navbar/profile-menu.tsx
+++ b/app/components/_layouts/navbar/profile-menu.tsx
@@ -7,6 +7,8 @@ import classNames from "~/lib/utils/class-names";
import UserAvatar from "~/components/ui/user-avatar";
export default function ProfileMenu({ user }: { user: User }) {
+ const githubUser = user.github_user ?? user.avatar?.github_user;
+
return (