Adapt all mocks and tests

This commit is contained in:
Marie Stoppa 2024-07-26 11:32:41 +02:00
parent 6785a2b92c
commit c703898176
15 changed files with 57 additions and 20 deletions

4
.vscode/launch.json vendored
View File

@ -44,8 +44,8 @@
"nx",
"run",
"twenty-server:command",
"my-command",
"--my-parameter value",
"workspace:sync-metadata",
"-f",
],
"outputCapture": "std",
"internalConsoleOptions": "openOnSessionStart",

View File

@ -1,7 +1,7 @@
import { ReactNode } from 'react';
import { gql, InMemoryCache } from '@apollo/client';
import { MockedProvider } from '@apollo/client/testing';
import { act, renderHook } from '@testing-library/react';
import { ReactNode } from 'react';
import { RecoilRoot, useSetRecoilState } from 'recoil';
import { useActivityTargetObjectRecords } from '@/activities/hooks/useActivityTargetObjectRecords';
@ -45,7 +45,7 @@ const activityNode = {
company: {
id: '89bb825c-171e-4bcc-9cf7-43448d6fb280',
name: 'Airbnb',
domainName: 'airbnb.com',
domainName: { primaryLinkUrl: 'airbnb.com', primaryLinkLabel: '' },
},
person: null,
activityId: '89bb825c-171e-4bcc-9cf7-43448d6fb230',
@ -90,7 +90,10 @@ cache.writeFragment({
company {
id
name
domainName
domainName {
primaryLinkLabel
primaryLinkUrl
}
}
person
activityId

View File

@ -52,7 +52,7 @@ const mockedActivities: Array<Activity> = [
__typename: 'Company',
id: '89bb825c-171e-4bcc-9cf7-43448d6fb280',
name: 'Airbnb',
domainName: 'airbnb.com',
domainName: { primaryLinkUrl: 'airbnb.com', primaryLinkLabel: '' },
},
person: null,
activityId: '89bb825c-171e-4bcc-9cf7-43448d6fb230',
@ -75,7 +75,7 @@ const mockedActivities: Array<Activity> = [
__typename: 'Company',
id: '89bb825c-171e-4bcc-9cf7-43448d6fb278',
name: 'Aircall',
domainName: 'aircall.io',
domainName: { primaryLinkUrl: 'aircall.io', primaryLinkLabel: '' },
},
person: null,
activityId: 'b396e6b9-dc5c-4643-bcff-61b6cf7523ae',

View File

@ -143,7 +143,10 @@ export const mocks = [
primaryLinkLabel
secondaryLinks
}
domainName
domainName {
primaryLinkLabel
primaryLinkUrl
}
annualRecurringRevenue {
amountMicros
currencyCode
@ -273,7 +276,10 @@ export const mocks = [
primaryLinkLabel
secondaryLinks
}
domainName
domainName {
primaryLinkLabel
primaryLinkUrl
}
annualRecurringRevenue {
amountMicros
currencyCode

View File

@ -19,7 +19,7 @@ describe('mapFavorites', () => {
company: {
id: '4',
name: 'My Company',
domainName: 'example.com',
domainName: { primaryLinkUrl: 'example.com', primaryLinkLabel: '' },
},
position: 1,
},

View File

@ -59,7 +59,10 @@ describe('useGetObjectRecordIdentifierByNameSingular', () => {
rerender({
record: {
id: 'recordId',
domainName: 'https://cool-company.com',
domainName: {
primaryLinkUrl: 'cool-company.com',
primaryLinkLabel: '',
},
},
objectNameSingular: 'company',
});

View File

@ -60,7 +60,10 @@ linkedinLink
primaryLinkLabel
secondaryLinks
}
domainName
domainName {
primaryLinkLabel
primaryLinkUrl
}
annualRecurringRevenue
{
amountMicros
@ -135,7 +138,10 @@ linkedinLink
primaryLinkLabel
secondaryLinks
}
domainName
domainName {
primaryLinkLabel
primaryLinkUrl
}
annualRecurringRevenue
{
amountMicros

View File

@ -60,7 +60,10 @@ linkedinLink
primaryLinkLabel
secondaryLinks
}
domainName
domainName {
primaryLinkLabel
primaryLinkUrl
}
annualRecurringRevenue
{
amountMicros

View File

@ -2940,7 +2940,7 @@ export const getObjectMetadataItemsMock = () => {
{
__typename: 'field',
id: '20202020-5e4e-4007-a630-8a2617914889',
type: 'TEXT',
type: 'LINKS',
name: 'domainName',
label: 'Domain Name',
description:

View File

@ -74,7 +74,10 @@ export const query = gql`
primaryLinkLabel
primaryLinkUrl
}
domainName
domainName {
primaryLinkLabel
primaryLinkUrl
}
annualRecurringRevenue {
amountMicros
currencyCode

View File

@ -36,7 +36,10 @@ const mocks: MockedResponse[] = [
primaryLinkLabel
secondaryLinks
}
domainName
domainName {
primaryLinkLabel
primaryLinkUrl
}
annualRecurringRevenue {
amountMicros
currencyCode

View File

@ -36,7 +36,10 @@ const companyMocks = [
primaryLinkLabel
secondaryLinks
}
domainName
domainName {
primaryLinkLabel
primaryLinkUrl
}
annualRecurringRevenue {
amountMicros
currencyCode

View File

@ -70,7 +70,10 @@ export const query = gql`
primaryLinkLabel
primaryLinkUrl
}
domainName
domainName {
primaryLinkLabel
primaryLinkUrl
}
annualRecurringRevenue {
amountMicros
currencyCode

View File

@ -2,6 +2,7 @@ import { EntityManager } from 'typeorm';
import { companiesDemo } from 'src/engine/workspace-manager/demo-objects-prefill-data/companies-demo.json';
// TO DO
export const companyPrefillDemoData = async (
entityManager: EntityManager,
schemaName: string,

View File

@ -223,7 +223,10 @@ describe('CompanyResolver (e2e)', () => {
updateOneCompany(data: $data, where: $where) {
id
name
domainName
domainName {
primaryLinkLabek
primaryLinkUrl
}
address {
addressCity
}