The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Fix createdBy and activity tests (#6569)
Thomas Trompette9a0c9672a0ce
diff --git a/packages/twenty-front/src/modules/activities/hooks/__tests__/useCreateActivityInDB.test.tsx b/packages/twenty-front/src/modules/activities/hooks/__tests__/useCreateActivityInDB.test.tsxindex b136aaed507..e2db015a1a4 100644--- a/packages/twenty-front/src/modules/activities/hooks/__tests__/useCreateActivityInDB.test.tsx+++ b/packages/twenty-front/src/modules/activities/hooks/__tests__/useCreateActivityInDB.test.tsx@@ -23,20 +23,17 @@ const mocks: MockedResponse[] = [{request: {query: gql`- mutation CreateOneActivity($input: ActivityCreateInput!) {- createActivity(data: $input) {+ mutation CreateOneTask($input: TaskCreateInput!) {+ createTask(data: $input) {__typename- createdAt- reminderAt- authorId- titlestatus+ assigneeIdupdatedAtbody+ createdAtdueAt- typeid- assigneeId+ title}}`,@@ -46,7 +43,7 @@ const mocks: MockedResponse[] = [},result: jest.fn(() => ({data: {- createActivity: {+ createTask: {...mockedActivity,__typename: 'Activity',assigneeId: '',diff --git a/packages/twenty-front/src/modules/activities/tasks/hooks/__tests__/useCompleteTask.test.tsx b/packages/twenty-front/src/modules/activities/tasks/hooks/__tests__/useCompleteTask.test.tsxindex 9cd5fa30839..baf35a95680 100644--- a/packages/twenty-front/src/modules/activities/tasks/hooks/__tests__/useCompleteTask.test.tsx+++ b/packages/twenty-front/src/modules/activities/tasks/hooks/__tests__/useCompleteTask.test.tsx@@ -9,7 +9,7 @@ import { Task } from '@/activities/types/Task';const task: Task = {id: '123',- status: null,+ status: 'DONE',title: 'Test',body: 'Test',dueAt: '2024-03-15T07:33:14.212Z',@@ -25,23 +25,23 @@ const mocks: MockedResponse[] = [{request: {query: gql`- mutation UpdateOneActivity(- $idToUpdate: ID!- $input: ActivityUpdateInput!- ) {- updateActivity(id: $idToUpdate, data: $input) {+ mutation UpdateOneTask($idToUpdate: ID!, $input: TaskUpdateInput!) {+ updateTask(id: $idToUpdate, data: $input) {__typename- createdAt- reminderAt- authorId- titlestatus+ assigneeIdupdatedAtbody+ createdAtdueAt- type+ positionid- assigneeId+ title+ createdBy {+ source+ workspaceMemberId+ name+ }}}`,@@ -52,7 +52,7 @@ const mocks: MockedResponse[] = [},result: jest.fn(() => ({data: {- updateActivity: {+ updateTask: {__typename: 'Activity',createdAt: '2024-03-15T07:33:14.212Z',reminderAt: null,diff --git a/packages/twenty-front/src/modules/favorites/hooks/__mocks__/useFavorites.ts b/packages/twenty-front/src/modules/favorites/hooks/__mocks__/useFavorites.tsindex 99978a4108a..3956803dc55 100644--- a/packages/twenty-front/src/modules/favorites/hooks/__mocks__/useFavorites.ts+++ b/packages/twenty-front/src/modules/favorites/hooks/__mocks__/useFavorites.ts@@ -1,6 +1,7 @@import { gql } from '@apollo/client';import { AvatarType } from 'twenty-ui';+import { PERSON_FRAGMENT } from '@/object-record/hooks/__mocks__/personFragment';import { ColorScheme } from '@/workspace-member/types/WorkspaceMember';export const mockId = '8f3b2121-f194-4ba4-9fbf-2d5a37126806';@@ -50,21 +51,21 @@ export const initialFavorites = [export const sortedFavorites = [{id: '1',- recordId: '1',+ recordId: '2',position: 0,- avatarType: 'rounded',- avatarUrl: '',- labelIdentifier: ' ',- link: '/object/person/1',+ avatarType: 'squared',+ avatarUrl: undefined,+ labelIdentifier: 'ABC Corp',+ link: '/object/company/2',},{id: '2',- recordId: '3',+ recordId: '4',position: 1,- avatarType: 'rounded',- avatarUrl: '',- labelIdentifier: ' ',- link: '/object/person/3',+ avatarType: 'squared',+ avatarUrl: undefined,+ labelIdentifier: 'Company Test',+ link: '/object/company/4',},{id: '3',@@ -85,94 +86,160 @@ export const mocks = [mutation CreateOneFavorite($input: FavoriteCreateInput!) {createFavorite(data: $input) {__typename- id- companyId- createdAt- personId- person {- __typename- xLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- id- createdAt- city- jobTitle- name {- firstName- lastName- }- phone- linkedinLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- updatedAt- avatarUrl- companyId- }- position+ taskId+ myCustomObjectId+ workspaceMemberId+ workspaceMember {+ __typename+ userId+ updatedAt+ dateFormat+ id+ locale+ avatarUrl+ timeZone+ name {+ firstName+ lastName+ }+ userEmail+ createdAt+ timeFormat+ colorScheme+ }+ companyId+ myCustomObject {+ __typename+ createdBy {+ source+ workspaceMemberId+ name+ }+ position+ updatedAt+ name+ myCustomField+ id+ createdAt+ }+ updatedAt+ id+ opportunity {+ __typename+ companyId+ closeDate+ stage+ createdBy {+ source+ workspaceMemberId+ name+ }+ id+ updatedAt+ name+ createdAt+ pointOfContactId+ amount {+ amountMicros+ currencyCode+ }+ position+ }+ noteId+ note {+ __typename+ createdBy {+ sourceworkspaceMemberId- workspaceMember {- __typename- colorScheme- name {- firstName- lastName- }- locale- userId- avatarUrl- createdAt- updatedAt- id- }- company {- __typename- xLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- linkedinLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- domainName {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- annualRecurringRevenue {- amountMicros- currencyCode- }- createdAt- address {- addressStreet1- addressStreet2- addressCity- addressState- addressCountry- addressPostcode- addressLat- addressLng- }- updatedAt- name- accountOwnerId- employees- id- idealCustomerProfile- }- updatedAt+ name}+ position+ body+ updatedAt+ createdAt+ title+ id+ }+ personId+ task {+ __typename+ status+ assigneeId+ updatedAt+ body+ createdAt+ dueAt+ position+ id+ title+ createdBy {+ source+ workspaceMemberId+ name+ }+ }+ opportunityId+ position+ createdAt+ company {+ __typename+ id+ visaSponsorship+ createdBy {+ source+ workspaceMemberId+ name+ }+ domainName {+ primaryLinkUrl+ primaryLinkLabel+ secondaryLinks+ }+ introVideo {+ primaryLinkUrl+ primaryLinkLabel+ secondaryLinks+ }+ position+ annualRecurringRevenue {+ amountMicros+ currencyCode+ }+ employees+ linkedinLink {+ primaryLinkUrl+ primaryLinkLabel+ secondaryLinks+ }+ workPolicy+ address {+ addressStreet1+ addressStreet2+ addressCity+ addressState+ addressCountry+ addressPostcode+ addressLat+ addressLng+ }+ name+ updatedAt+ xLink {+ primaryLinkUrl+ primaryLinkLabel+ secondaryLinks+ }+ myCustomField+ createdAt+ accountOwnerId+ tagline+ idealCustomerProfile+ }+ person {+ ${PERSON_FRAGMENT}}+ }+ }`,variables: {input: {@@ -219,92 +286,158 @@ export const mocks = [) {updateFavorite(id: $idToUpdate, data: $input) {__typename- id- companyId- createdAt- personId- person {- __typename- xLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- id- createdAt- city- jobTitle- name {- firstName- lastName- }- phone- linkedinLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- updatedAt- avatarUrl- companyId- }- position+ taskId+ myCustomObjectId+ workspaceMemberId+ workspaceMember {+ __typename+ userId+ updatedAt+ dateFormat+ id+ locale+ avatarUrl+ timeZone+ name {+ firstName+ lastName+ }+ userEmail+ createdAt+ timeFormat+ colorScheme+ }+ companyId+ myCustomObject {+ __typename+ createdBy {+ source+ workspaceMemberId+ name+ }+ position+ updatedAt+ name+ myCustomField+ id+ createdAt+ }+ updatedAt+ id+ opportunity {+ __typename+ companyId+ closeDate+ stage+ createdBy {+ source+ workspaceMemberId+ name+ }+ id+ updatedAt+ name+ createdAt+ pointOfContactId+ amount {+ amountMicros+ currencyCode+ }+ position+ }+ noteId+ note {+ __typename+ createdBy {+ source+ workspaceMemberId+ name+ }+ position+ body+ updatedAt+ createdAt+ title+ id+ }+ personId+ task {+ __typename+ status+ assigneeId+ updatedAt+ body+ createdAt+ dueAt+ position+ id+ title+ createdBy {+ sourceworkspaceMemberId- workspaceMember {- __typename- colorScheme- name {- firstName- lastName- }- locale- userId- avatarUrl- createdAt- updatedAt- id- }- company {- __typename- xLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- linkedinLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- domainName {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- annualRecurringRevenue {- amountMicros- currencyCode- }- createdAt- address {- addressStreet1- addressStreet2- addressCity- addressState- addressCountry- addressPostcode- addressLat- addressLng- }- updatedAt- name- accountOwnerId- employees- id- idealCustomerProfile- }- updatedAt+ name+ }+ }+ opportunityId+ position+ createdAt+ company {+ __typename+ id+ visaSponsorship+ createdBy {+ source+ workspaceMemberId+ name+ }+ domainName {+ primaryLinkUrl+ primaryLinkLabel+ secondaryLinks+ }+ introVideo {+ primaryLinkUrl+ primaryLinkLabel+ secondaryLinks+ }+ position+ annualRecurringRevenue {+ amountMicros+ currencyCode+ }+ employees+ linkedinLink {+ primaryLinkUrl+ primaryLinkLabel+ secondaryLinks+ }+ workPolicy+ address {+ addressStreet1+ addressStreet2+ addressCity+ addressState+ addressCountry+ addressPostcode+ addressLat+ addressLng+ }+ name+ updatedAt+ xLink {+ primaryLinkUrl+ primaryLinkLabel+ secondaryLinks+ }+ myCustomField+ createdAt+ accountOwnerId+ tagline+ idealCustomerProfile+ }+ person {+ ${PERSON_FRAGMENT}+ }}}`,diff --git a/packages/twenty-front/src/modules/object-record/hooks/__mocks__/personFragment.ts b/packages/twenty-front/src/modules/object-record/hooks/__mocks__/personFragment.tsnew file mode 100644index 00000000000..2f0fdfcee60--- /dev/null+++ b/packages/twenty-front/src/modules/object-record/hooks/__mocks__/personFragment.ts@@ -0,0 +1,37 @@+export const PERSON_FRAGMENT = `+ __typename+ updatedAt+ myCustomObjectId+ linkedinLink {+ primaryLinkUrl+ primaryLinkLabel+ secondaryLinks+ }+ name {+ firstName+ lastName+ }+ position+ createdBy {+ source+ workspaceMemberId+ name+ }+ avatarUrl+ jobTitle+ xLink {+ primaryLinkUrl+ primaryLinkLabel+ secondaryLinks+ }+ performanceRating+ createdAt+ phone+ id+ city+ companyId+ intro+ workPrefereance+`diff --git a/packages/twenty-front/src/modules/object-record/hooks/__mocks__/useCreateManyRecords.ts b/packages/twenty-front/src/modules/object-record/hooks/__mocks__/useCreateManyRecords.tsindex d61772f8368..967f1ac6a5d 100644--- a/packages/twenty-front/src/modules/object-record/hooks/__mocks__/useCreateManyRecords.ts+++ b/packages/twenty-front/src/modules/object-record/hooks/__mocks__/useCreateManyRecords.ts@@ -1,34 +1,12 @@import { gql } from '@apollo/client';+import { PERSON_FRAGMENT } from '@/object-record/hooks/__mocks__/personFragment';import { Person } from '@/people/types/Person';export const query = gql`mutation CreatePeople($data: [PersonCreateInput!]!, $upsert: Boolean) {createPeople(data: $data, upsert: $upsert) {- __typename- xLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- id- createdAt- city- jobTitle- name {- firstName- lastName- }- phone- linkedinLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- updatedAt- avatarUrl- companyId+ ${PERSON_FRAGMENT}}}`;diff --git a/packages/twenty-front/src/modules/object-record/hooks/__mocks__/useCreateOneRecord.ts b/packages/twenty-front/src/modules/object-record/hooks/__mocks__/useCreateOneRecord.tsindex 7f32cfdf365..cb22a045d51 100644--- a/packages/twenty-front/src/modules/object-record/hooks/__mocks__/useCreateOneRecord.ts+++ b/packages/twenty-front/src/modules/object-record/hooks/__mocks__/useCreateOneRecord.ts@@ -1,32 +1,10 @@+import { PERSON_FRAGMENT } from '@/object-record/hooks/__mocks__/personFragment';import { gql } from '@apollo/client';export const query = gql`mutation CreateOnePerson($input: PersonCreateInput!) {createPerson(data: $input) {- __typename- xLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- id- createdAt- city- jobTitle- name {- firstName- lastName- }- phone- linkedinLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- updatedAt- avatarUrl- companyId+ ${PERSON_FRAGMENT}}}`;diff --git a/packages/twenty-front/src/modules/object-record/hooks/__mocks__/useExecuteQuickActionOnOneRecord.ts b/packages/twenty-front/src/modules/object-record/hooks/__mocks__/useExecuteQuickActionOnOneRecord.tsindex 854b4fd2cbf..65a05a028bc 100644--- a/packages/twenty-front/src/modules/object-record/hooks/__mocks__/useExecuteQuickActionOnOneRecord.ts+++ b/packages/twenty-front/src/modules/object-record/hooks/__mocks__/useExecuteQuickActionOnOneRecord.ts@@ -1,3 +1,4 @@+import { PERSON_FRAGMENT } from '@/object-record/hooks/__mocks__/personFragment';import { gql } from '@apollo/client';export { responseData } from './useUpdateOneRecord';@@ -5,30 +6,7 @@ export { responseData } from './useUpdateOneRecord';export const query = gql`mutation ExecuteQuickActionOnOnePerson($idToExecuteQuickActionOn: ID!) {executeQuickActionOnPerson(id: $idToExecuteQuickActionOn) {- __typename- xLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- id- createdAt- city- jobTitle- name {- firstName- lastName- }- phone- linkedinLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- updatedAt- avatarUrl- companyId+ ${PERSON_FRAGMENT}}}`;diff --git a/packages/twenty-front/src/modules/object-record/hooks/__mocks__/useFindDuplicateRecords.ts b/packages/twenty-front/src/modules/object-record/hooks/__mocks__/useFindDuplicateRecords.tsindex 5eb6ecd8dd8..2e50e02aac8 100644--- a/packages/twenty-front/src/modules/object-record/hooks/__mocks__/useFindDuplicateRecords.ts+++ b/packages/twenty-front/src/modules/object-record/hooks/__mocks__/useFindDuplicateRecords.ts@@ -1,3 +1,4 @@+import { PERSON_FRAGMENT } from '@/object-record/hooks/__mocks__/personFragment';import { gql } from '@apollo/client';import { getPeopleMock } from '~/testing/mock-data/people';@@ -8,30 +9,7 @@ export const query = gql`personDuplicates(ids: $ids) {edges {node {- __typename- xLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- id- createdAt- city- jobTitle- name {- firstName- lastName- }- phone- linkedinLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- updatedAt- avatarUrl- companyId+ ${PERSON_FRAGMENT}}cursor}diff --git a/packages/twenty-front/src/modules/object-record/hooks/__mocks__/useFindOneRecord.ts b/packages/twenty-front/src/modules/object-record/hooks/__mocks__/useFindOneRecord.tsindex c96024d4e80..26ac2981aa3 100644--- a/packages/twenty-front/src/modules/object-record/hooks/__mocks__/useFindOneRecord.ts+++ b/packages/twenty-front/src/modules/object-record/hooks/__mocks__/useFindOneRecord.ts@@ -1,34 +1,12 @@import { gql } from '@apollo/client';+import { PERSON_FRAGMENT } from '@/object-record/hooks/__mocks__/personFragment';import { responseData as person } from './useUpdateOneRecord';export const query = gql`query FindOnePerson($objectRecordId: ID!) {person(filter: { id: { eq: $objectRecordId } }) {- __typename- xLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- id- createdAt- city- jobTitle- name {- firstName- lastName- }- phone- linkedinLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- updatedAt- avatarUrl- companyId+ ${PERSON_FRAGMENT}}}`;diff --git a/packages/twenty-front/src/modules/object-record/hooks/__mocks__/useUpdateOneRecord.ts b/packages/twenty-front/src/modules/object-record/hooks/__mocks__/useUpdateOneRecord.tsindex f7023f8aaf1..4cc34f4932e 100644--- a/packages/twenty-front/src/modules/object-record/hooks/__mocks__/useUpdateOneRecord.ts+++ b/packages/twenty-front/src/modules/object-record/hooks/__mocks__/useUpdateOneRecord.ts@@ -1,32 +1,10 @@+import { PERSON_FRAGMENT } from '@/object-record/hooks/__mocks__/personFragment';import { gql } from '@apollo/client';export const query = gql`mutation UpdateOnePerson($idToUpdate: ID!, $input: PersonUpdateInput!) {updatePerson(id: $idToUpdate, data: $input) {- __typename- xLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- id- createdAt- city- jobTitle- name {- firstName- lastName- }- phone- linkedinLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- updatedAt- avatarUrl- companyId+ ${PERSON_FRAGMENT}}}`;diff --git a/packages/twenty-front/src/modules/object-record/hooks/__tests__/useCreateManyRecordsMutation.test.tsx b/packages/twenty-front/src/modules/object-record/hooks/__tests__/useCreateManyRecordsMutation.test.tsxindex ff59df19471..3b4d1ad42d4 100644--- a/packages/twenty-front/src/modules/object-record/hooks/__tests__/useCreateManyRecordsMutation.test.tsx+++ b/packages/twenty-front/src/modules/object-record/hooks/__tests__/useCreateManyRecordsMutation.test.tsx@@ -2,35 +2,13 @@ import { renderHook } from '@testing-library/react';import { print } from 'graphql';import { RecoilRoot } from 'recoil';+import { PERSON_FRAGMENT } from '@/object-record/hooks/__mocks__/personFragment';import { useCreateManyRecordsMutation } from '@/object-record/hooks/useCreateManyRecordsMutation';const expectedQueryTemplate = `mutation CreatePeople($data: [PersonCreateInput!]!, $upsert: Boolean) {createPeople(data: $data, upsert: $upsert) {- __typename- xLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- id- createdAt- city- jobTitle- name {- firstName- lastName- }- phone- linkedinLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- updatedAt- avatarUrl- companyId+ ${PERSON_FRAGMENT}}}`.replace(/\s/g, '');diff --git a/packages/twenty-front/src/modules/object-record/hooks/__tests__/useCreateOneRecordMutation.test.tsx b/packages/twenty-front/src/modules/object-record/hooks/__tests__/useCreateOneRecordMutation.test.tsxindex 056509fac26..18db35f815b 100644--- a/packages/twenty-front/src/modules/object-record/hooks/__tests__/useCreateOneRecordMutation.test.tsx+++ b/packages/twenty-front/src/modules/object-record/hooks/__tests__/useCreateOneRecordMutation.test.tsx@@ -2,35 +2,13 @@ import { renderHook } from '@testing-library/react';import { print } from 'graphql';import { RecoilRoot } from 'recoil';+import { PERSON_FRAGMENT } from '@/object-record/hooks/__mocks__/personFragment';import { useCreateOneRecordMutation } from '@/object-record/hooks/useCreateOneRecordMutation';const expectedQueryTemplate = `mutation CreateOnePerson($input: PersonCreateInput!) {createPerson(data: $input) {- __typename- xLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- id- createdAt- city- jobTitle- name {- firstName- lastName- }- phone- linkedinLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- updatedAt- avatarUrl- companyId+ ${PERSON_FRAGMENT}}}`.replace(/\s/g, '');diff --git a/packages/twenty-front/src/modules/object-record/hooks/__tests__/useExecuteQuickActionOnOneRecordMutation.test.tsx b/packages/twenty-front/src/modules/object-record/hooks/__tests__/useExecuteQuickActionOnOneRecordMutation.test.tsxindex cf28b76c07b..b48a31a8ddf 100644--- a/packages/twenty-front/src/modules/object-record/hooks/__tests__/useExecuteQuickActionOnOneRecordMutation.test.tsx+++ b/packages/twenty-front/src/modules/object-record/hooks/__tests__/useExecuteQuickActionOnOneRecordMutation.test.tsx@@ -2,35 +2,13 @@ import { renderHook } from '@testing-library/react';import { print } from 'graphql';import { RecoilRoot } from 'recoil';+import { PERSON_FRAGMENT } from '@/object-record/hooks/__mocks__/personFragment';import { useExecuteQuickActionOnOneRecordMutation } from '@/object-record/hooks/useExecuteQuickActionOnOneRecordMutation';const expectedQueryTemplate = `mutation ExecuteQuickActionOnOnePerson($idToExecuteQuickActionOn: ID!) {executeQuickActionOnPerson(id: $idToExecuteQuickActionOn) {- __typename- xLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- id- createdAt- city- jobTitle- name {- firstName- lastName- }- phone- linkedinLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- updatedAt- avatarUrl- companyId+ ${PERSON_FRAGMENT}}}`.replace(/\s/g, '');diff --git a/packages/twenty-front/src/modules/object-record/hooks/__tests__/useFindDuplicateRecordsQuery.test.tsx b/packages/twenty-front/src/modules/object-record/hooks/__tests__/useFindDuplicateRecordsQuery.test.tsxindex 10083ff17cc..e7d0ad73348 100644--- a/packages/twenty-front/src/modules/object-record/hooks/__tests__/useFindDuplicateRecordsQuery.test.tsx+++ b/packages/twenty-front/src/modules/object-record/hooks/__tests__/useFindDuplicateRecordsQuery.test.tsx@@ -2,6 +2,7 @@ import { renderHook } from '@testing-library/react';import { print } from 'graphql';import { RecoilRoot } from 'recoil';+import { PERSON_FRAGMENT } from '@/object-record/hooks/__mocks__/personFragment';import { useFindDuplicateRecordsQuery } from '@/object-record/hooks/useFindDuplicatesRecordsQuery';const expectedQueryTemplate = `@@ -9,30 +10,7 @@ const expectedQueryTemplate = `personDuplicates(ids: $ids) {edges {node {- __typename- xLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- id- createdAt- city- jobTitle- name {- firstName- lastName- }- phone- linkedinLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- updatedAt- avatarUrl- companyId+ ${PERSON_FRAGMENT}}cursor}diff --git a/packages/twenty-front/src/modules/object-record/hooks/__tests__/useFindManyRecordsQuery.test.tsx b/packages/twenty-front/src/modules/object-record/hooks/__tests__/useFindManyRecordsQuery.test.tsxindex 199e89b952e..3d2213a589f 100644--- a/packages/twenty-front/src/modules/object-record/hooks/__tests__/useFindManyRecordsQuery.test.tsx+++ b/packages/twenty-front/src/modules/object-record/hooks/__tests__/useFindManyRecordsQuery.test.tsx@@ -2,6 +2,7 @@ import { renderHook } from '@testing-library/react';import { print } from 'graphql';import { RecoilRoot } from 'recoil';+import { PERSON_FRAGMENT } from '@/object-record/hooks/__mocks__/personFragment';import { useFindManyRecordsQuery } from '@/object-record/hooks/useFindManyRecordsQuery';const expectedQueryTemplate = `@@ -9,30 +10,7 @@ const expectedQueryTemplate = `people(filter: $filter, orderBy: $orderBy, first: $limit, after: $lastCursor) {edges {node {- __typename- xLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- id- createdAt- city- jobTitle- name {- firstName- lastName- }- phone- linkedinLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- updatedAt- avatarUrl- companyId+ ${PERSON_FRAGMENT}}cursor}diff --git a/packages/twenty-front/src/modules/object-record/hooks/__tests__/useFindOneRecordQuery.test.tsx b/packages/twenty-front/src/modules/object-record/hooks/__tests__/useFindOneRecordQuery.test.tsxindex 1724d166332..386e0d55f84 100644--- a/packages/twenty-front/src/modules/object-record/hooks/__tests__/useFindOneRecordQuery.test.tsx+++ b/packages/twenty-front/src/modules/object-record/hooks/__tests__/useFindOneRecordQuery.test.tsx@@ -2,35 +2,13 @@ import { renderHook } from '@testing-library/react';import { print } from 'graphql';import { RecoilRoot } from 'recoil';+import { PERSON_FRAGMENT } from '@/object-record/hooks/__mocks__/personFragment';import { useFindOneRecordQuery } from '@/object-record/hooks/useFindOneRecordQuery';const expectedQueryTemplate = `query FindOnePerson($objectRecordId: ID!) {person(filter: { id: { eq: $objectRecordId } }) {- __typename- xLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- id- createdAt- city- jobTitle- name {- firstName- lastName- }- phone- linkedinLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- updatedAt- avatarUrl- companyId+ ${PERSON_FRAGMENT}}}`.replace(/\s/g, '');diff --git a/packages/twenty-front/src/modules/object-record/hooks/__tests__/useUpdateOneRecordMutation.test.tsx b/packages/twenty-front/src/modules/object-record/hooks/__tests__/useUpdateOneRecordMutation.test.tsxindex e847679bc36..7581e161258 100644--- a/packages/twenty-front/src/modules/object-record/hooks/__tests__/useUpdateOneRecordMutation.test.tsx+++ b/packages/twenty-front/src/modules/object-record/hooks/__tests__/useUpdateOneRecordMutation.test.tsx@@ -2,36 +2,14 @@ import { renderHook } from '@testing-library/react';import { print } from 'graphql';import { RecoilRoot } from 'recoil';+import { PERSON_FRAGMENT } from '@/object-record/hooks/__mocks__/personFragment';import { useUpdateOneRecordMutation } from '@/object-record/hooks/useUpdateOneRecordMutation';import { normalizeGQLQuery } from '~/utils/normalizeGQLQuery';const expectedQueryTemplate = `mutation UpdateOnePerson($idToUpdate: ID!, $input: PersonUpdateInput!) {updatePerson(id: $idToUpdate, data: $input) {- __typename- xLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- id- createdAt- city- jobTitle- name {- firstName- lastName- }- phone- linkedinLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- updatedAt- avatarUrl- companyId+ ${PERSON_FRAGMENT}}}`;diff --git a/packages/twenty-front/src/modules/object-record/record-field/hooks/__tests__/usePersistField.test.tsx b/packages/twenty-front/src/modules/object-record/record-field/hooks/__tests__/usePersistField.test.tsxindex a9f096c76cf..6583c23d9d8 100644--- a/packages/twenty-front/src/modules/object-record/record-field/hooks/__tests__/usePersistField.test.tsx+++ b/packages/twenty-front/src/modules/object-record/record-field/hooks/__tests__/usePersistField.test.tsx@@ -5,6 +5,7 @@ import { ReactNode } from 'react';import { RecoilRoot, useRecoilValue } from 'recoil';import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';+import { PERSON_FRAGMENT } from '@/object-record/hooks/__mocks__/personFragment';import { useUpdateOneRecord } from '@/object-record/hooks/useUpdateOneRecord';import {phoneFieldDefinition,@@ -23,30 +24,7 @@ import { recordStoreFamilySelector } from '@/object-record/record-store/states/sconst query = gql`mutation UpdateOnePerson($idToUpdate: ID!, $input: PersonUpdateInput!) {updatePerson(id: $idToUpdate, data: $input) {- __typename- xLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- id- createdAt- city- jobTitle- name {- firstName- lastName- }- phone- linkedinLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks- }- updatedAt- avatarUrl- companyId+ ${PERSON_FRAGMENT}}}`;diff --git a/packages/twenty-front/src/modules/object-record/record-field/hooks/__tests__/useToggleEditOnlyInput.test.tsx b/packages/twenty-front/src/modules/object-record/record-field/hooks/__tests__/useToggleEditOnlyInput.test.tsxindex 111dfaaefbf..4747c76bef9 100644--- a/packages/twenty-front/src/modules/object-record/record-field/hooks/__tests__/useToggleEditOnlyInput.test.tsx+++ b/packages/twenty-front/src/modules/object-record/record-field/hooks/__tests__/useToggleEditOnlyInput.test.tsx@@ -26,26 +26,35 @@ const mocks: MockedResponse[] = [) {updateCompany(id: $idToUpdate, data: $input) {__typename- xLink {- primaryLinkUrl- primaryLinkLabel- secondaryLinks+ id+ visaSponsorship+ createdBy {+ source+ workspaceMemberId+ name}- linkedinLink {+ domainName {primaryLinkUrlprimaryLinkLabelsecondaryLinks}- domainName {+ introVideo {primaryLinkUrlprimaryLinkLabelsecondaryLinks}+ positionannualRecurringRevenue {amountMicroscurrencyCode}- createdAt+ employees+ linkedinLink {+ primaryLinkUrl+ primaryLinkLabel+ secondaryLinks+ }+ workPolicyaddress {addressStreet1addressStreet2@@ -56,11 +65,17 @@ const mocks: MockedResponse[] = [addressLataddressLng}- updatedAtname+ updatedAt+ xLink {+ primaryLinkUrl+ primaryLinkLabel+ secondaryLinks+ }+ myCustomField+ createdAtaccountOwnerId- employees- id+ taglineidealCustomerProfile}}