multiple: fix selectable card actions

The Card component needs an aria-label when the card is selectable. Since this was
not set, a warning error was polluting the test output.

Fixes #3319
This commit is contained in:
Gianluca Zuccarelli 2025-06-18 13:20:20 +01:00 committed by Klara Simickova
parent 16e5bdbe3a
commit bac647ded6
2 changed files with 17 additions and 2 deletions

View file

@ -42,7 +42,15 @@ const BlueprintCard = ({ blueprint }: blueprintProps) => {
isClickable
onClick={() => dispatch(setBlueprintId(blueprint.id))}
>
<CardHeader data-testid={blueprint.id}>
<CardHeader
data-testid={blueprint.id}
selectableActions={{
name: blueprint.id,
selectableActionId: blueprint.id,
selectableActionAriaLabel: blueprint.id,
isHidden: true, // hide the card's checkbox
}}
>
<CardTitle>
{isLoading && blueprint.id === selectedBlueprintId && (
<Spinner size="md" />

View file

@ -66,7 +66,14 @@ const TargetEnvironmentCard = ({
isSelectable
isLarge
>
<CardHeader>
<CardHeader
selectableActions={{
name: title,
selectableActionId: title.toLowerCase(),
selectableActionAriaLabel: title.toLowerCase(),
isHidden: true, // hide the card's checkbox
}}
>
<Flex direction={{ default: 'column' }}>
<FlexItem>
<img className="provider-icon" src={imageSrc} alt={imageAlt} />