Skip to content

Commit

Permalink
add testId to Message (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkim-det authored Sep 5, 2024
1 parent 870ce42 commit 120f810
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/kit/Message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import css from './Message.module.scss';
interface base {
action?: React.ReactElement;
icon?: IconName | React.ReactElement;
testId?: string;
}
interface descriptionRequired extends base {
description: ReactNode;
Expand All @@ -21,7 +22,7 @@ interface titleRequired extends base {

export type Props = descriptionRequired | titleRequired;

const Message: React.FC<Props> = ({ action, description, title, icon }: Props) => {
const Message: React.FC<Props> = ({ action, description, title, icon, testId }: Props) => {
const {
themeSettings: { className: themeClass },
} = useTheme();
Expand All @@ -35,7 +36,7 @@ const Message: React.FC<Props> = ({ action, description, title, icon }: Props) =
};

return (
<div className={classes.join(' ')}>
<div className={classes.join(' ')} data-testid={testId}>
{icon && getIcon(icon)}
{title && <Title>{title}</Title>}
{description && <span className={css.description}>{description}</span>}
Expand Down

0 comments on commit 120f810

Please sign in to comment.