Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

feat: profile link in navbar #8276

Merged
merged 2 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions components/navbar/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ export default function Navbar() {
name: "Docs",
url: "/docs",
},
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are removing playground from the nav bar, you need to remove this test

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh good spot, thank you 👍

name: "Playground",
url: "/playground",
},
];

const authControls = () => (
Expand All @@ -112,6 +108,10 @@ export default function Navbar() {

{session && (
<>
<NavLink
item={{ name: "Profile", url: `/${session.username}` }}
setIsOpen={setIsOpen}
/>
<NavLink
item={{ name: "Account", url: "/account/statistics" }}
setIsOpen={setIsOpen}
Expand Down
8 changes: 1 addition & 7 deletions tests/playground.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,9 @@ test("Playground has title", async ({ page }) => {
await expect(page).toHaveTitle(/Playground/);
});

test("Navigate to Playground", async ({ page }) => {
await page.goto("/");
await page.getByRole("link", { name: "Playground", exact: true }).click();
await expect(page.locator("h1")).toHaveText("Playground");
});

test("Playground Opens correctly", async ({ page }) => {
// 1. Navigate to playground page.
await page.goto("playground");
await page.goto("/playground");

// 2. See the input field to enter github username
await page.getByPlaceholder("Enter github username").click();
Expand Down