aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/design-system/src
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/design-system/src')
-rw-r--r--server/sonar-web/design-system/src/components/Breadcrumbs.tsx3
-rw-r--r--server/sonar-web/design-system/src/components/__tests__/TreeMap-test.tsx2
2 files changed, 4 insertions, 1 deletions
diff --git a/server/sonar-web/design-system/src/components/Breadcrumbs.tsx b/server/sonar-web/design-system/src/components/Breadcrumbs.tsx
index 056cde51d59..be9238b0222 100644
--- a/server/sonar-web/design-system/src/components/Breadcrumbs.tsx
+++ b/server/sonar-web/design-system/src/components/Breadcrumbs.tsx
@@ -38,6 +38,7 @@ import { ChevronDownIcon, ChevronRightIcon } from './icons';
const WIDTH_OF_BREADCRUMB_DROPDOWN = 32;
interface Props {
+ actions?: React.ReactNode;
ariaLabel?: string;
breadcrumbLimit?: number;
children: React.ReactNode;
@@ -55,6 +56,7 @@ export function Breadcrumbs(props: Props) {
children,
expandButtonLabel,
innerRef,
+ actions,
maxWidth = LAYOUT_VIEWPORT_MAX_WIDTH_LARGE,
} = props;
const [lengthOfChildren, setLengthOfChildren] = React.useState<number[]>([]);
@@ -160,6 +162,7 @@ export function Breadcrumbs(props: Props) {
</Dropdown>
)}
<ul className="sw-truncate sw-leading-6 sw-flex">{[...breadcrumbsToShow].reverse()}</ul>
+ {actions && <div className="sw-ml-2">{actions}</div>}
</BreadcrumbWrapper>
);
}
diff --git a/server/sonar-web/design-system/src/components/__tests__/TreeMap-test.tsx b/server/sonar-web/design-system/src/components/__tests__/TreeMap-test.tsx
index 645d1499ea6..1f0121c3b18 100644
--- a/server/sonar-web/design-system/src/components/__tests__/TreeMap-test.tsx
+++ b/server/sonar-web/design-system/src/components/__tests__/TreeMap-test.tsx
@@ -53,7 +53,7 @@ it('should render correctly and forward click event', async () => {
expect(container).toMatchSnapshot();
- await user.click(screen.getByText('SonarQube_Web'));
+ await user.click(screen.getByRole('link', { name: 'SonarQube_Web' }));
expect(onRectangleClick).toHaveBeenCalledTimes(1);
expect(onRectangleClick).toHaveBeenCalledWith(items[1]);
});