The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Fix storybook stories (#10853)
Charles Bocheta2004e622002
diff --git a/packages/twenty-front/src/modules/object-record/record-field/form-types/components/__stories__/FormEmailsFieldInput.stories.tsx b/packages/twenty-front/src/modules/object-record/record-field/form-types/components/__stories__/FormEmailsFieldInput.stories.tsxindex d4e432bccfb..eb290d2f702 100644--- a/packages/twenty-front/src/modules/object-record/record-field/form-types/components/__stories__/FormEmailsFieldInput.stories.tsx+++ b/packages/twenty-front/src/modules/object-record/record-field/form-types/components/__stories__/FormEmailsFieldInput.stories.tsx@@ -1,5 +1,5 @@import { Meta, StoryObj } from '@storybook/react';-import { expect, fn, userEvent, within } from '@storybook/test';+import { expect, fn, userEvent, waitFor, within } from '@storybook/test';import { I18nFrontDecorator } from '~/testing/decorators/I18nFrontDecorator';import { WorkflowStepDecorator } from '~/testing/decorators/WorkflowStepDecorator';import { MOCKED_STEP_ID } from '~/testing/mock-data/workflow';@@ -68,8 +68,11 @@ export const Disabled: Story = {play: async ({ canvasElement, args }) => {const canvas = within(canvasElement);- const editor = canvasElement.querySelector('.ProseMirror > p');- expect(editor).toBeVisible();+ const editor = await waitFor(() => {+ const editor = canvasElement.querySelector('.ProseMirror > p');+ expect(editor).toBeVisible();+ return editor;+ });const defaultValue = await canvas.findByText('[email protected]');expect(defaultValue).toBeVisible();diff --git a/packages/twenty-front/src/modules/object-record/record-field/form-types/components/__stories__/FormTextFieldInput.stories.tsx b/packages/twenty-front/src/modules/object-record/record-field/form-types/components/__stories__/FormTextFieldInput.stories.tsxindex 0ec230a2c1c..12acf9e9c97 100644--- a/packages/twenty-front/src/modules/object-record/record-field/form-types/components/__stories__/FormTextFieldInput.stories.tsx+++ b/packages/twenty-front/src/modules/object-record/record-field/form-types/components/__stories__/FormTextFieldInput.stories.tsx@@ -185,9 +185,11 @@ export const DisabledWithVariable: Story = {readonly: true,},play: async ({ canvasElement }) => {- const editor = canvasElement.querySelector('.ProseMirror > p');-- expect(editor).toBeVisible();+ const editor = await waitFor(() => {+ const editor = canvasElement.querySelector('.ProseMirror > p');+ expect(editor).toBeVisible();+ return editor;+ });await waitFor(() => {expect(editor).toHaveTextContent('test Name test');diff --git a/packages/twenty-front/src/modules/ui/layout/expandable-list/components/__stories__/ExpandableList.stories.tsx b/packages/twenty-front/src/modules/ui/layout/expandable-list/components/__stories__/ExpandableList.stories.tsxindex 374cce31167..03f2f9222a8 100644--- a/packages/twenty-front/src/modules/ui/layout/expandable-list/components/__stories__/ExpandableList.stories.tsx+++ b/packages/twenty-front/src/modules/ui/layout/expandable-list/components/__stories__/ExpandableList.stories.tsx@@ -58,7 +58,7 @@ export const WithExpandedList: Story = {const rootCanvas = within(root);- const chipCount = await rootCanvas.findByText('+3');+ const chipCount = await rootCanvas.findByText('+2');await userEvent.click(chipCount);diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/__stories__/WorkflowEditActionUpdateRecord.stories.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/__stories__/WorkflowEditActionUpdateRecord.stories.tsxindex 9264d9e79e3..759c4a703d6 100644--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/__stories__/WorkflowEditActionUpdateRecord.stories.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/__stories__/WorkflowEditActionUpdateRecord.stories.tsx@@ -159,12 +159,9 @@ export const DisabledWithDefaultStaticValues: Story = {await userEvent.click(objectSelectCurrentValue);- {- const searchInputInSelectDropdown =- canvas.queryByPlaceholderText('Search');+ const searchInputInSelectDropdown = canvas.queryByPlaceholderText('Search');- expect(searchInputInSelectDropdown).not.toBeInTheDocument();- }+ expect(searchInputInSelectDropdown).not.toBeInTheDocument();const selectedRecord = await canvas.findByText(`${peopleMock.name.firstName} ${peopleMock.name.lastName}`,diff --git a/packages/twenty-front/src/pages/settings/__stories__/SettingsProfile.stories.tsx b/packages/twenty-front/src/pages/settings/__stories__/SettingsProfile.stories.tsxindex 4c674e35267..f16591f3a96 100644--- a/packages/twenty-front/src/pages/settings/__stories__/SettingsProfile.stories.tsx+++ b/packages/twenty-front/src/pages/settings/__stories__/SettingsProfile.stories.tsx@@ -1,5 +1,4 @@import { Meta, StoryObj } from '@storybook/react';-import { userEvent, within } from '@storybook/test';import {PageDecorator,@@ -27,12 +26,3 @@ export default meta;export type Story = StoryObj<typeof SettingsProfile>;export const Default: Story = {};--export const LogOut: Story = {- play: async ({ canvasElement }) => {- const canvas = within(canvasElement);- const logoutButton = await canvas.findByText('Logout');-- await userEvent.click(logoutButton);- },-};