Skip to content

Commit

Permalink
[TKAI-3543] test: add data-testid attribute on select-interactive and…
Browse files Browse the repository at this point in the history
… card value components (#134)

* test: add data-testid attribute on select-interactive

* test: add data-testid attribute on card value
  • Loading branch information
ickas authored Feb 26, 2024
1 parent f76251e commit 434aef5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/atoms/select-interactive/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ const SelectInteractive = ({
formatGroupLabel = true,
onChange = () => {},
onInputChange = () => {},
dataTestId,
...rest
}: SelectInteractiveProps<TSelectInteractiveOption>) => {
return (
<Styles.SelectWrapper {...rest}>
<Styles.SelectWrapper data-testid={dataTestId} {...rest}>
<Select
name={name}
value={value}
Expand Down
1 change: 1 addition & 0 deletions src/atoms/select-interactive/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ export interface SelectInteractiveProps<T extends Options>
value?: ReadonlyArray<TOptions> | TOptions | null | undefined;
onChange: (values: Array<TOptions> | TOptions) => void;
options: ReadonlyArray<TOptions | OptionsGroup<TOptions>>;
dataTestId?: string;
}
8 changes: 7 additions & 1 deletion src/molecules/card-value/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface CardValueProps {
onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
className?: string;
style?: React.CSSProperties;
dataTestId?: string;
}

const CardValue = (props: CardValueProps) => {
Expand All @@ -23,10 +24,15 @@ const CardValue = (props: CardValueProps) => {
onClick,
className = 'card-value',
style,
dataTestId,
} = props;

return (
<Styles.CardValueStyle className={className} style={style}>
<Styles.CardValueStyle
className={className}
style={style}
data-testid={dataTestId}
>
<Label value={label} currency={currency} />
<span>{value}</span>
{description && <p>{description}</p>}
Expand Down

0 comments on commit 434aef5

Please sign in to comment.