Skip to content

Commit

Permalink
feat(User): added qa attribute for name and description nodes (#1429)
Browse files Browse the repository at this point in the history
  • Loading branch information
kapibaara authored Mar 20, 2024
1 parent c15f2e3 commit ef6143a
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/components/User/User.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ import './User.scss';

const b = block('user');

export const UserQa = {
NAME: 'user-name',
DESCRIPTION: 'user-description',
};

export const User = React.forwardRef<HTMLDivElement, UserProps>(
(
{
Expand Down Expand Up @@ -42,9 +47,15 @@ export const User = React.forwardRef<HTMLDivElement, UserProps>(
) : null}
{name || showDescription ? (
<div className={b('info')}>
{name ? <span className={b('name')}>{name}</span> : null}
{name ? (
<span className={b('name')} data-qa={UserQa.NAME}>
{name}
</span>
) : null}
{showDescription ? (
<span className={b('description')}>{description}</span>
<span className={b('description')} data-qa={UserQa.DESCRIPTION}>
{description}
</span>
) : null}
</div>
) : null}
Expand Down

0 comments on commit ef6143a

Please sign in to comment.