The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Fix chromatic tests (#12551)
Baptiste Devessier10b97d56d46f
diff --git a/packages/twenty-front/src/modules/activities/tasks/components/__stories__/TaskList.stories.tsx b/packages/twenty-front/src/modules/activities/tasks/components/__stories__/TaskList.stories.tsxindex 4dc533cb08a..94e3e2377fa 100644--- a/packages/twenty-front/src/modules/activities/tasks/components/__stories__/TaskList.stories.tsx+++ b/packages/twenty-front/src/modules/activities/tasks/components/__stories__/TaskList.stories.tsx@@ -1,14 +1,15 @@import { Meta, StoryObj } from '@storybook/react';import { TaskList } from '@/activities/tasks/components/TaskList';+import { ComponentDecorator } from 'twenty-ui/testing';import { ContextStoreDecorator } from '~/testing/decorators/ContextStoreDecorator';import { I18nFrontDecorator } from '~/testing/decorators/I18nFrontDecorator';import { MemoryRouterDecorator } from '~/testing/decorators/MemoryRouterDecorator';import { ObjectMetadataItemsDecorator } from '~/testing/decorators/ObjectMetadataItemsDecorator';+import { RightDrawerDecorator } from '~/testing/decorators/RightDrawerDecorator';import { SnackBarDecorator } from '~/testing/decorators/SnackBarDecorator';import { graphqlMocks } from '~/testing/graphqlMocks';import { mockedTasks } from '~/testing/mock-data/tasks';-import { ComponentDecorator } from 'twenty-ui/testing';const meta: Meta<typeof TaskList> = {title: 'Modules/Activity/TaskList',@@ -20,6 +21,7 @@ const meta: Meta<typeof TaskList> = {MemoryRouterDecorator,ObjectMetadataItemsDecorator,SnackBarDecorator,+ RightDrawerDecorator,],args: {title: 'Tasks',diff --git a/packages/twenty-front/src/modules/object-record/record-field/form-types/components/__stories__/FormDateTimeFieldInput.stories.tsx b/packages/twenty-front/src/modules/object-record/record-field/form-types/components/__stories__/FormDateTimeFieldInput.stories.tsxindex 8464cc2525a..e10fefab4c8 100644--- a/packages/twenty-front/src/modules/object-record/record-field/form-types/components/__stories__/FormDateTimeFieldInput.stories.tsx+++ b/packages/twenty-front/src/modules/object-record/record-field/form-types/components/__stories__/FormDateTimeFieldInput.stories.tsx@@ -198,12 +198,22 @@ export const ResetsDateByErasingInputContent: Story = {new RegExp(`12/09/${currentYear} \\d{2}:\\d{2}`),);+ await userEvent.click(input);++ await waitFor(() => {+ expect(canvas.getByRole('dialog')).toBeVisible();+ });+await userEvent.clear(input);+ const waitForDialogToBeRemoved = waitForElementToBeRemoved(() =>+ canvas.queryByRole('dialog'),+ );+await Promise.all([userEvent.type(input, '{Enter}'),- waitForElementToBeRemoved(() => canvas.queryByRole('dialog')),+ waitForDialogToBeRemoved,waitFor(() => {expect(args.onChange).toHaveBeenCalledWith(null);}),diff --git a/packages/twenty-front/src/testing/decorators/RightDrawerDecorator.tsx b/packages/twenty-front/src/testing/decorators/RightDrawerDecorator.tsxnew file mode 100644index 00000000000..da716e0bc34--- /dev/null+++ b/packages/twenty-front/src/testing/decorators/RightDrawerDecorator.tsx@@ -0,0 +1,8 @@+import { RightDrawerProvider } from '@/ui/layout/right-drawer/contexts/RightDrawerContext';+import { Decorator } from '@storybook/react';++export const RightDrawerDecorator: Decorator = (Story) => (+ <RightDrawerProvider value={{ isInRightDrawer: false }}>+ <Story />+ </RightDrawerProvider>+);