@ -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
|
||||
`
|
||||
@ -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
|
||||
email
|
||||
jobTitle
|
||||
name {
|
||||
firstName
|
||||
lastName
|
||||
}
|
||||
phone
|
||||
linkedinLink {
|
||||
primaryLinkUrl
|
||||
primaryLinkLabel
|
||||
secondaryLinks
|
||||
}
|
||||
updatedAt
|
||||
avatarUrl
|
||||
companyId
|
||||
${PERSON_FRAGMENT}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@ -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
|
||||
email
|
||||
jobTitle
|
||||
name {
|
||||
firstName
|
||||
lastName
|
||||
}
|
||||
phone
|
||||
linkedinLink {
|
||||
primaryLinkUrl
|
||||
primaryLinkLabel
|
||||
secondaryLinks
|
||||
}
|
||||
updatedAt
|
||||
avatarUrl
|
||||
companyId
|
||||
${PERSON_FRAGMENT}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@ -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
|
||||
email
|
||||
jobTitle
|
||||
name {
|
||||
firstName
|
||||
lastName
|
||||
}
|
||||
phone
|
||||
linkedinLink {
|
||||
primaryLinkUrl
|
||||
primaryLinkLabel
|
||||
secondaryLinks
|
||||
}
|
||||
updatedAt
|
||||
avatarUrl
|
||||
companyId
|
||||
${PERSON_FRAGMENT}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@ -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
|
||||
email
|
||||
jobTitle
|
||||
name {
|
||||
firstName
|
||||
lastName
|
||||
}
|
||||
phone
|
||||
linkedinLink {
|
||||
primaryLinkUrl
|
||||
primaryLinkLabel
|
||||
secondaryLinks
|
||||
}
|
||||
updatedAt
|
||||
avatarUrl
|
||||
companyId
|
||||
${PERSON_FRAGMENT}
|
||||
}
|
||||
cursor
|
||||
}
|
||||
|
||||
@ -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
|
||||
email
|
||||
jobTitle
|
||||
name {
|
||||
firstName
|
||||
lastName
|
||||
}
|
||||
phone
|
||||
linkedinLink {
|
||||
primaryLinkUrl
|
||||
primaryLinkLabel
|
||||
secondaryLinks
|
||||
}
|
||||
updatedAt
|
||||
avatarUrl
|
||||
companyId
|
||||
${PERSON_FRAGMENT}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@ -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
|
||||
email
|
||||
jobTitle
|
||||
name {
|
||||
firstName
|
||||
lastName
|
||||
}
|
||||
phone
|
||||
linkedinLink {
|
||||
primaryLinkUrl
|
||||
primaryLinkLabel
|
||||
secondaryLinks
|
||||
}
|
||||
updatedAt
|
||||
avatarUrl
|
||||
companyId
|
||||
${PERSON_FRAGMENT}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@ -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
|
||||
email
|
||||
jobTitle
|
||||
name {
|
||||
firstName
|
||||
lastName
|
||||
}
|
||||
phone
|
||||
linkedinLink {
|
||||
primaryLinkUrl
|
||||
primaryLinkLabel
|
||||
secondaryLinks
|
||||
}
|
||||
updatedAt
|
||||
avatarUrl
|
||||
companyId
|
||||
${PERSON_FRAGMENT}
|
||||
}
|
||||
}
|
||||
`.replace(/\s/g, '');
|
||||
|
||||
@ -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
|
||||
email
|
||||
jobTitle
|
||||
name {
|
||||
firstName
|
||||
lastName
|
||||
}
|
||||
phone
|
||||
linkedinLink {
|
||||
primaryLinkUrl
|
||||
primaryLinkLabel
|
||||
secondaryLinks
|
||||
}
|
||||
updatedAt
|
||||
avatarUrl
|
||||
companyId
|
||||
${PERSON_FRAGMENT}
|
||||
}
|
||||
}
|
||||
`.replace(/\s/g, '');
|
||||
|
||||
@ -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
|
||||
email
|
||||
jobTitle
|
||||
name {
|
||||
firstName
|
||||
lastName
|
||||
}
|
||||
phone
|
||||
linkedinLink {
|
||||
primaryLinkUrl
|
||||
primaryLinkLabel
|
||||
secondaryLinks
|
||||
}
|
||||
updatedAt
|
||||
avatarUrl
|
||||
companyId
|
||||
${PERSON_FRAGMENT}
|
||||
}
|
||||
}
|
||||
`.replace(/\s/g, '');
|
||||
|
||||
@ -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
|
||||
email
|
||||
jobTitle
|
||||
name {
|
||||
firstName
|
||||
lastName
|
||||
}
|
||||
phone
|
||||
linkedinLink {
|
||||
primaryLinkUrl
|
||||
primaryLinkLabel
|
||||
secondaryLinks
|
||||
}
|
||||
updatedAt
|
||||
avatarUrl
|
||||
companyId
|
||||
${PERSON_FRAGMENT}
|
||||
}
|
||||
cursor
|
||||
}
|
||||
|
||||
@ -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
|
||||
email
|
||||
jobTitle
|
||||
name {
|
||||
firstName
|
||||
lastName
|
||||
}
|
||||
phone
|
||||
linkedinLink {
|
||||
primaryLinkUrl
|
||||
primaryLinkLabel
|
||||
secondaryLinks
|
||||
}
|
||||
updatedAt
|
||||
avatarUrl
|
||||
companyId
|
||||
${PERSON_FRAGMENT}
|
||||
}
|
||||
cursor
|
||||
}
|
||||
|
||||
@ -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
|
||||
email
|
||||
jobTitle
|
||||
name {
|
||||
firstName
|
||||
lastName
|
||||
}
|
||||
phone
|
||||
linkedinLink {
|
||||
primaryLinkUrl
|
||||
primaryLinkLabel
|
||||
secondaryLinks
|
||||
}
|
||||
updatedAt
|
||||
avatarUrl
|
||||
companyId
|
||||
${PERSON_FRAGMENT}
|
||||
}
|
||||
}
|
||||
`.replace(/\s/g, '');
|
||||
|
||||
@ -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
|
||||
email
|
||||
jobTitle
|
||||
name {
|
||||
firstName
|
||||
lastName
|
||||
}
|
||||
phone
|
||||
linkedinLink {
|
||||
primaryLinkUrl
|
||||
primaryLinkLabel
|
||||
secondaryLinks
|
||||
}
|
||||
updatedAt
|
||||
avatarUrl
|
||||
companyId
|
||||
${PERSON_FRAGMENT}
|
||||
}
|
||||
}`;
|
||||
|
||||
|
||||
@ -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/s
|
||||
const query = gql`
|
||||
mutation UpdateOnePerson($idToUpdate: ID!, $input: PersonUpdateInput!) {
|
||||
updatePerson(id: $idToUpdate, data: $input) {
|
||||
__typename
|
||||
xLink {
|
||||
primaryLinkUrl
|
||||
primaryLinkLabel
|
||||
secondaryLinks
|
||||
}
|
||||
id
|
||||
createdAt
|
||||
city
|
||||
email
|
||||
jobTitle
|
||||
name {
|
||||
firstName
|
||||
lastName
|
||||
}
|
||||
phone
|
||||
linkedinLink {
|
||||
primaryLinkUrl
|
||||
primaryLinkLabel
|
||||
secondaryLinks
|
||||
}
|
||||
updatedAt
|
||||
avatarUrl
|
||||
companyId
|
||||
${PERSON_FRAGMENT}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@ -26,26 +26,35 @@ const mocks: MockedResponse[] = [
|
||||
) {
|
||||
updateCompany(id: $idToUpdate, data: $input) {
|
||||
__typename
|
||||
xLink {
|
||||
primaryLinkUrl
|
||||
primaryLinkLabel
|
||||
secondaryLinks
|
||||
}
|
||||
linkedinLink {
|
||||
primaryLinkUrl
|
||||
primaryLinkLabel
|
||||
secondaryLinks
|
||||
id
|
||||
visaSponsorship
|
||||
createdBy {
|
||||
source
|
||||
workspaceMemberId
|
||||
name
|
||||
}
|
||||
domainName {
|
||||
primaryLinkUrl
|
||||
primaryLinkLabel
|
||||
secondaryLinks
|
||||
}
|
||||
introVideo {
|
||||
primaryLinkUrl
|
||||
primaryLinkLabel
|
||||
secondaryLinks
|
||||
}
|
||||
position
|
||||
annualRecurringRevenue {
|
||||
amountMicros
|
||||
currencyCode
|
||||
}
|
||||
createdAt
|
||||
employees
|
||||
linkedinLink {
|
||||
primaryLinkUrl
|
||||
primaryLinkLabel
|
||||
secondaryLinks
|
||||
}
|
||||
workPolicy
|
||||
address {
|
||||
addressStreet1
|
||||
addressStreet2
|
||||
@ -56,11 +65,17 @@ const mocks: MockedResponse[] = [
|
||||
addressLat
|
||||
addressLng
|
||||
}
|
||||
updatedAt
|
||||
name
|
||||
updatedAt
|
||||
xLink {
|
||||
primaryLinkUrl
|
||||
primaryLinkLabel
|
||||
secondaryLinks
|
||||
}
|
||||
myCustomField
|
||||
createdAt
|
||||
accountOwnerId
|
||||
employees
|
||||
id
|
||||
tagline
|
||||
idealCustomerProfile
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user