Skip to content

The open alternative to Salesforce, designed for AI.

Load the global reset in the twenty-ui Storybook (#28272)

Raphaël Bosidbe44e537e69
diff --git a/packages/twenty-ui/.storybook/preview.tsx b/packages/twenty-ui/.storybook/preview.tsx
index 114240e6632..9060b75aa1d 100644
--- a/packages/twenty-ui/.storybook/preview.tsx
+++ b/packages/twenty-ui/.storybook/preview.tsx
@@ -5,6 +5,7 @@ import '@fontsource/inter/500.css';
import '@fontsource/inter/600.css';
import { type Preview } from '@storybook/react-vite';
+import '@ui/styles/base/reset.scss';
import '@ui/theme/theme-light.css';
import '@ui/theme/theme-dark.css';
import { ThemeProvider } from '@ui/theme';
diff --git a/packages/twenty-ui/src/components/layout/OverflowingList/__stories__/OverflowingList.interactions.stories.tsx b/packages/twenty-ui/src/components/layout/OverflowingList/__stories__/OverflowingList.interactions.stories.tsx
index 36971b7cf64..bc3976550c7 100644
--- a/packages/twenty-ui/src/components/layout/OverflowingList/__stories__/OverflowingList.interactions.stories.tsx
+++ b/packages/twenty-ui/src/components/layout/OverflowingList/__stories__/OverflowingList.interactions.stories.tsx
@@ -396,6 +396,7 @@ export const CountDisabledWhilePopupOpen: Story = {
export const FocusedTriggerRemoval: Story = {
args: { showOverflowCount: undefined },
+ parameters: { container: { width: 460, height: 280 } },
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
@@ -846,7 +847,7 @@ export const StatefulRowAndPopupAcrossResize: Story = {
...dialog.querySelectorAll('[id]'),
].map((element) => element.id);
expect(new Set(identifiers).size).toBe(identifiers.length);
- list.style.width = '320px';
+ list.style.width = '280px';
const secondInlineValue = await canvas.findByRole('textbox', {
name: 'Second value',
});
diff --git a/packages/twenty-ui/src/components/layout/OverflowingList/__stories__/expectOverflowingListPopupGeometry.ts b/packages/twenty-ui/src/components/layout/OverflowingList/__stories__/expectOverflowingListPopupGeometry.ts
index 1c7e9fc298a..d89f3347ebf 100644
--- a/packages/twenty-ui/src/components/layout/OverflowingList/__stories__/expectOverflowingListPopupGeometry.ts
+++ b/packages/twenty-ui/src/components/layout/OverflowingList/__stories__/expectOverflowingListPopupGeometry.ts
@@ -18,16 +18,10 @@ export const expectOverflowingListPopupGeometry = async ({
await waitFor(() => {
const listRectangle = list.getBoundingClientRect();
const dialogRectangle = dialog.getBoundingClientRect();
- const dialogStyle = getComputedStyle(dialog);
- const horizontalBorderAndPadding =
- parseFloat(dialogStyle.paddingLeft) +
- parseFloat(dialogStyle.paddingRight) +
- parseFloat(dialogStyle.borderLeftWidth) +
- parseFloat(dialogStyle.borderRightWidth);
expect(dialogRectangle.top).toBeCloseTo(listRectangle.bottom - 9, 0);
expect(dialogRectangle.width).toBeCloseTo(
- Math.max(220, listRectangle.width) + horizontalBorderAndPadding,
+ Math.max(220, listRectangle.width),
0,
);
});