Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

fix(frontend): navbar missing (#10396)

Ubbeb6a51fdc19a7
diff --git a/autogpt_platform/frontend/playwright.config.ts b/autogpt_platform/frontend/playwright.config.ts
index 2462064e08..f0735ac929 100644
--- a/autogpt_platform/frontend/playwright.config.ts
+++ b/autogpt_platform/frontend/playwright.config.ts
@@ -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: {
diff --git a/autogpt_platform/frontend/src/components/layout/Navbar/components/NavbarMainPage.tsx b/autogpt_platform/frontend/src/components/layout/Navbar/components/NavbarMainPage.tsx
index a2cb606ac8..04fb0e4aa2 100644
--- a/autogpt_platform/frontend/src/components/layout/Navbar/components/NavbarMainPage.tsx
+++ b/autogpt_platform/frontend/src/components/layout/Navbar/components/NavbarMainPage.tsx
@@ -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">
diff --git a/autogpt_platform/frontend/src/components/layout/Navbar/data.ts b/autogpt_platform/frontend/src/components/layout/Navbar/data.ts
index 4a04c6b102..0d07cef78b 100644
--- a/autogpt_platform/frontend/src/components/layout/Navbar/data.ts
+++ b/autogpt_platform/frontend/src/components/layout/Navbar/data.ts
@@ -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) {
diff --git a/autogpt_platform/frontend/src/tests/build.spec.ts b/autogpt_platform/frontend/src/tests/build.spec.ts
index 74d07629cf..ad4b265733 100644
--- a/autogpt_platform/frontend/src/tests/build.spec.ts
+++ b/autogpt_platform/frontend/src/tests/build.spec.ts
@@ -11,7 +11,7 @@ import { getTestUser } from "./utils/auth";
import { hasUrl } from "./utils/assertion";
test.describe.configure({
- timeout: 40000,
+ timeout: 60000,
mode: "parallel",
});
diff --git a/autogpt_platform/frontend/src/tests/signin.spec.ts b/autogpt_platform/frontend/src/tests/signin.spec.ts
index d9bb5c796c..e2a4697f09 100644
--- a/autogpt_platform/frontend/src/tests/signin.spec.ts
+++ b/autogpt_platform/frontend/src/tests/signin.spec.ts
@@ -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);