From d428fb6cb5426e0da2a986cbabf601c1a9479141 Mon Sep 17 00:00:00 2001 From: Cristhian Zanforlin Lousa Date: Thu, 16 Jan 2025 13:05:04 -0300 Subject: [PATCH] feat: Add data-testid and id attributes to app header components for testing (#5724) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 📝 (AccountMenu/index.tsx): Add span elements with data-testid and id attributes for menu buttons for better testing and accessibility 📝 (FlowMenu/index.tsx): Add data-testid and id attributes to div elements for menu buttons for better testing and accessibility 📝 (HeaderMenu/index.tsx): Add data-testid and id attributes to DropdownMenuTrigger for user menu button for better testing and accessibility 📝 (ThemeButtons/index.tsx): Add data-testid and id attributes to Button elements for theme change buttons for better testing and accessibility 📝 (flowToolbarComponent/index.tsx): Add data-testid and id attributes to div element for API button modal for better testing and accessibility * ✨ (FlowMenu/index.tsx): add data-testid attributes to elements for easier testing and debugging ✨ (AppHeaderComponent/index.tsx): add data-testid attributes to header sections for easier testing and debugging --- .../components/AccountMenu/index.tsx | 44 ++++++++++++++--- .../components/FlowMenu/index.tsx | 49 ++++++++++++++++--- .../components/HeaderMenu/index.tsx | 6 ++- .../components/ThemeButtons/index.tsx | 6 +++ .../core/appHeaderComponent/index.tsx | 10 +++- .../core/flowToolbarComponent/index.tsx | 6 ++- 6 files changed, 103 insertions(+), 18 deletions(-) diff --git a/src/frontend/src/components/core/appHeaderComponent/components/AccountMenu/index.tsx b/src/frontend/src/components/core/appHeaderComponent/components/AccountMenu/index.tsx index bb18866b2..28063e3a1 100644 --- a/src/frontend/src/components/core/appHeaderComponent/components/AccountMenu/index.tsx +++ b/src/frontend/src/components/core/appHeaderComponent/components/AccountMenu/index.tsx @@ -57,7 +57,12 @@ export const AccountMenu = () => {
- Version {version} + + Version {version} +
{!ENABLE_DATASTAX_LANGFLOW && }
@@ -72,25 +77,42 @@ export const AccountMenu = () => { navigate("/settings"); }} > - Settings + + Settings + )} {!ENABLE_DATASTAX_LANGFLOW && ( <> {isAdmin && !autoLogin && ( navigate("/admin")}> - Admin Page + + Admin Page + )} )} {ENABLE_DATASTAX_LANGFLOW ? ( setIsFeedbackOpen(true)}> - Feedback + + Feedback + ) : ( - Docs + + Docs + )}
@@ -110,14 +132,20 @@ export const AccountMenu = () => { newPage href="https://github.com/langflow-ai/langflow/discussions" > - Share Feedback on Github + + Share Feedback on Github + )} - Follow Langflow on X + + Follow Langflow on X + - Join the Langflow Discord + + Join the Langflow Discord + {ENABLE_DATASTAX_LANGFLOW ? ( diff --git a/src/frontend/src/components/core/appHeaderComponent/components/FlowMenu/index.tsx b/src/frontend/src/components/core/appHeaderComponent/components/FlowMenu/index.tsx index 5db3d6896..3b8da45c5 100644 --- a/src/frontend/src/components/core/appHeaderComponent/components/FlowMenu/index.tsx +++ b/src/frontend/src/components/core/appHeaderComponent/components/FlowMenu/index.tsx @@ -123,7 +123,11 @@ export const MenuBar = ({}: {}): JSX.Element => { } // return savedText; return ( -
+ ); @@ -213,8 +217,15 @@ export const MenuBar = ({}: {}): JSX.Element => { ]); return currentFlow && onFlowPage ? ( -
-
+
+