Skip to content

Commit e0a9e71

Browse files
fix: box component now has a new property testId what will be rendered in the data-testid prop
1 parent 20fef39 commit e0a9e71

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/design-system/box/box.component.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export type BoxProps = Pick<
2525
| 'px'
2626
| 'py'
2727
| 'w'
28-
> & { className?: string; style?: CSSProperties };
28+
> & { className?: string; testId?: string; style?: CSSProperties };
2929

3030
export type Props = PropsWithChildren<BoxProps> &
3131
HTMLAttributes<HTMLDivElement>;
@@ -51,12 +51,14 @@ export const Box = forwardRef<HTMLDivElement | null, Readonly<Props>>(
5151
px,
5252
py,
5353
w,
54+
testId = 'box',
5455
...props
5556
},
5657
ref,
5758
): JSX.Element => (
5859
<div
5960
{...props}
61+
data-testid={testId}
6062
className={classNames(
6163
sx({ h, m, mb, ml, mr, mt, mx, my, p, pb, pl, pr, pt, px, py, w }),
6264
className,

0 commit comments

Comments
 (0)