Fix createdBy and activity tests (#6569)

As title
This commit is contained in:
Thomas Trompette
2024-08-07 16:21:06 +02:00
committed by GitHub
parent c836bbbfc2
commit 9a0c9672a0
19 changed files with 425 additions and 551 deletions

View File

@ -23,20 +23,17 @@ const mocks: MockedResponse[] = [
{ {
request: { request: {
query: gql` query: gql`
mutation CreateOneActivity($input: ActivityCreateInput!) { mutation CreateOneTask($input: TaskCreateInput!) {
createActivity(data: $input) { createTask(data: $input) {
__typename __typename
createdAt
reminderAt
authorId
title
status status
assigneeId
updatedAt updatedAt
body body
createdAt
dueAt dueAt
type
id id
assigneeId title
} }
} }
`, `,
@ -46,7 +43,7 @@ const mocks: MockedResponse[] = [
}, },
result: jest.fn(() => ({ result: jest.fn(() => ({
data: { data: {
createActivity: { createTask: {
...mockedActivity, ...mockedActivity,
__typename: 'Activity', __typename: 'Activity',
assigneeId: '', assigneeId: '',

View File

@ -9,7 +9,7 @@ import { Task } from '@/activities/types/Task';
const task: Task = { const task: Task = {
id: '123', id: '123',
status: null, status: 'DONE',
title: 'Test', title: 'Test',
body: 'Test', body: 'Test',
dueAt: '2024-03-15T07:33:14.212Z', dueAt: '2024-03-15T07:33:14.212Z',
@ -25,23 +25,23 @@ const mocks: MockedResponse[] = [
{ {
request: { request: {
query: gql` query: gql`
mutation UpdateOneActivity( mutation UpdateOneTask($idToUpdate: ID!, $input: TaskUpdateInput!) {
$idToUpdate: ID! updateTask(id: $idToUpdate, data: $input) {
$input: ActivityUpdateInput!
) {
updateActivity(id: $idToUpdate, data: $input) {
__typename __typename
createdAt
reminderAt
authorId
title
status status
assigneeId
updatedAt updatedAt
body body
createdAt
dueAt dueAt
type position
id id
assigneeId title
createdBy {
source
workspaceMemberId
name
}
} }
} }
`, `,
@ -52,7 +52,7 @@ const mocks: MockedResponse[] = [
}, },
result: jest.fn(() => ({ result: jest.fn(() => ({
data: { data: {
updateActivity: { updateTask: {
__typename: 'Activity', __typename: 'Activity',
createdAt: '2024-03-15T07:33:14.212Z', createdAt: '2024-03-15T07:33:14.212Z',
reminderAt: null, reminderAt: null,

View File

@ -1,6 +1,7 @@
import { gql } from '@apollo/client'; import { gql } from '@apollo/client';
import { AvatarType } from 'twenty-ui'; import { AvatarType } from 'twenty-ui';
import { PERSON_FRAGMENT } from '@/object-record/hooks/__mocks__/personFragment';
import { ColorScheme } from '@/workspace-member/types/WorkspaceMember'; import { ColorScheme } from '@/workspace-member/types/WorkspaceMember';
export const mockId = '8f3b2121-f194-4ba4-9fbf-2d5a37126806'; export const mockId = '8f3b2121-f194-4ba4-9fbf-2d5a37126806';
@ -50,21 +51,21 @@ export const initialFavorites = [
export const sortedFavorites = [ export const sortedFavorites = [
{ {
id: '1', id: '1',
recordId: '1', recordId: '2',
position: 0, position: 0,
avatarType: 'rounded', avatarType: 'squared',
avatarUrl: '', avatarUrl: undefined,
labelIdentifier: ' ', labelIdentifier: 'ABC Corp',
link: '/object/person/1', link: '/object/company/2',
}, },
{ {
id: '2', id: '2',
recordId: '3', recordId: '4',
position: 1, position: 1,
avatarType: 'rounded', avatarType: 'squared',
avatarUrl: '', avatarUrl: undefined,
labelIdentifier: ' ', labelIdentifier: 'Company Test',
link: '/object/person/3', link: '/object/company/4',
}, },
{ {
id: '3', id: '3',
@ -85,94 +86,160 @@ export const mocks = [
mutation CreateOneFavorite($input: FavoriteCreateInput!) { mutation CreateOneFavorite($input: FavoriteCreateInput!) {
createFavorite(data: $input) { createFavorite(data: $input) {
__typename __typename
id taskId
companyId myCustomObjectId
createdAt workspaceMemberId
personId workspaceMember {
person { __typename
__typename userId
xLink { updatedAt
primaryLinkUrl dateFormat
primaryLinkLabel id
secondaryLinks locale
} avatarUrl
id timeZone
createdAt name {
city firstName
email lastName
jobTitle }
name { userEmail
firstName createdAt
lastName timeFormat
} colorScheme
phone }
linkedinLink { companyId
primaryLinkUrl myCustomObject {
primaryLinkLabel __typename
secondaryLinks createdBy {
} source
updatedAt
avatarUrl
companyId
}
position
workspaceMemberId workspaceMemberId
workspaceMember { name
__typename }
colorScheme position
name { updatedAt
firstName name
lastName myCustomField
} id
locale createdAt
userId }
avatarUrl updatedAt
createdAt id
updatedAt opportunity {
id __typename
} companyId
company { closeDate
__typename stage
xLink { createdBy {
primaryLinkUrl source
primaryLinkLabel workspaceMemberId
secondaryLinks name
} }
linkedinLink { id
primaryLinkUrl updatedAt
primaryLinkLabel name
secondaryLinks createdAt
} pointOfContactId
domainName { amount {
primaryLinkUrl amountMicros
primaryLinkLabel currencyCode
secondaryLinks }
} position
annualRecurringRevenue { }
amountMicros noteId
currencyCode note {
} __typename
createdAt createdBy {
address { source
addressStreet1 workspaceMemberId
addressStreet2 name
addressCity }
addressState position
addressCountry body
addressPostcode updatedAt
addressLat createdAt
addressLng title
} id
updatedAt }
name personId
accountOwnerId task {
employees __typename
id status
idealCustomerProfile assigneeId
} updatedAt
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: { variables: {
input: { input: {
@ -219,92 +286,158 @@ export const mocks = [
) { ) {
updateFavorite(id: $idToUpdate, data: $input) { updateFavorite(id: $idToUpdate, data: $input) {
__typename __typename
id taskId
companyId myCustomObjectId
createdAt workspaceMemberId
personId workspaceMember {
person { __typename
__typename userId
xLink { updatedAt
primaryLinkUrl dateFormat
primaryLinkLabel id
secondaryLinks locale
} avatarUrl
id timeZone
createdAt name {
city firstName
email lastName
jobTitle }
name { userEmail
firstName createdAt
lastName timeFormat
} colorScheme
phone }
linkedinLink { companyId
primaryLinkUrl myCustomObject {
primaryLinkLabel __typename
secondaryLinks createdBy {
} source
updatedAt
avatarUrl
companyId
}
position
workspaceMemberId workspaceMemberId
workspaceMember { name
__typename }
colorScheme position
name { updatedAt
firstName name
lastName myCustomField
} id
locale createdAt
userId }
avatarUrl updatedAt
createdAt id
updatedAt opportunity {
id __typename
} companyId
company { closeDate
__typename stage
xLink { createdBy {
primaryLinkUrl source
primaryLinkLabel workspaceMemberId
secondaryLinks name
} }
linkedinLink { id
primaryLinkUrl updatedAt
primaryLinkLabel name
secondaryLinks createdAt
} pointOfContactId
domainName { amount {
primaryLinkUrl amountMicros
primaryLinkLabel currencyCode
secondaryLinks }
} position
annualRecurringRevenue { }
amountMicros noteId
currencyCode note {
} __typename
createdAt createdBy {
address { source
addressStreet1 workspaceMemberId
addressStreet2 name
addressCity }
addressState position
addressCountry body
addressPostcode updatedAt
addressLat createdAt
addressLng title
} id
updatedAt }
name personId
accountOwnerId task {
employees __typename
id status
idealCustomerProfile assigneeId
} updatedAt
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}
}
} }
} }
`, `,

View File

@ -0,0 +1,37 @@
export const PERSON_FRAGMENT = `
__typename
updatedAt
myCustomObjectId
whatsapp
linkedinLink {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
name {
firstName
lastName
}
email
position
createdBy {
source
workspaceMemberId
name
}
avatarUrl
jobTitle
xLink {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
performanceRating
createdAt
phone
id
city
companyId
intro
workPrefereance
`

View File

@ -1,34 +1,12 @@
import { gql } from '@apollo/client'; import { gql } from '@apollo/client';
import { PERSON_FRAGMENT } from '@/object-record/hooks/__mocks__/personFragment';
import { Person } from '@/people/types/Person'; import { Person } from '@/people/types/Person';
export const query = gql` export const query = gql`
mutation CreatePeople($data: [PersonCreateInput!]!, $upsert: Boolean) { mutation CreatePeople($data: [PersonCreateInput!]!, $upsert: Boolean) {
createPeople(data: $data, upsert: $upsert) { createPeople(data: $data, upsert: $upsert) {
__typename ${PERSON_FRAGMENT}
xLink {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
id
createdAt
city
email
jobTitle
name {
firstName
lastName
}
phone
linkedinLink {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
updatedAt
avatarUrl
companyId
} }
} }
`; `;

View File

@ -1,32 +1,10 @@
import { PERSON_FRAGMENT } from '@/object-record/hooks/__mocks__/personFragment';
import { gql } from '@apollo/client'; import { gql } from '@apollo/client';
export const query = gql` export const query = gql`
mutation CreateOnePerson($input: PersonCreateInput!) { mutation CreateOnePerson($input: PersonCreateInput!) {
createPerson(data: $input) { createPerson(data: $input) {
__typename ${PERSON_FRAGMENT}
xLink {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
id
createdAt
city
email
jobTitle
name {
firstName
lastName
}
phone
linkedinLink {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
updatedAt
avatarUrl
companyId
} }
} }
`; `;

View File

@ -1,3 +1,4 @@
import { PERSON_FRAGMENT } from '@/object-record/hooks/__mocks__/personFragment';
import { gql } from '@apollo/client'; import { gql } from '@apollo/client';
export { responseData } from './useUpdateOneRecord'; export { responseData } from './useUpdateOneRecord';
@ -5,30 +6,7 @@ export { responseData } from './useUpdateOneRecord';
export const query = gql` export const query = gql`
mutation ExecuteQuickActionOnOnePerson($idToExecuteQuickActionOn: ID!) { mutation ExecuteQuickActionOnOnePerson($idToExecuteQuickActionOn: ID!) {
executeQuickActionOnPerson(id: $idToExecuteQuickActionOn) { executeQuickActionOnPerson(id: $idToExecuteQuickActionOn) {
__typename ${PERSON_FRAGMENT}
xLink {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
id
createdAt
city
email
jobTitle
name {
firstName
lastName
}
phone
linkedinLink {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
updatedAt
avatarUrl
companyId
} }
} }
`; `;

View File

@ -1,3 +1,4 @@
import { PERSON_FRAGMENT } from '@/object-record/hooks/__mocks__/personFragment';
import { gql } from '@apollo/client'; import { gql } from '@apollo/client';
import { getPeopleMock } from '~/testing/mock-data/people'; import { getPeopleMock } from '~/testing/mock-data/people';
@ -8,30 +9,7 @@ export const query = gql`
personDuplicates(ids: $ids) { personDuplicates(ids: $ids) {
edges { edges {
node { node {
__typename ${PERSON_FRAGMENT}
xLink {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
id
createdAt
city
email
jobTitle
name {
firstName
lastName
}
phone
linkedinLink {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
updatedAt
avatarUrl
companyId
} }
cursor cursor
} }

View File

@ -1,34 +1,12 @@
import { gql } from '@apollo/client'; import { gql } from '@apollo/client';
import { PERSON_FRAGMENT } from '@/object-record/hooks/__mocks__/personFragment';
import { responseData as person } from './useUpdateOneRecord'; import { responseData as person } from './useUpdateOneRecord';
export const query = gql` export const query = gql`
query FindOnePerson($objectRecordId: ID!) { query FindOnePerson($objectRecordId: ID!) {
person(filter: { id: { eq: $objectRecordId } }) { person(filter: { id: { eq: $objectRecordId } }) {
__typename ${PERSON_FRAGMENT}
xLink {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
id
createdAt
city
email
jobTitle
name {
firstName
lastName
}
phone
linkedinLink {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
updatedAt
avatarUrl
companyId
} }
} }
`; `;

View File

@ -1,32 +1,10 @@
import { PERSON_FRAGMENT } from '@/object-record/hooks/__mocks__/personFragment';
import { gql } from '@apollo/client'; import { gql } from '@apollo/client';
export const query = gql` export const query = gql`
mutation UpdateOnePerson($idToUpdate: ID!, $input: PersonUpdateInput!) { mutation UpdateOnePerson($idToUpdate: ID!, $input: PersonUpdateInput!) {
updatePerson(id: $idToUpdate, data: $input) { updatePerson(id: $idToUpdate, data: $input) {
__typename ${PERSON_FRAGMENT}
xLink {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
id
createdAt
city
email
jobTitle
name {
firstName
lastName
}
phone
linkedinLink {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
updatedAt
avatarUrl
companyId
} }
} }
`; `;

View File

@ -2,35 +2,13 @@ import { renderHook } from '@testing-library/react';
import { print } from 'graphql'; import { print } from 'graphql';
import { RecoilRoot } from 'recoil'; import { RecoilRoot } from 'recoil';
import { PERSON_FRAGMENT } from '@/object-record/hooks/__mocks__/personFragment';
import { useCreateManyRecordsMutation } from '@/object-record/hooks/useCreateManyRecordsMutation'; import { useCreateManyRecordsMutation } from '@/object-record/hooks/useCreateManyRecordsMutation';
const expectedQueryTemplate = ` const expectedQueryTemplate = `
mutation CreatePeople($data: [PersonCreateInput!]!, $upsert: Boolean) { mutation CreatePeople($data: [PersonCreateInput!]!, $upsert: Boolean) {
createPeople(data: $data, upsert: $upsert) { createPeople(data: $data, upsert: $upsert) {
__typename ${PERSON_FRAGMENT}
xLink {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
id
createdAt
city
email
jobTitle
name {
firstName
lastName
}
phone
linkedinLink {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
updatedAt
avatarUrl
companyId
} }
} }
`.replace(/\s/g, ''); `.replace(/\s/g, '');

View File

@ -2,35 +2,13 @@ import { renderHook } from '@testing-library/react';
import { print } from 'graphql'; import { print } from 'graphql';
import { RecoilRoot } from 'recoil'; import { RecoilRoot } from 'recoil';
import { PERSON_FRAGMENT } from '@/object-record/hooks/__mocks__/personFragment';
import { useCreateOneRecordMutation } from '@/object-record/hooks/useCreateOneRecordMutation'; import { useCreateOneRecordMutation } from '@/object-record/hooks/useCreateOneRecordMutation';
const expectedQueryTemplate = ` const expectedQueryTemplate = `
mutation CreateOnePerson($input: PersonCreateInput!) { mutation CreateOnePerson($input: PersonCreateInput!) {
createPerson(data: $input) { createPerson(data: $input) {
__typename ${PERSON_FRAGMENT}
xLink {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
id
createdAt
city
email
jobTitle
name {
firstName
lastName
}
phone
linkedinLink {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
updatedAt
avatarUrl
companyId
} }
} }
`.replace(/\s/g, ''); `.replace(/\s/g, '');

View File

@ -2,35 +2,13 @@ import { renderHook } from '@testing-library/react';
import { print } from 'graphql'; import { print } from 'graphql';
import { RecoilRoot } from 'recoil'; import { RecoilRoot } from 'recoil';
import { PERSON_FRAGMENT } from '@/object-record/hooks/__mocks__/personFragment';
import { useExecuteQuickActionOnOneRecordMutation } from '@/object-record/hooks/useExecuteQuickActionOnOneRecordMutation'; import { useExecuteQuickActionOnOneRecordMutation } from '@/object-record/hooks/useExecuteQuickActionOnOneRecordMutation';
const expectedQueryTemplate = ` const expectedQueryTemplate = `
mutation ExecuteQuickActionOnOnePerson($idToExecuteQuickActionOn: ID!) { mutation ExecuteQuickActionOnOnePerson($idToExecuteQuickActionOn: ID!) {
executeQuickActionOnPerson(id: $idToExecuteQuickActionOn) { executeQuickActionOnPerson(id: $idToExecuteQuickActionOn) {
__typename ${PERSON_FRAGMENT}
xLink {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
id
createdAt
city
email
jobTitle
name {
firstName
lastName
}
phone
linkedinLink {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
updatedAt
avatarUrl
companyId
} }
} }
`.replace(/\s/g, ''); `.replace(/\s/g, '');

View File

@ -2,6 +2,7 @@ import { renderHook } from '@testing-library/react';
import { print } from 'graphql'; import { print } from 'graphql';
import { RecoilRoot } from 'recoil'; import { RecoilRoot } from 'recoil';
import { PERSON_FRAGMENT } from '@/object-record/hooks/__mocks__/personFragment';
import { useFindDuplicateRecordsQuery } from '@/object-record/hooks/useFindDuplicatesRecordsQuery'; import { useFindDuplicateRecordsQuery } from '@/object-record/hooks/useFindDuplicatesRecordsQuery';
const expectedQueryTemplate = ` const expectedQueryTemplate = `
@ -9,30 +10,7 @@ const expectedQueryTemplate = `
personDuplicates(ids: $ids) { personDuplicates(ids: $ids) {
edges { edges {
node { node {
__typename ${PERSON_FRAGMENT}
xLink {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
id
createdAt
city
email
jobTitle
name {
firstName
lastName
}
phone
linkedinLink {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
updatedAt
avatarUrl
companyId
} }
cursor cursor
} }

View File

@ -2,6 +2,7 @@ import { renderHook } from '@testing-library/react';
import { print } from 'graphql'; import { print } from 'graphql';
import { RecoilRoot } from 'recoil'; import { RecoilRoot } from 'recoil';
import { PERSON_FRAGMENT } from '@/object-record/hooks/__mocks__/personFragment';
import { useFindManyRecordsQuery } from '@/object-record/hooks/useFindManyRecordsQuery'; import { useFindManyRecordsQuery } from '@/object-record/hooks/useFindManyRecordsQuery';
const expectedQueryTemplate = ` const expectedQueryTemplate = `
@ -9,30 +10,7 @@ const expectedQueryTemplate = `
people(filter: $filter, orderBy: $orderBy, first: $limit, after: $lastCursor) { people(filter: $filter, orderBy: $orderBy, first: $limit, after: $lastCursor) {
edges { edges {
node { node {
__typename ${PERSON_FRAGMENT}
xLink {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
id
createdAt
city
email
jobTitle
name {
firstName
lastName
}
phone
linkedinLink {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
updatedAt
avatarUrl
companyId
} }
cursor cursor
} }

View File

@ -2,35 +2,13 @@ import { renderHook } from '@testing-library/react';
import { print } from 'graphql'; import { print } from 'graphql';
import { RecoilRoot } from 'recoil'; import { RecoilRoot } from 'recoil';
import { PERSON_FRAGMENT } from '@/object-record/hooks/__mocks__/personFragment';
import { useFindOneRecordQuery } from '@/object-record/hooks/useFindOneRecordQuery'; import { useFindOneRecordQuery } from '@/object-record/hooks/useFindOneRecordQuery';
const expectedQueryTemplate = ` const expectedQueryTemplate = `
query FindOnePerson($objectRecordId: ID!) { query FindOnePerson($objectRecordId: ID!) {
person(filter: { id: { eq: $objectRecordId } }) { person(filter: { id: { eq: $objectRecordId } }) {
__typename ${PERSON_FRAGMENT}
xLink {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
id
createdAt
city
email
jobTitle
name {
firstName
lastName
}
phone
linkedinLink {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
updatedAt
avatarUrl
companyId
} }
} }
`.replace(/\s/g, ''); `.replace(/\s/g, '');

View File

@ -2,36 +2,14 @@ import { renderHook } from '@testing-library/react';
import { print } from 'graphql'; import { print } from 'graphql';
import { RecoilRoot } from 'recoil'; import { RecoilRoot } from 'recoil';
import { PERSON_FRAGMENT } from '@/object-record/hooks/__mocks__/personFragment';
import { useUpdateOneRecordMutation } from '@/object-record/hooks/useUpdateOneRecordMutation'; import { useUpdateOneRecordMutation } from '@/object-record/hooks/useUpdateOneRecordMutation';
import { normalizeGQLQuery } from '~/utils/normalizeGQLQuery'; import { normalizeGQLQuery } from '~/utils/normalizeGQLQuery';
const expectedQueryTemplate = ` const expectedQueryTemplate = `
mutation UpdateOnePerson($idToUpdate: ID!, $input: PersonUpdateInput!) { mutation UpdateOnePerson($idToUpdate: ID!, $input: PersonUpdateInput!) {
updatePerson(id: $idToUpdate, data: $input) { updatePerson(id: $idToUpdate, data: $input) {
__typename ${PERSON_FRAGMENT}
xLink {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
id
createdAt
city
email
jobTitle
name {
firstName
lastName
}
phone
linkedinLink {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
updatedAt
avatarUrl
companyId
} }
}`; }`;

View File

@ -5,6 +5,7 @@ import { ReactNode } from 'react';
import { RecoilRoot, useRecoilValue } from 'recoil'; import { RecoilRoot, useRecoilValue } from 'recoil';
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular'; import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
import { PERSON_FRAGMENT } from '@/object-record/hooks/__mocks__/personFragment';
import { useUpdateOneRecord } from '@/object-record/hooks/useUpdateOneRecord'; import { useUpdateOneRecord } from '@/object-record/hooks/useUpdateOneRecord';
import { import {
phoneFieldDefinition, phoneFieldDefinition,
@ -23,30 +24,7 @@ import { recordStoreFamilySelector } from '@/object-record/record-store/states/s
const query = gql` const query = gql`
mutation UpdateOnePerson($idToUpdate: ID!, $input: PersonUpdateInput!) { mutation UpdateOnePerson($idToUpdate: ID!, $input: PersonUpdateInput!) {
updatePerson(id: $idToUpdate, data: $input) { updatePerson(id: $idToUpdate, data: $input) {
__typename ${PERSON_FRAGMENT}
xLink {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
id
createdAt
city
email
jobTitle
name {
firstName
lastName
}
phone
linkedinLink {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
updatedAt
avatarUrl
companyId
} }
} }
`; `;

View File

@ -26,26 +26,35 @@ const mocks: MockedResponse[] = [
) { ) {
updateCompany(id: $idToUpdate, data: $input) { updateCompany(id: $idToUpdate, data: $input) {
__typename __typename
xLink { id
primaryLinkUrl visaSponsorship
primaryLinkLabel createdBy {
secondaryLinks source
} workspaceMemberId
linkedinLink { name
primaryLinkUrl
primaryLinkLabel
secondaryLinks
} }
domainName { domainName {
primaryLinkUrl primaryLinkUrl
primaryLinkLabel primaryLinkLabel
secondaryLinks secondaryLinks
} }
introVideo {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
position
annualRecurringRevenue { annualRecurringRevenue {
amountMicros amountMicros
currencyCode currencyCode
} }
createdAt employees
linkedinLink {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
workPolicy
address { address {
addressStreet1 addressStreet1
addressStreet2 addressStreet2
@ -56,11 +65,17 @@ const mocks: MockedResponse[] = [
addressLat addressLat
addressLng addressLng
} }
updatedAt
name name
updatedAt
xLink {
primaryLinkUrl
primaryLinkLabel
secondaryLinks
}
myCustomField
createdAt
accountOwnerId accountOwnerId
employees tagline
id
idealCustomerProfile idealCustomerProfile
} }
} }