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): init LD on the client (#10414)
Ubbe61d08926862c
diff --git a/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/AccountMenu.tsx b/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/AccountMenu.tsxindex 18312607e5..794c0aab42 100644--- a/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/AccountMenu.tsx+++ b/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/AccountMenu.tsx@@ -63,7 +63,10 @@ export function AccountMenu({<div className="max-w-[10.5rem] truncate font-sans text-base font-semibold leading-none text-white dark:text-neutral-200">{userName}</div>- <div className="max-w-[10.5rem] truncate font-sans text-base font-normal leading-none text-white dark:text-neutral-400">+ <div+ data-testid="account-menu-user-email"+ className="max-w-[10.5rem] truncate font-sans text-base font-normal leading-none text-white dark:text-neutral-400"+ >{userEmail}</div></div>diff --git a/autogpt_platform/frontend/src/services/feature-flags/feature-flag-provider.tsx b/autogpt_platform/frontend/src/services/feature-flags/feature-flag-provider.tsxindex 10677f9b6c..d47026b50d 100644--- a/autogpt_platform/frontend/src/services/feature-flags/feature-flag-provider.tsx+++ b/autogpt_platform/frontend/src/services/feature-flags/feature-flag-provider.tsx@@ -1,3 +1,5 @@+"use client";+import { LDProvider } from "launchdarkly-react-client-sdk";import { ReactNode } from "react";import { useSupabase } from "@/lib/supabase/hooks/useSupabase";diff --git a/autogpt_platform/frontend/src/tests/signin.spec.ts b/autogpt_platform/frontend/src/tests/signin.spec.tsindex 4a102ec687..21993d5224 100644--- a/autogpt_platform/frontend/src/tests/signin.spec.ts+++ b/autogpt_platform/frontend/src/tests/signin.spec.ts@@ -31,7 +31,7 @@ test("check the navigation when logged out", async ({ page }) => {test("user can login successfully", async ({ page }) => {const testUser = await getTestUser();const loginPage = new LoginPage(page);- const { getId, getButton, getText, getRole } = getSelectors(page);+ const { getId, getButton, getRole } = getSelectors(page);await loginPage.login(testUser.email, testUser.password);await hasUrl(page, "/marketplace");@@ -44,8 +44,11 @@ test("user can login successfully", async ({ page }) => {const accountMenuPopover = getRole("dialog");await isVisible(accountMenuPopover);- const username = testUser.email.split("@")[0];- await isVisible(getText(username));+ const accountMenuUserEmail = getId("account-menu-user-email");+ await isVisible(accountMenuUserEmail);+ await test+ .expect(accountMenuUserEmail)+ .toHaveText(testUser.email.split("@")[0].toLowerCase());const logoutBtn = getButton("Log out");await isVisible(logoutBtn);