From 74291e531cb25c8b11aa5eabb362453c51e8cea9 Mon Sep 17 00:00:00 2001 From: Thomas Trompette Date: Thu, 31 Oct 2024 17:19:44 +0100 Subject: [PATCH] Fix storybook tests (#8260) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before Capture d’écran 2024-10-31 à 16 58 34 After Capture d’écran 2024-10-31 à 16 58 14 Before Capture d’écran 2024-10-31 à 16 57 59 After Capture d’écran 2024-10-31 à 16 57 29 --- .../components/SettingsDataModelFieldRelationForm.tsx | 5 ++++- .../src/testing/mock-data/timeline-activities.ts | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/twenty-front/src/modules/settings/data-model/fields/forms/relation/components/SettingsDataModelFieldRelationForm.tsx b/packages/twenty-front/src/modules/settings/data-model/fields/forms/relation/components/SettingsDataModelFieldRelationForm.tsx index 854b59b68154..1f1d2a111255 100644 --- a/packages/twenty-front/src/modules/settings/data-model/fields/forms/relation/components/SettingsDataModelFieldRelationForm.tsx +++ b/packages/twenty-front/src/modules/settings/data-model/fields/forms/relation/components/SettingsDataModelFieldRelationForm.tsx @@ -101,7 +101,10 @@ export const SettingsDataModelFieldRelationForm = ({ }); const selectedObjectMetadataItem = findObjectMetadataItemById( - watchFormValue('relation.objectMetadataId'), + watchFormValue( + 'relation.objectMetadataId', + initialRelationObjectMetadataItem?.id, + ), ); const isMobile = useIsMobile(); diff --git a/packages/twenty-front/src/testing/mock-data/timeline-activities.ts b/packages/twenty-front/src/testing/mock-data/timeline-activities.ts index a716ba032f76..b3fea3600747 100644 --- a/packages/twenty-front/src/testing/mock-data/timeline-activities.ts +++ b/packages/twenty-front/src/testing/mock-data/timeline-activities.ts @@ -5,7 +5,7 @@ export const mockedTimelineActivities: Array = [ properties: null, updatedAt: '2023-04-26T10:12:42.33625+00:00', id: '79f84835-b2f9-4ab5-8ab9-17dbcc45dda3', - linkedObjectMetadataId: '1ad72a42-6ab4-4474-a62a-a57cae3c0298', + linkedObjectMetadataId: 'e7a5e974-affc-40d5-be9f-2ba2783c21be', linkedRecordCachedName: '', linkedRecordId: 'ce40eca0-8f4b-4bba-ba91-5cbd870c64d3', name: 'calendarEvent.linked', @@ -30,7 +30,7 @@ export const mockedTimelineActivities: Array = [ properties: null, updatedAt: '2023-04-26T10:12:42.33625+00:00', id: '79f84835-b2f9-4ab5-8ab9-17dbcc45dda3', - linkedObjectMetadataId: '1ad72a42-6ab4-4474-a62a-a57cae3c0298', + linkedObjectMetadataId: '3385d352-10a0-428f-9863-e52e7164b26c', linkedRecordCachedName: '', linkedRecordId: 'ce40eca0-8f4b-4bba-ba91-5cbd870c64d5', name: 'message.linked', @@ -55,7 +55,7 @@ export const mockedTimelineActivities: Array = [ properties: null, updatedAt: '2023-04-26T10:12:42.33625+00:00', id: '79f84835-b2f9-4ab5-8ab9-17dbcc45dda3', - linkedObjectMetadataId: '1ad72a42-6ab4-4474-a62a-a57cae3c0298', + linkedObjectMetadataId: '25e10253-f0e1-4a6d-90e3-ad62a4b20292', linkedRecordCachedName: 'New Task', linkedRecordId: 'ce40eca0-8f4b-4bba-ba91-5cbd870c64d2', name: 'linked-task.created',