Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/avatar/internal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
>
{showTooltip && tooltipText && (
<Tooltip
className={styles.tooltip}

Check warning on line 109 in src/avatar/internal.tsx

View workflow job for this annotation

GitHub Actions / build / build

Prop "className" is forbidden on Components

Check warning on line 109 in src/avatar/internal.tsx

View workflow job for this annotation

GitHub Actions / dry-run / Build chat components

Prop "className" is forbidden on Components
value={tooltipText}
trackRef={handleRef}
// This is added to ensure tooltip is closed when clicked for consistency with other tooltip usages
Expand Down
4 changes: 4 additions & 0 deletions src/avatar/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,7 @@
);
}
}

.tooltip {
/* used in test-utils */
}
7 changes: 3 additions & 4 deletions src/test-utils/dom/avatar/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import TooltipWrapper from "@cloudscape-design/components/test-utils/dom/internal/tooltip";
import { ComponentWrapper } from "@cloudscape-design/test-utils-core/dom";
import { ComponentWrapper, ElementWrapper } from "@cloudscape-design/test-utils-core/dom";

import createWrapper from "..";

Expand All @@ -10,7 +9,7 @@ import avatarStyles from "../../../avatar/styles.selectors.js";
export default class AvatarWrapper extends ComponentWrapper {
static rootSelector: string = avatarStyles.root;

findTooltip(): TooltipWrapper | null {
return createWrapper().findComponent(`.${TooltipWrapper.rootSelector}`, TooltipWrapper);
findTooltip(): ElementWrapper | null {
return createWrapper().find(`.${avatarStyles.tooltip}`);
}
}
Loading