This is an automated email from the ASF dual-hosted git repository.

bbovenzi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 7f4b7fdea28 Add data-testid attributes to UI elements for unit test 
and automation tests (#43736)
7f4b7fdea28 is described below

commit 7f4b7fdea28eeefbc4803c2949f4df62be8e525d
Author: vatsrahul1001 <43964496+vatsrahul1...@users.noreply.github.com>
AuthorDate: Wed Nov 6 19:11:46 2024 +0530

    Add data-testid attributes to UI elements for unit test and automation 
tests (#43736)
---
 airflow/ui/src/components/DataTable/CardList.tsx  | 2 +-
 airflow/ui/src/components/DataTable/TableList.tsx | 7 ++++++-
 airflow/ui/src/components/SearchBar.tsx           | 1 +
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/airflow/ui/src/components/DataTable/CardList.tsx 
b/airflow/ui/src/components/DataTable/CardList.tsx
index da141e8eb3d..f6be5526817 100644
--- a/airflow/ui/src/components/DataTable/CardList.tsx
+++ b/airflow/ui/src/components/DataTable/CardList.tsx
@@ -32,7 +32,7 @@ export const CardList = <TData,>({
   isLoading,
   table,
 }: DataTableProps<TData>) => (
-  <Box overflow="auto" width="100%">
+  <Box data-testid="card-list" overflow="auto" width="100%">
     <SimpleGrid {...{ column: { base: 1 }, gap: 2, ...cardDef.gridProps }}>
       {table.getRowModel().rows.map((row) => (
         <Box key={row.id}>
diff --git a/airflow/ui/src/components/DataTable/TableList.tsx 
b/airflow/ui/src/components/DataTable/TableList.tsx
index 0427f44cfb5..3e7a3fffa82 100644
--- a/airflow/ui/src/components/DataTable/TableList.tsx
+++ b/airflow/ui/src/components/DataTable/TableList.tsx
@@ -40,7 +40,12 @@ export const TableList = <TData,>({
   renderSubComponent,
   table,
 }: DataTableProps<TData>) => (
-  <Table.Root maxH="calc(100vh - 10rem)" overflowY="auto" striped>
+  <Table.Root
+    data-testid="table-list"
+    maxH="calc(100vh - 10rem)"
+    overflowY="auto"
+    striped
+  >
     <Table.Header bg="chakra-body-bg" position="sticky" top={0} zIndex={1}>
       {table.getHeaderGroups().map((headerGroup) => (
         <Table.Row key={headerGroup.id}>
diff --git a/airflow/ui/src/components/SearchBar.tsx 
b/airflow/ui/src/components/SearchBar.tsx
index 6f74ad5a104..9c72b63443b 100644
--- a/airflow/ui/src/components/SearchBar.tsx
+++ b/airflow/ui/src/components/SearchBar.tsx
@@ -62,6 +62,7 @@ export const SearchBar = ({
       startElement={<FiSearch />}
     >
       <Input
+        data-testid="search-dags"
         placeholder="Search Dags"
         pr={150}
         {...inputProps}

Reply via email to