diff --git a/packages/components/src/components/Tooltip/__tests__/Tooltip.ct.tsx b/packages/components/src/components/Tooltip/__tests__/Tooltip.ct.tsx
index 99cea15295..68910b21f7 100644
--- a/packages/components/src/components/Tooltip/__tests__/Tooltip.ct.tsx
+++ b/packages/components/src/components/Tooltip/__tests__/Tooltip.ct.tsx
@@ -225,6 +225,31 @@ test('should show on custom side right', async ({ mount, page }) => {
}
});
+test('should respect margins when wrapped', async ({ mount, page }) => {
+ const component = await mount(
+
+
+
+
+ {TOOLTIP_TEXT}
+ ,
+ );
+ const tooltipContent = page.getByTestId(TOOLTIP_CONTENT_TEST_ID);
+ const tooltipButton = page.getByTestId('fondue-tooltip-button');
+ await expect(component).toBeVisible();
+ await component.hover();
+ await expect(tooltipContent).toBeVisible();
+ const tooltipTriggerRect = await tooltipButton.boundingBox();
+ const tooltipContentRect = await tooltipContent.boundingBox();
+ if (tooltipContentRect && tooltipTriggerRect) {
+ expect(tooltipContentRect.y).toBe(tooltipTriggerRect.y + tooltipTriggerRect.height + 250 + 16 - 3); // margin + padding - negative offset applied by radix
+ } else {
+ throw new Error('Bounding boxes are undefined');
+ }
+});
+
test('should detect left collision and show on the right', async ({ mount, page }) => {
const component = await mount(