Skip to content

Commit b65555c

Browse files
committed
chore: add data-testid for multiselect component
1 parent 8968fcc commit b65555c

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

site/src/components/MultiSelectCombobox/MultiSelectCombobox.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ interface MultiSelectComboboxProps {
9797
>;
9898
/** hide or show the button that clears all the selected options. */
9999
hideClearAllButton?: boolean;
100+
/** Test ID for testing purposes */
101+
"data-testid"?: string;
100102
}
101103

102104
interface MultiSelectComboboxRef {
@@ -198,6 +200,7 @@ export const MultiSelectCombobox = forwardRef<
198200
commandProps,
199201
inputProps,
200202
hideClearAllButton = false,
203+
"data-testid": dataTestId,
201204
}: MultiSelectComboboxProps,
202205
ref,
203206
) => {
@@ -447,6 +450,7 @@ export const MultiSelectCombobox = forwardRef<
447450
<Command
448451
ref={dropdownRef}
449452
{...commandProps}
453+
data-testid={dataTestId}
450454
onKeyDown={(e) => {
451455
handleKeyDown(e);
452456
commandProps?.onKeyDown?.(e);

site/src/modules/workspaces/DynamicParameter/DynamicParameter.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ const ParameterField: FC<ParameterFieldProps> = ({
454454
inputProps={{
455455
id: id,
456456
}}
457+
data-testid={`multiselect-${parameter.name}`}
457458
options={options}
458459
defaultOptions={selectedOptions}
459460
onChange={(newValues) => {

0 commit comments

Comments
 (0)