Skip to content

Commit 7966000

Browse files
author
Hector Arce De Las Heras
committed
Update icon
Include data-testid value on button when icon has onclick prop
1 parent fd2137d commit 7966000

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/icon/icon.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ const IconBasicComponent = (
3333
$width={props.width}
3434
aria-disabled={disabled}
3535
aria-label={props['aria-label'] || altText}
36+
data-testid={iconProps.dataTestId}
3637
disabled={disabled}
3738
type={ButtonType.BUTTON}
3839
onClick={onClick}
3940
>
4041
<ScreenReaderOnly>{screenReaderText}</ScreenReaderOnly>
41-
<IconStandAlone {...iconProps} ref={ref} linearIcon={isLinearIcon} />
42+
<IconStandAlone {...iconProps} ref={ref} dataTestId={undefined} linearIcon={isLinearIcon} />
4243
</IconButtonStyled>
4344
);
4445
}

0 commit comments

Comments
 (0)