From cac0d22285b822be113b025db707d68fa4c61988 Mon Sep 17 00:00:00 2001 From: Charles Bochet Date: Fri, 19 Jul 2024 19:42:04 +0200 Subject: [PATCH] Fix chromatic pixel tests --- .../__stories__/RecordShowPage.stories.tsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/twenty-front/src/pages/object-record/__stories__/RecordShowPage.stories.tsx b/packages/twenty-front/src/pages/object-record/__stories__/RecordShowPage.stories.tsx index dd494a1f2..c23d9d6fd 100644 --- a/packages/twenty-front/src/pages/object-record/__stories__/RecordShowPage.stories.tsx +++ b/packages/twenty-front/src/pages/object-record/__stories__/RecordShowPage.stories.tsx @@ -1,7 +1,7 @@ import { expect } from '@storybook/jest'; import { Meta, StoryObj } from '@storybook/react'; import { within } from '@storybook/test'; -import { graphql, HttpResponse } from 'msw'; +import { HttpResponse, graphql } from 'msw'; import { PageDecorator, @@ -90,7 +90,11 @@ export const Default: Story = { await canvas.findAllByText( peopleMock[0].name.firstName + ' ' + peopleMock[0].name.lastName, ); - await canvas.findByText('Add your first Activity'); + expect( + await canvas.findByText('Add your first Activity', undefined, { + timeout: 3000, + }), + ).toBeInTheDocument(); }, }; @@ -106,6 +110,11 @@ export const Loading: Story = { peopleMock[0].name.firstName + ' ' + peopleMock[0].name.lastName, ), ).toBeNull(); - expect(canvas.queryByText('Add your first Activity')).toBeNull(); + + expect( + await canvas.findByText('Add your first Activity', undefined, { + timeout: 3000, + }), + ).toBeInTheDocument(); }, };