mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
fix(frontend): navbar missing (#10396)
## Changes 🏗️ <img width="1843" height="321" alt="Screenshot 2025-07-17 at 15 48 01" src="https://github.com/user-attachments/assets/63f528f7-1dc3-4587-a5af-d02b2c858191" /> In this recent PR https://github.com/Significant-Gravitas/AutoGPT/pull/10394/ the navigation bar disappeared when logged out. A change was introduced where the navigation bar does not show up if we don't have profile data ( _which we won't have when logged out_ ). This solves it + adds tests covering the navigation bar in the logged out state. ## Checklist 📋 ### For code changes: - [x] I have clearly listed my changes in the PR description - [x] I have made a test plan - [x] I have tested my changes according to the test plan: - [x] Run this locally - [x] See the navbar appearing - [x] E2E tests pass on the CI ### For configuration changes: None
This commit is contained in:
@@ -36,7 +36,7 @@ export default defineConfig({
|
||||
bypassCSP: true,
|
||||
},
|
||||
/* Maximum time one test can run for */
|
||||
timeout: 15000,
|
||||
timeout: 30000,
|
||||
|
||||
/* Configure web server to start automatically */
|
||||
webServer: {
|
||||
|
||||
@@ -22,10 +22,6 @@ export const NavbarView = ({ isLoggedIn }: NavbarViewProps) => {
|
||||
},
|
||||
});
|
||||
|
||||
if (!profile) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<nav className="sticky top-0 z-40 hidden h-16 items-center rounded-bl-2xl rounded-br-2xl border border-white/50 bg-[#f3f4f6]/20 p-3 backdrop-blur-[26px] md:inline-flex">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { getServerUser } from "@/lib/supabase/server/getServerUser";
|
||||
import { prefetchGetV2GetUserProfileQuery } from "@/app/api/__generated__/endpoints/store/store";
|
||||
import { getQueryClient } from "@/lib/react-query/queryClient";
|
||||
import { getServerUser } from "@/lib/supabase/server/getServerUser";
|
||||
|
||||
export async function getNavbarAccountData() {
|
||||
const { user } = await getServerUser();
|
||||
@@ -13,7 +13,6 @@ export async function getNavbarAccountData() {
|
||||
isLoggedIn,
|
||||
};
|
||||
}
|
||||
|
||||
try {
|
||||
await prefetchGetV2GetUserProfileQuery(queryClient);
|
||||
} catch (error) {
|
||||
|
||||
@@ -11,7 +11,7 @@ import { getTestUser } from "./utils/auth";
|
||||
import { hasUrl } from "./utils/assertion";
|
||||
|
||||
test.describe.configure({
|
||||
timeout: 40000,
|
||||
timeout: 60000,
|
||||
mode: "parallel",
|
||||
});
|
||||
|
||||
|
||||
@@ -3,13 +3,35 @@
|
||||
import test from "@playwright/test";
|
||||
import { getTestUser } from "./utils/auth";
|
||||
import { LoginPage } from "./pages/login.page";
|
||||
import { hasUrl, isVisible } from "./utils/assertion";
|
||||
import { hasUrl, isHidden, isVisible } from "./utils/assertion";
|
||||
import { getSelectors } from "./utils/selectors";
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto("/login");
|
||||
});
|
||||
|
||||
test("check the navigation when logged out", async ({ page }) => {
|
||||
const { getButton, getText, getLink } = getSelectors(page);
|
||||
|
||||
// Marketplace is by default the homepage
|
||||
await page.goto("/");
|
||||
await hasUrl(page, "/marketplace");
|
||||
|
||||
// Test marketplace link
|
||||
const marketplaceLink = getLink("Marketplace");
|
||||
await isVisible(marketplaceLink);
|
||||
await marketplaceLink.click();
|
||||
await hasUrl(page, "/marketplace");
|
||||
await isVisible(getText("Explore AI agents", { exact: false }));
|
||||
|
||||
// Test login button
|
||||
const loginBtn = getButton("Log In");
|
||||
await isVisible(loginBtn);
|
||||
await loginBtn.click();
|
||||
await hasUrl(page, "/login");
|
||||
await isHidden(loginBtn);
|
||||
});
|
||||
|
||||
test("user can login successfully", async ({ page }) => {
|
||||
const testUser = await getTestUser();
|
||||
const loginPage = new LoginPage(page);
|
||||
|
||||
Reference in New Issue
Block a user