diff --git a/src/docs/pages/table/Table.tsx b/src/docs/pages/table/Table.tsx index f571dce..eb87547 100644 --- a/src/docs/pages/table/Table.tsx +++ b/src/docs/pages/table/Table.tsx @@ -92,6 +92,7 @@ export const Table = () => { return "Name"; } }, + testId: "nameColumn", render: (person: Person) => (
diff --git a/src/lib/components/table/Table.tsx b/src/lib/components/table/Table.tsx index 3e4545a..4027912 100644 --- a/src/lib/components/table/Table.tsx +++ b/src/lib/components/table/Table.tsx @@ -33,6 +33,7 @@ type Column = { header: TableHeaderCellProps["header"]; render?: (row: T, rowIndex: number) => React.ReactNode; className?: string; + testId?: string; }; type Props = { @@ -190,10 +191,10 @@ export const VuiTable = ({ {/* Row info */} {columns.map((column) => { - const { name, render, className } = column; + const { name, render, className, testId } = column; return ( - + {render ? render(row, rowIndex) : row[column.name]} );