Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit eefcb8b

Browse files
committed
feat: add dat test id
1 parent f3d7971 commit eefcb8b

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

packages/ui/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @codefixlabs/ui
22

3+
## 0.1.59
4+
5+
### Patch Changes
6+
7+
- Add data test id
8+
39
## 0.1.58
410

511
### Patch Changes

packages/ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codefixlabs/ui",
3-
"version": "0.1.58",
3+
"version": "0.1.59",
44
"license": "MIT",
55
"sideEffects": false,
66
"exports": {

packages/ui/src/react/data-table.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ export function DataTableToolbar<TData>({
422422
'flex flex-wrap items-center justify-between gap-4',
423423
className,
424424
)}
425+
data-test-id="toolbar"
425426
>
426427
<div className="flex grow items-center gap-2">
427428
<DataTableSearch table={table} />
@@ -442,8 +443,8 @@ export function DataTableToolbar<TData>({
442443
export function DataTablePagination<TData>({
443444
table,
444445
className,
445-
...props
446-
}: React.ComponentProps<'div'> & {
446+
}: {
447+
className?: string;
447448
table: TableType<TData>;
448449
}): React.JSX.Element {
449450
return (
@@ -452,7 +453,7 @@ export function DataTablePagination<TData>({
452453
'flex flex-wrap items-center justify-between gap-4',
453454
className,
454455
)}
455-
{...props}
456+
data-test-id="pagination"
456457
>
457458
<div className="text-muted-foreground grow text-sm">
458459
{table.getFilteredSelectedRowModel().rows.length} of{' '}
@@ -796,7 +797,6 @@ export function DataTable<TData>({
796797
<div className={twMerge('space-y-4', classNames.root)} data-test-id="root">
797798
<DataTableToolbar
798799
className={classNames.toolbar}
799-
data-test-id="toolbar"
800800
endToolbar={endToolbar}
801801
startToolbar={startToolbar}
802802
table={table}
@@ -807,11 +807,7 @@ export function DataTable<TData>({
807807
showFooter={showFooter}
808808
table={table}
809809
/>
810-
<DataTablePagination
811-
className={classNames.pagination}
812-
data-test-id="pagination"
813-
table={table}
814-
/>
810+
<DataTablePagination className={classNames.pagination} table={table} />
815811
</div>
816812
);
817813
}

0 commit comments

Comments
 (0)