mirror of
https://github.com/twentyhq/twenty.git
synced 2024-11-22 03:17:40 +03:00
Adapt all mocks and tests
This commit is contained in:
parent
6785a2b92c
commit
c703898176
4
.vscode/launch.json
vendored
4
.vscode/launch.json
vendored
@ -44,8 +44,8 @@
|
||||
"nx",
|
||||
"run",
|
||||
"twenty-server:command",
|
||||
"my-command",
|
||||
"--my-parameter value",
|
||||
"workspace:sync-metadata",
|
||||
"-f",
|
||||
],
|
||||
"outputCapture": "std",
|
||||
"internalConsoleOptions": "openOnSessionStart",
|
||||
|
@ -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
|
||||
|
@ -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',
|
||||
|
@ -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
|
||||
|
@ -19,7 +19,7 @@ describe('mapFavorites', () => {
|
||||
company: {
|
||||
id: '4',
|
||||
name: 'My Company',
|
||||
domainName: 'example.com',
|
||||
domainName: { primaryLinkUrl: 'example.com', primaryLinkLabel: '' },
|
||||
},
|
||||
position: 1,
|
||||
},
|
||||
|
@ -59,7 +59,10 @@ describe('useGetObjectRecordIdentifierByNameSingular', () => {
|
||||
rerender({
|
||||
record: {
|
||||
id: 'recordId',
|
||||
domainName: 'https://cool-company.com',
|
||||
domainName: {
|
||||
primaryLinkUrl: 'cool-company.com',
|
||||
primaryLinkLabel: '',
|
||||
},
|
||||
},
|
||||
objectNameSingular: 'company',
|
||||
});
|
||||
|
@ -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
|
||||
|
@ -60,7 +60,10 @@ linkedinLink
|
||||
primaryLinkLabel
|
||||
secondaryLinks
|
||||
}
|
||||
domainName
|
||||
domainName {
|
||||
primaryLinkLabel
|
||||
primaryLinkUrl
|
||||
}
|
||||
annualRecurringRevenue
|
||||
{
|
||||
amountMicros
|
||||
|
@ -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:
|
||||
|
@ -74,7 +74,10 @@ export const query = gql`
|
||||
primaryLinkLabel
|
||||
primaryLinkUrl
|
||||
}
|
||||
domainName
|
||||
domainName {
|
||||
primaryLinkLabel
|
||||
primaryLinkUrl
|
||||
}
|
||||
annualRecurringRevenue {
|
||||
amountMicros
|
||||
currencyCode
|
||||
|
@ -36,7 +36,10 @@ const mocks: MockedResponse[] = [
|
||||
primaryLinkLabel
|
||||
secondaryLinks
|
||||
}
|
||||
domainName
|
||||
domainName {
|
||||
primaryLinkLabel
|
||||
primaryLinkUrl
|
||||
}
|
||||
annualRecurringRevenue {
|
||||
amountMicros
|
||||
currencyCode
|
||||
|
@ -36,7 +36,10 @@ const companyMocks = [
|
||||
primaryLinkLabel
|
||||
secondaryLinks
|
||||
}
|
||||
domainName
|
||||
domainName {
|
||||
primaryLinkLabel
|
||||
primaryLinkUrl
|
||||
}
|
||||
annualRecurringRevenue {
|
||||
amountMicros
|
||||
currencyCode
|
||||
|
@ -70,7 +70,10 @@ export const query = gql`
|
||||
primaryLinkLabel
|
||||
primaryLinkUrl
|
||||
}
|
||||
domainName
|
||||
domainName {
|
||||
primaryLinkLabel
|
||||
primaryLinkUrl
|
||||
}
|
||||
annualRecurringRevenue {
|
||||
amountMicros
|
||||
currencyCode
|
||||
|
@ -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,
|
||||
|
@ -223,7 +223,10 @@ describe('CompanyResolver (e2e)', () => {
|
||||
updateOneCompany(data: $data, where: $where) {
|
||||
id
|
||||
name
|
||||
domainName
|
||||
domainName {
|
||||
primaryLinkLabek
|
||||
primaryLinkUrl
|
||||
}
|
||||
address {
|
||||
addressCity
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user