Fix more tests 2 (#18293)

## Summary
- Migrate more hand-written test mocks to auto-generated data from a
real Twenty instance
- Add generators for views, billing plans, API keys; extend record
generator for workspace members, favorites, connected accounts, calendar
events
- Remove 9 hand-written mock files replaced by generated equivalents
- Update 16 test/story files to use generated data
- Fix WorkflowEditActionEmailBase story assertion to match configured
recipient email

## Test plan
- [x] Lint, typecheck, unit tests pass
- [ ] Storybook tests pass in CI
This commit is contained in:
Charles Bochet
2026-02-27 23:11:56 +01:00
committed by GitHub
parent cfad24da48
commit 9342b16aad
37 changed files with 30101 additions and 3139 deletions
@@ -1,7 +1,10 @@
/* eslint-disable no-console */
import { generateApiKeys } from './mock-data/generate-api-keys.js';
import { generateBillingPlans } from './mock-data/generate-billing-plans.js';
import { generateMetadata } from './mock-data/generate-metadata.js';
import { generateRecordData } from './mock-data/generate-record-data.js';
import { generateRoles } from './mock-data/generate-roles.js';
import { generateViews } from './mock-data/generate-views.js';
import { authenticate } from './mock-data/utils.js';
const main = async () => {
@@ -10,6 +13,22 @@ const main = async () => {
const metadata = await generateMetadata(token);
await generateRecordData(token, metadata);
await generateRoles(token);
await generateViews(token);
try {
await generateBillingPlans(token);
} catch (error) {
console.warn(
'Skipping billing plans generation (billing not available):',
(error as Error).message,
);
}
try {
await generateApiKeys(token);
} catch (error) {
console.warn('Skipping API keys generation:', (error as Error).message);
}
console.log('All mock data generated!');
};
@@ -0,0 +1,40 @@
/* eslint-disable no-console */
import { graphqlRequest, writeGeneratedFile } from './utils.js';
const API_KEYS_QUERY = `
query ApiKeys {
apiKeys {
__typename
id
name
expiresAt
createdAt
updatedAt
revokedAt
role {
__typename
id
label
icon
}
}
}
`;
export const generateApiKeys = async (token: string) => {
console.log('Fetching API keys from /metadata ...');
const data = (await graphqlRequest('/metadata', API_KEYS_QUERY, token)) as {
apiKeys: Record<string, unknown>[];
};
console.log(` Got ${data.apiKeys.length} API keys.`);
writeGeneratedFile(
'metadata/api-keys/mock-api-keys-data.ts',
'mockedApiKeys',
'Record<string, unknown>[]',
'',
data.apiKeys,
);
};
@@ -0,0 +1,68 @@
/* eslint-disable no-console */
import { graphqlRequest, writeGeneratedFile } from './utils.js';
const LIST_PLANS_QUERY = `
query listPlans {
listPlans {
planKey
licensedProducts {
name
description
images
metadata {
productKey
planKey
priceUsageBased
}
... on BillingLicensedProduct {
prices {
stripePriceId
unitAmount
recurringInterval
priceUsageType
}
}
}
meteredProducts {
name
description
images
metadata {
productKey
planKey
priceUsageBased
}
... on BillingMeteredProduct {
prices {
priceUsageType
recurringInterval
stripePriceId
tiers {
flatAmount
unitAmount
upTo
}
}
}
}
}
}
`;
export const generateBillingPlans = async (token: string) => {
console.log('Fetching billing plans from /metadata ...');
const data = (await graphqlRequest('/metadata', LIST_PLANS_QUERY, token)) as {
listPlans: Record<string, unknown>[];
};
console.log(` Got ${data.listPlans.length} billing plans.`);
writeGeneratedFile(
'metadata/billing-plans/mock-billing-plans-data.ts',
'mockedBillingPlans',
'Record<string, unknown>',
'',
{ listPlans: data.listPlans },
);
};
@@ -15,6 +15,11 @@ const OBJECTS_TO_GENERATE = [
'task',
'note',
'timelineActivity',
'workspaceMember',
'favorite',
'favoriteFolder',
'connectedAccount',
'calendarEvent',
];
// Production query builders omit __typename on connection/edge wrappers
@@ -0,0 +1,119 @@
/* eslint-disable no-console, lingui/no-unlocalized-strings */
import { graphqlRequest, writeGeneratedFile } from './utils.js';
const FIND_ALL_CORE_VIEWS_QUERY = `
query FindAllCoreViews {
getCoreViews {
id
name
objectMetadataId
type
key
icon
position
isCompact
openRecordIn
kanbanAggregateOperation
kanbanAggregateOperationFieldMetadataId
mainGroupByFieldMetadataId
shouldHideEmptyGroups
anyFieldFilterValue
calendarFieldMetadataId
calendarLayout
visibility
createdByUserWorkspaceId
viewFields {
id
fieldMetadataId
viewId
isVisible
position
size
aggregateOperation
createdAt
updatedAt
deletedAt
}
viewFieldGroups {
id
name
position
isVisible
viewId
createdAt
updatedAt
deletedAt
viewFields {
id
fieldMetadataId
viewId
isVisible
position
size
aggregateOperation
createdAt
updatedAt
deletedAt
}
}
viewFilters {
id
fieldMetadataId
operand
value
viewFilterGroupId
positionInViewFilterGroup
subFieldName
viewId
createdAt
updatedAt
deletedAt
}
viewFilterGroups {
id
parentViewFilterGroupId
logicalOperator
positionInViewFilterGroup
viewId
}
viewSorts {
id
fieldMetadataId
direction
viewId
}
viewGroups {
id
isVisible
fieldValue
position
viewId
createdAt
updatedAt
deletedAt
}
}
}
`;
export const generateViews = async (token: string) => {
console.log('Fetching views from /metadata ...');
const data = (await graphqlRequest(
'/metadata',
FIND_ALL_CORE_VIEWS_QUERY,
token,
)) as {
getCoreViews: Record<string, unknown>[];
};
console.log(` Got ${data.getCoreViews.length} views.`);
writeGeneratedFile(
'metadata/views/mock-views-data.ts',
'mockedCoreViews',
'CoreViewWithRelations[]',
"import { type CoreViewWithRelations } from '@/views/types/CoreViewWithRelations';",
data.getCoreViews,
);
};
@@ -11,8 +11,10 @@ import { recordStoreFamilyState } from '@/object-record/record-store/states/reco
import { useSetAtomFamilyState } from '@/ui/utilities/state/jotai/hooks/useSetAtomFamilyState';
import { jotaiStore } from '@/ui/utilities/state/jotai/jotaiStore';
import { SnackBarComponentInstanceContext } from '@/ui/feedback/snack-bar-manager/contexts/SnackBarComponentInstanceContext';
import { getRecordFromRecordNode } from '@/object-record/cache/utils/getRecordFromRecordNode';
import { type WorkspaceMember } from '@/workspace-member/types/WorkspaceMember';
import { JestObjectMetadataItemSetter } from '~/testing/jest/JestObjectMetadataItemSetter';
import { mockWorkspaceMembers } from '~/testing/mock-data/workspace-members';
import { mockedWorkspaceMemberRecords } from '~/testing/mock-data/generated/data/workspaceMembers/mock-workspaceMembers-data';
import { generatedMockObjectMetadataItems } from '~/testing/utils/generatedMockObjectMetadataItems';
const cache = new InMemoryCache();
@@ -131,7 +133,12 @@ const Wrapper = ({ children }: { children: ReactNode }) => (
describe('useActivityTargetObjectRecords', () => {
it('return targetObjects', async () => {
jotaiStore.set(currentWorkspaceMemberState.atom, mockWorkspaceMembers[0]);
jotaiStore.set(
currentWorkspaceMemberState.atom,
getRecordFromRecordNode<WorkspaceMember>({
recordNode: mockedWorkspaceMemberRecords[0],
}),
);
jotaiStore.set(
objectMetadataItemsState.atom,
@@ -13,7 +13,7 @@ import { GET_CURRENT_USER } from '@/users/graphql/queries/getCurrentUser';
import { FIND_ALL_CORE_VIEWS } from '@/views/graphql/queries/findAllCoreViews';
import { getJestMetadataAndApolloMocksWrapper } from '~/testing/jest/getJestMetadataAndApolloMocksWrapper';
import { mockedUserData } from '~/testing/mock-data/users';
import { mockedCoreViewsData } from '~/testing/mock-data/views';
import { mockedCoreViews } from '~/testing/mock-data/generated/metadata/views/mock-views-data';
import {
query as findManyObjectMetadataItemsQuery,
responseData as findManyObjectMetadataItemsResponseData,
@@ -49,7 +49,7 @@ const mocks = [
},
result: jest.fn(() => ({
data: {
getCoreViews: mockedCoreViewsData,
getCoreViews: mockedCoreViews,
},
})),
},
@@ -101,23 +101,31 @@ exports[`useDeleteOneRecord B. Starting from filled cache 1. Should handle succe
exports[`useDeleteOneRecord B. Starting from filled cache 1. Should handle successfull record deletion 2`] = `
{
"__typename": "Company",
"accountOwner": null,
"accountOwner": {},
"accountOwnerId": "20202020-1553-45c6-a028-5a9064cce07f",
"address": {
"__typename": "Address",
"addressCity": "Dublin",
"addressCountry": "Ireland",
"addressCity": "Denver",
"addressCountry": "",
"addressLat": null,
"addressLng": null,
"addressPostcode": null,
"addressState": null,
"addressStreet1": "Eutaw Street",
"addressStreet2": null,
"addressPostcode": "",
"addressState": "",
"addressStreet1": "",
"addressStreet2": "",
},
"createdAt": "2025-02-16T08:21:51.715Z",
"annualRecurringRevenue": {
"__typename": "Currency",
"amountMicros": null,
"currencyCode": null,
},
"attachments": [],
"caredForPets": [],
"createdAt": "2026-02-27T01:17:29.464Z",
"createdBy": {
"__typename": "Actor",
"context": {},
"name": "Tim Apple",
"context": null,
"name": "Tim A",
"source": "MANUAL",
"workspaceMemberId": "20202020-0687-4c41-b707-ed1bfca972a7",
},
@@ -125,28 +133,63 @@ exports[`useDeleteOneRecord B. Starting from filled cache 1. Should handle succe
"domainName": {
"__typename": "Links",
"primaryLinkLabel": "",
"primaryLinkUrl": "https://linkedin.com",
"primaryLinkUrl": "housecallpro.com",
"secondaryLinks": [],
},
"employees": null,
"id": "20202020-3ec3-4fe3-8997-b76aa0bfa408",
"linkedinLink": {
"employees": 894,
"favorites": [],
"id": "20202020-a000-4485-94de-70c2a98daef2",
"idealCustomerProfile": false,
"introVideo": {
"__typename": "Links",
"primaryLinkLabel": "",
"primaryLinkUrl": "",
"secondaryLinks": [],
},
"name": "Linkedin",
"noteTargets": [],
"opportunities": [
"linkedinLink": {
"__typename": "Links",
"primaryLinkLabel": "",
"primaryLinkUrl": "https://linkedin.com/company/housecallpro",
"secondaryLinks": [],
},
"name": "Housecall Pro",
"noteTargets": [
{},
],
"opportunities": [],
"people": [
{},
{},
],
"position": 1,
"taskTargets": [],
"position": 442,
"previousEmployees": [],
"tagline": "",
"taskTargets": [
{},
],
"timelineActivities": [
{},
{},
{},
{},
{},
],
"updatedAt": "2026-02-27T01:17:29.464Z",
"updatedBy": {
"__typename": "Actor",
"context": null,
"name": "Tim A",
"source": "MANUAL",
"workspaceMemberId": "20202020-0687-4c41-b707-ed1bfca972a7",
},
"visaSponsorship": false,
"workPolicy": [],
"xLink": {
"__typename": "Links",
"primaryLinkLabel": "",
"primaryLinkUrl": "",
"secondaryLinks": [],
},
}
`;
@@ -243,23 +286,31 @@ exports[`useDeleteOneRecord B. Starting from filled cache 2. Should handle optim
exports[`useDeleteOneRecord B. Starting from filled cache 2. Should handle optimistic cache on record deletion 2`] = `
{
"__typename": "Company",
"accountOwner": null,
"accountOwner": {},
"accountOwnerId": "20202020-1553-45c6-a028-5a9064cce07f",
"address": {
"__typename": "Address",
"addressCity": "Dublin",
"addressCountry": "Ireland",
"addressCity": "Denver",
"addressCountry": "",
"addressLat": null,
"addressLng": null,
"addressPostcode": null,
"addressState": null,
"addressStreet1": "Eutaw Street",
"addressStreet2": null,
"addressPostcode": "",
"addressState": "",
"addressStreet1": "",
"addressStreet2": "",
},
"createdAt": "2025-02-16T08:21:51.715Z",
"annualRecurringRevenue": {
"__typename": "Currency",
"amountMicros": null,
"currencyCode": null,
},
"attachments": [],
"caredForPets": [],
"createdAt": "2026-02-27T01:17:29.464Z",
"createdBy": {
"__typename": "Actor",
"context": {},
"name": "Tim Apple",
"context": null,
"name": "Tim A",
"source": "MANUAL",
"workspaceMemberId": "20202020-0687-4c41-b707-ed1bfca972a7",
},
@@ -267,28 +318,63 @@ exports[`useDeleteOneRecord B. Starting from filled cache 2. Should handle optim
"domainName": {
"__typename": "Links",
"primaryLinkLabel": "",
"primaryLinkUrl": "https://linkedin.com",
"primaryLinkUrl": "housecallpro.com",
"secondaryLinks": [],
},
"employees": null,
"id": "20202020-3ec3-4fe3-8997-b76aa0bfa408",
"linkedinLink": {
"employees": 894,
"favorites": [],
"id": "20202020-a000-4485-94de-70c2a98daef2",
"idealCustomerProfile": false,
"introVideo": {
"__typename": "Links",
"primaryLinkLabel": "",
"primaryLinkUrl": "",
"secondaryLinks": [],
},
"name": "Linkedin",
"noteTargets": [],
"opportunities": [
"linkedinLink": {
"__typename": "Links",
"primaryLinkLabel": "",
"primaryLinkUrl": "https://linkedin.com/company/housecallpro",
"secondaryLinks": [],
},
"name": "Housecall Pro",
"noteTargets": [
{},
],
"opportunities": [],
"people": [
{},
{},
],
"position": 1,
"taskTargets": [],
"position": 442,
"previousEmployees": [],
"tagline": "",
"taskTargets": [
{},
],
"timelineActivities": [
{},
{},
{},
{},
{},
],
"updatedAt": "2026-02-27T01:17:29.464Z",
"updatedBy": {
"__typename": "Actor",
"context": null,
"name": "Tim A",
"source": "MANUAL",
"workspaceMemberId": "20202020-0687-4c41-b707-ed1bfca972a7",
},
"visaSponsorship": false,
"workPolicy": [],
"xLink": {
"__typename": "Links",
"primaryLinkLabel": "",
"primaryLinkUrl": "",
"secondaryLinks": [],
},
}
`;
@@ -385,23 +471,31 @@ exports[`useDeleteOneRecord B. Starting from filled cache 3. Should handle optim
exports[`useDeleteOneRecord B. Starting from filled cache 3. Should handle optimistic cache rollback on record deletion failure 2`] = `
{
"__typename": "Company",
"accountOwner": null,
"accountOwner": {},
"accountOwnerId": "20202020-1553-45c6-a028-5a9064cce07f",
"address": {
"__typename": "Address",
"addressCity": "Dublin",
"addressCountry": "Ireland",
"addressCity": "Denver",
"addressCountry": "",
"addressLat": null,
"addressLng": null,
"addressPostcode": null,
"addressState": null,
"addressStreet1": "Eutaw Street",
"addressStreet2": null,
"addressPostcode": "",
"addressState": "",
"addressStreet1": "",
"addressStreet2": "",
},
"createdAt": "2025-02-16T08:21:51.715Z",
"annualRecurringRevenue": {
"__typename": "Currency",
"amountMicros": null,
"currencyCode": null,
},
"attachments": [],
"caredForPets": [],
"createdAt": "2026-02-27T01:17:29.464Z",
"createdBy": {
"__typename": "Actor",
"context": {},
"name": "Tim Apple",
"context": null,
"name": "Tim A",
"source": "MANUAL",
"workspaceMemberId": "20202020-0687-4c41-b707-ed1bfca972a7",
},
@@ -409,27 +503,62 @@ exports[`useDeleteOneRecord B. Starting from filled cache 3. Should handle optim
"domainName": {
"__typename": "Links",
"primaryLinkLabel": "",
"primaryLinkUrl": "https://linkedin.com",
"primaryLinkUrl": "housecallpro.com",
"secondaryLinks": [],
},
"employees": null,
"id": "20202020-3ec3-4fe3-8997-b76aa0bfa408",
"linkedinLink": {
"employees": 894,
"favorites": [],
"id": "20202020-a000-4485-94de-70c2a98daef2",
"idealCustomerProfile": false,
"introVideo": {
"__typename": "Links",
"primaryLinkLabel": "",
"primaryLinkUrl": "",
"secondaryLinks": [],
},
"name": "Linkedin",
"noteTargets": [],
"opportunities": [
"linkedinLink": {
"__typename": "Links",
"primaryLinkLabel": "",
"primaryLinkUrl": "https://linkedin.com/company/housecallpro",
"secondaryLinks": [],
},
"name": "Housecall Pro",
"noteTargets": [
{},
],
"opportunities": [],
"people": [
{},
{},
],
"position": 1,
"taskTargets": [],
"position": 442,
"previousEmployees": [],
"tagline": "",
"taskTargets": [
{},
],
"timelineActivities": [
{},
{},
{},
{},
{},
],
"updatedAt": "2026-02-27T01:17:29.464Z",
"updatedBy": {
"__typename": "Actor",
"context": null,
"name": "Tim A",
"source": "MANUAL",
"workspaceMemberId": "20202020-0687-4c41-b707-ed1bfca972a7",
},
"visaSponsorship": false,
"workPolicy": [],
"xLink": {
"__typename": "Links",
"primaryLinkLabel": "",
"primaryLinkUrl": "",
"secondaryLinks": [],
},
}
`;
@@ -9,7 +9,7 @@ import { type MockedResponse } from '@apollo/client/testing';
import { InMemoryTestingCacheInstance } from '~/testing/cache/inMemoryTestingCacheInstance';
import { getJestMetadataAndApolloMocksWrapper } from '~/testing/jest/getJestMetadataAndApolloMocksWrapper';
import { getRecordFromRecordNode } from '@/object-record/cache/utils/getRecordFromRecordNode';
import { allMockCompanyRecordsWithRelation } from '~/testing/mock-data/companiesWithRelations';
import { mockedCompanyRecords } from '~/testing/mock-data/generated/data/companies/mock-companies-data';
import { mockedPersonRecords } from '~/testing/mock-data/generated/data/people/mock-people-data';
import { generatedMockObjectMetadataItems } from '~/testing/utils/generatedMockObjectMetadataItems';
import { getMockObjectMetadataItemOrThrow } from '~/testing/utils/getMockObjectMetadataItemOrThrow';
@@ -24,15 +24,19 @@ const flatPersonRecords = mockedPersonRecords.map((record) =>
getRecordFromRecordNode({ recordNode: record }),
);
const flatCompanyRecords = mockedCompanyRecords.map((record) =>
getRecordFromRecordNode({ recordNode: record }),
);
describe('useDeleteOneRecord', () => {
const matchingCompanyId = allMockCompanyRecordsWithRelation[0].id;
const matchingCompanyId = flatCompanyRecords[0].id;
const personRecord = {
...flatPersonRecords[0],
deletedAt: null,
companyId: matchingCompanyId,
company: { ...allMockCompanyRecordsWithRelation[0] },
company: { ...flatCompanyRecords[0] },
};
const relatedCompanyRecord = allMockCompanyRecordsWithRelation[0];
const relatedCompanyRecord = flatCompanyRecords[0];
const personObjectMetadataItem = getMockObjectMetadataItemOrThrow('person');
const companyObjectMetadataItem = getMockObjectMetadataItemOrThrow('company');
const objectMetadataItems = generatedMockObjectMetadataItems;
@@ -199,7 +203,7 @@ describe('useDeleteOneRecord', () => {
initialRecordsInCache: [
{
objectMetadataItem: companyObjectMetadataItem,
records: allMockCompanyRecordsWithRelation,
records: flatCompanyRecords,
},
{
objectMetadataItem: personObjectMetadataItem,
@@ -26,7 +26,7 @@ import { ContextStoreDecorator } from '~/testing/decorators/ContextStoreDecorato
import { IconsProviderDecorator } from '~/testing/decorators/IconsProviderDecorator';
import { ObjectMetadataItemsDecorator } from '~/testing/decorators/ObjectMetadataItemsDecorator';
import { SnackBarDecorator } from '~/testing/decorators/SnackBarDecorator';
import { mockedCoreViewsData } from '~/testing/mock-data/views';
import { mockedCoreViews } from '~/testing/mock-data/generated/metadata/views/mock-views-data';
import { generatedMockObjectMetadataItems } from '~/testing/utils/generatedMockObjectMetadataItems';
const meta: Meta<typeof RecordCalendarMonth> = {
@@ -46,7 +46,9 @@ const meta: Meta<typeof RecordCalendarMonth> = {
const setCoreViews = useSetAtomState(coreViewsState);
const mockCoreView = mockedCoreViewsData[0];
const mockCoreView = mockedCoreViews.find(
(v) => v.name === 'All Companies',
)!;
const setContextStoreCurrentViewId = useSetAtomComponentState(
contextStoreCurrentViewIdComponentState,
@@ -12,9 +12,11 @@ import { RecordTableDecorator } from '~/testing/decorators/RecordTableDecorator'
import { SnackBarDecorator } from '~/testing/decorators/SnackBarDecorator';
import { graphqlMocks } from '~/testing/graphqlMocks';
import { mockedCompanyRecords } from '~/testing/mock-data/generated/data/companies/mock-companies-data';
import { mockedViewsData } from '~/testing/mock-data/views';
import { mockedCoreViews } from '~/testing/mock-data/generated/metadata/views/mock-views-data';
import { sleep } from '~/utils/sleep';
const companyView = mockedCoreViews.find((v) => v.name === 'All Companies')!;
const meta: Meta = {
title: 'Modules/ObjectRecord/RecordTable/RecordTable',
component: RecordTableWithWrappers,
@@ -28,7 +30,7 @@ const meta: Meta = {
ObjectMetadataItemsDecorator,
],
args: {
recordTableId: `companies-${mockedViewsData[0].id}`,
recordTableId: `companies-${companyView.id}`,
viewBarId: 'view-bar',
objectNameSingular: 'company',
},
@@ -1,14 +1,32 @@
import { type CurrentWorkspaceMember } from '@/auth/states/currentWorkspaceMemberState';
import { type ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';
import { getRecordFromRecordNode } from '@/object-record/cache/utils/getRecordFromRecordNode';
import { updateRecordFromCache } from '@/object-record/cache/utils/updateRecordFromCache';
import { generateDepthRecordGqlFieldsFromRecord } from '@/object-record/graphql/record-gql-fields/utils/generateDepthRecordGqlFieldsFromRecord';
import { type FieldActorForInputValue } from '@/object-record/record-field/ui/types/FieldMetadata';
import { computeOptimisticRecordFromInput } from '@/object-record/utils/computeOptimisticRecordFromInput';
import { type WorkspaceMember } from '@/workspace-member/types/WorkspaceMember';
import { InMemoryCache } from '@apollo/client';
import { mockCurrentWorkspaceMembers } from '~/testing/mock-data/workspace-members';
import { mockedWorkspaceMemberRecords } from '~/testing/mock-data/generated/data/workspaceMembers/mock-workspaceMembers-data';
import { generatedMockObjectMetadataItems } from '~/testing/utils/generatedMockObjectMetadataItems';
import { getMockFieldMetadataItemOrThrow } from '~/testing/utils/getMockFieldMetadataItemOrThrow';
import { getMockObjectMetadataItemOrThrow } from '~/testing/utils/getMockObjectMetadataItemOrThrow';
const mockCurrentWorkspaceMembers: CurrentWorkspaceMember[] =
mockedWorkspaceMemberRecords.map((record) => {
const workspaceMember = getRecordFromRecordNode<WorkspaceMember>({
recordNode: record,
});
const {
createdAt: _createdAt,
updatedAt: _updatedAt,
userId: _userId,
__typename: _typename,
...rest
} = workspaceMember;
return rest as CurrentWorkspaceMember;
});
describe('computeOptimisticRecordFromInput', () => {
const currentWorkspaceMember = mockCurrentWorkspaceMembers[0];
const currentWorkspaceMemberFullname = `${currentWorkspaceMember.name.firstName} ${currentWorkspaceMember.name.lastName}`;
@@ -25,7 +25,7 @@ import { ContextStoreDecorator } from '~/testing/decorators/ContextStoreDecorato
import { IconsProviderDecorator } from '~/testing/decorators/IconsProviderDecorator';
import { ObjectMetadataItemsDecorator } from '~/testing/decorators/ObjectMetadataItemsDecorator';
import { SnackBarDecorator } from '~/testing/decorators/SnackBarDecorator';
import { mockedCoreViewsData } from '~/testing/mock-data/views';
import { mockedCoreViews } from '~/testing/mock-data/generated/metadata/views/mock-views-data';
import { generatedMockObjectMetadataItems } from '~/testing/utils/generatedMockObjectMetadataItems';
const meta: Meta<typeof ViewBarFilterDropdown> = {
@@ -45,7 +45,9 @@ const meta: Meta<typeof ViewBarFilterDropdown> = {
const setCoreViews = useSetAtomState(coreViewsState);
const mockCoreView = mockedCoreViewsData[0];
const mockCoreView = mockedCoreViews.find(
(v) => v.name === 'All Companies',
)!;
const setContextStoreCurrentViewId = useSetAtomComponentState(
contextStoreCurrentViewIdComponentState,
@@ -16,10 +16,7 @@ import { act } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { type CoreViewFilterGroup } from '~/generated-metadata/graphql';
import { getJestMetadataAndApolloMocksAndActionMenuWrapper } from '~/testing/jest/getJestMetadataAndApolloMocksAndActionMenuWrapper';
import {
mockedCoreViewsData,
mockedViewsData,
} from '~/testing/mock-data/views';
import { mockedCoreViews } from '~/testing/mock-data/generated/metadata/views/mock-views-data';
import { generatedMockObjectMetadataItems } from '~/testing/utils/generatedMockObjectMetadataItems';
const mockObjectMetadataItemNameSingular = 'company';
@@ -48,8 +45,10 @@ describe('useApplyCurrentViewFilterGroupsToCurrentRecordFilterGroups', () => {
positionInViewFilterGroup: 0,
};
const allCompaniesView = mockedViewsData[0];
const allCompaniesCoreView = mockedCoreViewsData[0];
const allCompaniesCoreView = mockedCoreViews.find(
(v) => v.name === 'All Companies',
)!;
const allCompaniesView = allCompaniesCoreView as unknown as View;
const mockCoreViewFilterGroup: Omit<CoreViewFilterGroup, 'workspaceId'> = {
__typename: 'CoreViewFilterGroup',
@@ -17,10 +17,7 @@ import {
ViewFilterOperand as CoreViewFilterOperand,
} from '~/generated-metadata/graphql';
import { getJestMetadataAndApolloMocksAndActionMenuWrapper } from '~/testing/jest/getJestMetadataAndApolloMocksAndActionMenuWrapper';
import {
mockedCoreViewsData,
mockedViewsData,
} from '~/testing/mock-data/views';
import { mockedCoreViews } from '~/testing/mock-data/generated/metadata/views/mock-views-data';
import { generatedMockObjectMetadataItems } from '~/testing/utils/generatedMockObjectMetadataItems';
import { useApplyCurrentViewFiltersToCurrentRecordFilters } from '@/views/hooks/useApplyCurrentViewFiltersToCurrentRecordFilters';
@@ -41,8 +38,10 @@ describe('useApplyCurrentViewFiltersToCurrentRecordFilters', () => {
resetJotaiStore();
});
const allCompaniesView = mockedViewsData[0];
const allCompaniesCoreView = mockedCoreViewsData[0];
const allCompaniesCoreView = mockedCoreViews.find(
(v) => v.name === 'All Companies',
)!;
const allCompaniesView = allCompaniesCoreView as unknown as View;
const mockFieldMetadataItem = mockObjectMetadataItem.fields[0];
@@ -13,10 +13,7 @@ import { type View } from '@/views/types/View';
import { isDefined } from 'twenty-shared/utils';
import { ViewSortDirection } from '~/generated-metadata/graphql';
import { getJestMetadataAndApolloMocksAndActionMenuWrapper } from '~/testing/jest/getJestMetadataAndApolloMocksAndActionMenuWrapper';
import {
mockedCoreViewsData,
mockedViewsData,
} from '~/testing/mock-data/views';
import { mockedCoreViews } from '~/testing/mock-data/generated/metadata/views/mock-views-data';
import { generatedMockObjectMetadataItems } from '~/testing/utils/generatedMockObjectMetadataItems';
import { useApplyCurrentViewSortsToCurrentRecordSorts } from '@/views/hooks/useApplyCurrentViewSortsToCurrentRecordSorts';
@@ -48,8 +45,10 @@ describe('useApplyCurrentViewSortsToCurrentRecordSorts', () => {
viewId: 'view-1',
};
const allCompaniesView = mockedViewsData[0];
const allCompaniesCoreView = mockedCoreViewsData[0];
const allCompaniesCoreView = mockedCoreViews.find(
(v) => v.name === 'All Companies',
)!;
const allCompaniesView = allCompaniesCoreView as unknown as View;
const mockCoreViewSort: CoreViewSortEssential = {
id: 'sort-1',
@@ -13,10 +13,7 @@ import { WorkflowStepActionDrawerDecorator } from '~/testing/decorators/Workflow
import { WorkflowStepDecorator } from '~/testing/decorators/WorkflowStepDecorator';
import { WorkspaceDecorator } from '~/testing/decorators/WorkspaceDecorator';
import { graphqlMocks } from '~/testing/graphqlMocks';
import {
getMockedConnectedAccount,
mockedConnectedAccounts,
} from '~/testing/mock-data/connected-accounts';
import { mockedConnectedAccountRecords } from '~/testing/mock-data/generated/data/connectedAccounts/mock-connectedAccounts-data';
import { getWorkflowNodeIdMock } from '~/testing/mock-data/workflow';
const DEFAULT_SEND_EMAIL_ACTION: WorkflowSendEmailAction = {
@@ -55,7 +52,8 @@ const CONFIGURED_SEND_EMAIL_ACTION: WorkflowSendEmailAction = {
valid: true,
settings: {
input: {
connectedAccountId: mockedConnectedAccounts[0].accountOwnerId,
connectedAccountId: mockedConnectedAccountRecords[0]
.accountOwnerId as string,
recipients: {
to: 'test@twenty.com',
cc: '',
@@ -116,7 +114,18 @@ const meta: Meta<typeof WorkflowEditActionEmailBase> = {
graphql.query('FindManyConnectedAccounts', () => {
return HttpResponse.json({
data: {
connectedAccounts: getMockedConnectedAccount(),
connectedAccounts: {
edges: mockedConnectedAccountRecords.map((record) => ({
node: record,
cursor: record.id,
})),
pageInfo: {
hasNextPage: false,
hasPreviousPage: false,
startCursor: null,
endCursor: null,
},
},
},
});
}),
@@ -171,7 +180,7 @@ export const Configured: Story = {
expect(await canvas.findByText('Account')).toBeVisible();
expect(await canvas.findByText('To')).toBeVisible();
const emailInput = await canvas.findByText('tim@twenty.com');
const emailInput = await canvas.findByText('test@twenty.com');
expect(emailInput).toBeVisible();
const subjectInput = await canvas.findByText('Welcome to Twenty!');
@@ -9,8 +9,10 @@ import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomState
import { PreComputedChipGeneratorsProvider } from '@/object-metadata/components/PreComputedChipGeneratorsProvider';
import { useLoadMockedObjectMetadataItems } from '@/object-metadata/hooks/useLoadMockedObjectMetadataItems';
import { objectMetadataItemsState } from '@/object-metadata/states/objectMetadataItemsState';
import { getRecordFromRecordNode } from '@/object-record/cache/utils/getRecordFromRecordNode';
import { type WorkspaceMember } from '@/workspace-member/types/WorkspaceMember';
import { mockedUserData } from '~/testing/mock-data/users';
import { mockWorkspaceMembers } from '~/testing/mock-data/workspace-members';
import { mockedWorkspaceMemberRecords } from '~/testing/mock-data/generated/data/workspaceMembers/mock-workspaceMembers-data';
export const ObjectMetadataItemsDecorator: Decorator = (Story) => {
const objectMetadataItems = useAtomStateValue(objectMetadataItemsState);
@@ -23,7 +25,11 @@ export const ObjectMetadataItemsDecorator: Decorator = (Story) => {
const { loadMockedObjectMetadataItems } = useLoadMockedObjectMetadataItems();
useEffect(() => {
setCurrentWorkspaceMember(mockWorkspaceMembers[0]);
setCurrentWorkspaceMember(
getRecordFromRecordNode<WorkspaceMember>({
recordNode: mockedWorkspaceMemberRecords[0],
}),
);
setCurrentUser(mockedUserData);
setCurrentUserWorkspace(mockedUserData.currentUserWorkspace);
loadMockedObjectMetadataItems();
@@ -37,8 +37,9 @@ import { mapViewFieldToRecordField } from '@/views/utils/mapViewFieldToRecordFie
import { useEffect, useMemo } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { mockedCompanyRecords } from '~/testing/mock-data/generated/data/companies/mock-companies-data';
import { mockedViewFieldsData } from '~/testing/mock-data/view-fields';
import { mockedViewsData } from '~/testing/mock-data/views';
import { mockedCoreViews } from '~/testing/mock-data/generated/metadata/views/mock-views-data';
const companyView = mockedCoreViews.find((v) => v.name === 'All Companies')!;
const InternalTableStateLoaderEffect = ({
objectMetadataItem,
@@ -64,10 +65,8 @@ const InternalTableStateLoaderEffect = ({
const view = useMemo(() => {
return {
...mockedViewsData[0],
viewFields: mockedViewFieldsData.filter(
(viewField) => viewField.viewId === mockedViewsData[0].id,
),
...companyView,
viewFields: companyView.viewFields,
} as unknown as View;
}, []);
@@ -221,7 +220,7 @@ export const RecordTableDecorator: Decorator = (Story, context) => {
const recordIndexId = getRecordIndexIdFromObjectNamePluralAndViewId(
objectMetadataItem.namePlural,
mockedViewsData[0].id,
companyView.id,
);
return (
+44 -143
View File
@@ -6,16 +6,15 @@ import { TRACK_ANALYTICS } from '@/analytics/graphql/queries/track';
import { FIND_MANY_OBJECT_METADATA_ITEMS } from '@/object-metadata/graphql/queries';
import { GET_CURRENT_USER } from '@/users/graphql/queries/getCurrentUser';
import { REACT_APP_SERVER_BASE_URL } from '~/config';
import { mockedApiKeys } from '~/testing/mock-data/api-keys';
import { mockedClientConfig } from '~/testing/mock-data/config';
import { mockedFavoritesData } from '~/testing/mock-data/favorite';
import { mockedFavoriteRecords } from '~/testing/mock-data/generated/data/favorites/mock-favorites-data';
import { mockedFavoriteFoldersData } from '~/testing/mock-data/favorite-folders';
import { mockedNoteRecords } from '~/testing/mock-data/generated/data/notes/mock-notes-data';
import { mockedPersonRecords } from '~/testing/mock-data/generated/data/people/mock-people-data';
import { mockedPublicWorkspaceDataBySubdomain } from '~/testing/mock-data/publicWorkspaceDataBySubdomain';
import { mockedUserData } from '~/testing/mock-data/users';
import { mockedViewsData } from '~/testing/mock-data/views';
import { mockWorkspaceMembers } from '~/testing/mock-data/workspace-members';
import { mockedCoreViews } from '~/testing/mock-data/generated/metadata/views/mock-views-data';
import { mockedWorkspaceMemberRecords } from '~/testing/mock-data/generated/data/workspaceMembers/mock-workspaceMembers-data';
import { GET_PUBLIC_WORKSPACE_DATA_BY_DOMAIN } from '@/auth/graphql/queries/getPublicWorkspaceDataByDomain';
import { LIST_PLANS } from '@/billing/graphql/queries/listPlans';
@@ -38,7 +37,7 @@ import { getConnectionTypename } from '@/object-record/cache/utils/getConnection
import { getEdgeTypename } from '@/object-record/cache/utils/getEdgeTypename';
import { getEmptyPageInfo } from '@/object-record/cache/utils/getEmptyPageInfo';
import { getRecordFromRecordNode } from '@/object-record/cache/utils/getRecordFromRecordNode';
import { mockedViewFieldsData } from './mock-data/view-fields';
import { mockedApiKeys } from '~/testing/mock-data/generated/metadata/api-keys/mock-api-keys-data';
const peopleMock = [...mockedPersonRecords];
const companiesMock = [...mockedCompanyRecords];
@@ -289,34 +288,29 @@ export const graphqlMocks = {
const objectMetadataId = variables.filter?.objectMetadataId?.eq;
const viewType = variables.filter?.type?.eq;
const filtered = mockedCoreViews.filter(
(view) =>
(isDefined(objectMetadataId)
? view?.objectMetadataId === objectMetadataId
: true) && (isDefined(viewType) ? view?.type === viewType : true),
);
return HttpResponse.json({
data: {
views: {
edges: mockedViewsData
.filter(
(view) =>
(isDefined(objectMetadataId)
? view?.objectMetadataId === objectMetadataId
: true) &&
(isDefined(viewType) ? view?.type === viewType : true),
)
.map((view) => ({
node: {
...view,
viewFields: {
edges: mockedViewFieldsData
.filter((viewField) => viewField.viewId === view.id)
.map((viewField) => ({
node: viewField,
cursor: null,
})),
totalCount: mockedViewFieldsData.filter(
(viewField) => viewField.viewId === view.id,
).length,
},
edges: filtered.map((view) => ({
node: {
...view,
viewFields: {
edges: view.viewFields.map((viewField) => ({
node: viewField,
cursor: null,
})),
totalCount: view.viewFields.length,
},
cursor: null,
})),
},
cursor: null,
})),
pageInfo: {
hasNextPage: false,
hasPreviousPage: false,
@@ -330,61 +324,26 @@ export const graphqlMocks = {
graphql.query('SearchWorkspaceMembers', () => {
return HttpResponse.json({
data: {
searchWorkspaceMembers: {
edges: mockWorkspaceMembers.map((member) => ({
node: {
...member,
messageParticipants: {
edges: [],
__typename: 'MessageParticipantConnection',
},
authoredAttachments: {
edges: [],
__typename: 'AttachmentConnection',
},
authoredComments: {
edges: [],
__typename: 'CommentConnection',
},
accountOwnerForCompanies: {
edges: [],
__typename: 'CompanyConnection',
},
authoredActivities: {
edges: [],
__typename: 'ActivityConnection',
},
favorites: {
edges: [],
__typename: 'FavoriteConnection',
},
connectedAccounts: {
edges: [],
__typename: 'ConnectedAccountConnection',
},
assignedActivities: {
edges: [],
__typename: 'ActivityConnection',
},
},
cursor: null,
})),
},
searchWorkspaceMembers: wrapRecordsAsConnection(
'workspaceMember',
mockedWorkspaceMemberRecords as Record<string, unknown>[],
),
},
});
}),
graphql.query('FindManyViewFields', ({ variables }) => {
const viewId = variables.filter.view.eq;
const matchingView = mockedCoreViews.find((view) => view.id === viewId);
const viewFields = matchingView?.viewFields ?? [];
return HttpResponse.json({
data: {
viewFields: {
edges: mockedViewFieldsData
.filter((viewField) => viewField.viewId === viewId)
.map((viewField) => ({
node: viewField,
cursor: null,
})),
edges: viewFields.map((viewField) => ({
node: viewField,
cursor: null,
})),
pageInfo: {
hasNextPage: false,
hasPreviousPage: false,
@@ -472,16 +431,10 @@ export const graphqlMocks = {
return HttpResponse.json({
data: {
favorites: {
edges: mockedFavoritesData.map((favorite) => ({
node: favorite,
cursor: null,
})),
pageInfo: {
hasNextPage: false,
hasPreviousPage: false,
startCursor: null,
endCursor: null,
},
...wrapRecordsAsConnection(
'favorite',
mockedFavoriteRecords as Record<string, unknown>[],
),
},
},
});
@@ -504,52 +457,10 @@ export const graphqlMocks = {
graphql.query('FindManyWorkspaceMembers', () => {
return HttpResponse.json({
data: {
workspaceMembers: {
edges: mockWorkspaceMembers.map((member) => ({
node: {
...member,
messageParticipants: {
edges: [],
__typename: 'MessageParticipantConnection',
},
authoredAttachments: {
edges: [],
__typename: 'AttachmentConnection',
},
authoredComments: {
edges: [],
__typename: 'CommentConnection',
},
accountOwnerForCompanies: {
edges: [],
__typename: 'CompanyConnection',
},
authoredActivities: {
edges: [],
__typename: 'ActivityConnection',
},
favorites: {
edges: [],
__typename: 'FavoriteConnection',
},
connectedAccounts: {
edges: [],
__typename: 'ConnectedAccountConnection',
},
assignedActivities: {
edges: [],
__typename: 'ActivityConnection',
},
},
cursor: null,
})),
pageInfo: {
hasNextPage: false,
hasPreviousPage: false,
startCursor: null,
endCursor: null,
},
},
workspaceMembers: wrapRecordsAsConnection(
'workspaceMember',
mockedWorkspaceMemberRecords as Record<string, unknown>[],
),
},
});
}),
@@ -612,11 +523,7 @@ export const graphqlMocks = {
metadataGraphql.query('GetApiKeys', () => {
return HttpResponse.json({
data: {
apiKeys: mockedApiKeys.map((apiKey) => ({
__typename: 'ApiKey',
...apiKey,
revokedAt: null,
})),
apiKeys: mockedApiKeys,
},
});
}),
@@ -626,13 +533,7 @@ export const graphqlMocks = {
return HttpResponse.json({
data: {
apiKey: apiKey
? {
__typename: 'ApiKey',
...apiKey,
revokedAt: null,
}
: null,
apiKey: apiKey ?? null,
},
});
}),
@@ -1,8 +0,0 @@
import { type ConnectedAccount } from '@/accounts/types/ConnectedAccount';
export const mockedConnectedAccounts: Pick<
ConnectedAccount,
'id' | 'handle'
>[] = [
{ id: '876ee608-d1e4-402d-9970-b3ca49b85cb9', handle: 'john.doe@twenty.com' },
];
@@ -1,55 +0,0 @@
import { type ApiKey } from '~/generated-metadata/graphql';
type MockedApiKey = Pick<
ApiKey,
'id' | 'name' | 'createdAt' | 'updatedAt' | 'expiresAt'
> & {
role?: {
__typename: 'Role';
id: string;
label: string;
icon: string | null;
} | null;
};
export const mockedApiKeys: Array<MockedApiKey> = [
{
id: 'f7c6d736-8fcd-4e9c-ab99-28f6a9031570',
name: 'Zapier Integration',
createdAt: '2023-04-26T10:12:42.33625+00:00',
updatedAt: '2023-04-26T10:23:42.33625+00:00',
expiresAt: '2100-11-06T23:59:59.825Z',
role: {
__typename: 'Role',
id: '1',
label: 'Admin',
icon: 'IconSettings',
},
},
{
id: 'f7c6d736-8fcd-4e9c-ab99-28f6a9031571',
name: 'Gmail Integration',
createdAt: '2023-04-26T10:12:42.33625+00:00',
updatedAt: '2023-04-26T10:23:42.33625+00:00',
expiresAt: '2100-11-06T23:59:59.825Z',
role: {
__typename: 'Role',
id: '2',
label: 'Guest',
icon: 'IconUser',
},
},
{
id: 'f7c6d736-8fcd-4e9c-ab99-28f6a9031572',
name: 'Github Integration',
createdAt: '2023-04-26T10:12:42.33625+00:00',
updatedAt: '2023-04-26T10:23:42.33625+00:00',
expiresAt: '2022-11-06T23:59:59.825Z',
role: {
__typename: 'Role',
id: '1',
label: 'Admin',
icon: 'IconSettings',
},
},
];
@@ -1,88 +0,0 @@
import { addDays, subHours, subMonths } from 'date-fns';
import { type CalendarEvent } from '@/activities/calendar/types/CalendarEvent';
import { CalendarChannelVisibility } from '~/generated/graphql';
export const mockedCalendarEvents: CalendarEvent[] = [
{
externalCreatedAt: new Date().toISOString(),
endsAt: addDays(new Date().setHours(11, 30), 1).toISOString(),
id: '9a6b35f1-6078-415b-9540-f62671bb81d0',
isFullDay: false,
startsAt: addDays(new Date().setHours(10, 0), 1).toISOString(),
visibility: CalendarChannelVisibility.METADATA,
calendarEventParticipants: [
{
id: '1',
handle: 'jdoe',
isOrganizer: false,
responseStatus: 'ACCEPTED',
displayName: 'John Doe',
},
{
id: '2',
handle: 'jadoe',
isOrganizer: false,
responseStatus: 'ACCEPTED',
displayName: 'Jane Doe',
},
{
id: '3',
handle: 'tapple',
isOrganizer: false,
responseStatus: 'ACCEPTED',
displayName: 'Tim Apple',
},
],
__typename: 'CalendarEvent',
},
{
externalCreatedAt: subHours(new Date(), 2).toISOString(),
id: '19b32878-a950-4968-9e3b-ce5da514ea41',
endsAt: new Date(new Date().setHours(18, 40)).toISOString(),
isCanceled: true,
isFullDay: false,
startsAt: new Date(new Date().setHours(18, 0)).toISOString(),
title: 'Bug solving',
visibility: CalendarChannelVisibility.SHARE_EVERYTHING,
__typename: 'CalendarEvent',
},
{
externalCreatedAt: subHours(new Date(), 2).toISOString(),
id: '6ad1cbcb-2ac4-409e-aff0-48165556fc0c',
endsAt: new Date(new Date().setHours(16, 30)).toISOString(),
isFullDay: false,
startsAt: new Date(new Date().setHours(15, 15)).toISOString(),
title: 'Onboarding Follow-Up Call',
visibility: CalendarChannelVisibility.SHARE_EVERYTHING,
__typename: 'CalendarEvent',
},
{
externalCreatedAt: subHours(new Date(), 2).toISOString(),
id: '52cc83e3-f3dc-4c25-8a7d-5ff857612142',
endsAt: new Date(new Date().setHours(10, 30)).toISOString(),
isFullDay: false,
startsAt: new Date(new Date().setHours(10, 0)).toISOString(),
title: 'Onboarding Call',
visibility: CalendarChannelVisibility.SHARE_EVERYTHING,
__typename: 'CalendarEvent',
},
{
externalCreatedAt: subHours(new Date(), 2).toISOString(),
id: '5a792d11-259a-4099-af51-59eb85e15d83',
isFullDay: true,
startsAt: subMonths(new Date().setHours(8, 0), 1).toISOString(),
visibility: CalendarChannelVisibility.METADATA,
__typename: 'CalendarEvent',
},
{
externalCreatedAt: subHours(new Date(), 2).toISOString(),
id: '89e2a1c7-3d3f-4e79-a492-aa5de3785fc5',
endsAt: subMonths(new Date().setHours(14, 30), 3).toISOString(),
isFullDay: false,
startsAt: subMonths(new Date().setHours(14, 0), 3).toISOString(),
title: 'Alan x Garry',
visibility: CalendarChannelVisibility.SHARE_EVERYTHING,
__typename: 'CalendarEvent',
},
];
File diff suppressed because it is too large Load Diff
@@ -1,28 +0,0 @@
export const mockedConnectedAccounts = [
{
id: '8619ace5-1814-4e56-8439-553eab32a5cc',
handle: 'tim@twenty.com',
provider: 'gmail',
scopes: ['https://www.googleapis.com/auth/gmail.readonly'],
accountOwnerId: '56561b12-cbad-49db-a6bc-00e6b153ec80',
},
];
export const getMockedConnectedAccount = () => {
return {
edges: [
{
node: {
...mockedConnectedAccounts[0],
},
cursor: null,
},
],
pageInfo: {
hasNextPage: false,
hasPreviousPage: false,
startCursor: null,
endCursor: null,
},
};
};
@@ -1,138 +0,0 @@
import { mockedCompanyRecords } from '~/testing/mock-data/generated/data/companies/mock-companies-data';
import { mockedWorkspaceMemberData } from '~/testing/mock-data/users';
import { mockedViewsData } from '~/testing/mock-data/views';
export const mockedFavoritesData = [
{
id: '20202020-dede-koko-873b-de4264d89025',
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
deletedAt: null,
position: 0,
recordId: null,
workflowId: null,
workflow: null,
workflowRunId: null,
workflowRun: null,
workflowVersionId: null,
workflowVersion: null,
forWorkspaceMemberId: mockedWorkspaceMemberData.id,
forWorkspaceMember: mockedWorkspaceMemberData,
companyId: mockedCompanyRecords[0].id,
company: mockedCompanyRecords[0],
viewId: null,
view: null,
taskId: null,
task: null,
petId: null,
pet: null,
surveyResultId: null,
surveyResult: null,
personId: null,
person: null,
opportunityId: null,
opportunity: null,
noteId: null,
note: null,
__typename: 'Favorite',
},
{
id: '20202020-dede-koko-873b-de4264d89026',
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
deletedAt: null,
position: 1,
recordId: null,
workflowId: null,
workflow: null,
workflowRunId: null,
workflowRun: null,
workflowVersionId: null,
workflowVersion: null,
forWorkspaceMemberId: null,
forWorkspaceMember: null,
companyId: null,
company: null,
viewId: mockedViewsData[0].id,
view: mockedViewsData[0],
taskId: null,
task: null,
petId: null,
pet: null,
surveyResultId: null,
surveyResult: null,
personId: null,
person: null,
opportunityId: null,
opportunity: null,
noteId: null,
note: null,
__typename: 'Favorite',
},
{
id: '20202020-dede-koko-873b-de4264d89026',
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
deletedAt: null,
position: 1,
recordId: null,
workflowId: null,
workflow: null,
workflowRunId: null,
workflowRun: null,
workflowVersionId: null,
workflowVersion: null,
forWorkspaceMemberId: null,
forWorkspaceMember: null,
companyId: null,
company: null,
viewId: mockedViewsData[1].id,
view: mockedViewsData[1],
taskId: null,
task: null,
petId: null,
pet: null,
surveyResultId: null,
surveyResult: null,
personId: null,
person: null,
opportunityId: null,
opportunity: null,
noteId: null,
note: null,
__typename: 'Favorite',
},
{
id: '20202020-dede-koko-873b-de4264d89026',
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
deletedAt: null,
position: 1,
recordId: null,
workflowId: null,
workflow: null,
workflowRunId: null,
workflowRun: null,
workflowVersionId: null,
workflowVersion: null,
forWorkspaceMemberId: null,
forWorkspaceMember: null,
companyId: null,
company: null,
viewId: mockedViewsData[1].id,
view: mockedViewsData[1],
taskId: null,
task: null,
petId: null,
pet: null,
surveyResultId: null,
surveyResult: null,
personId: null,
person: null,
opportunityId: null,
opportunity: null,
noteId: null,
note: null,
__typename: 'Favorite',
},
];
@@ -0,0 +1,762 @@
/* eslint-disable */
// @ts-nocheck
import { type ObjectRecord } from '@/object-record/types/ObjectRecord';
// This file was automatically generated — do not edit manually.
// prettier-ignore
export const mockedCalendarEventRecords: ObjectRecord[] =
[
{
"__typename": "CalendarEvent",
"calendarChannelEventAssociations": {
"__typename": "CalendarChannelEventAssociationConnection",
"edges": [
{
"__typename": "CalendarChannelEventAssociationEdge",
"node": {
"__typename": "CalendarChannelEventAssociation",
"id": "20202020-0001-4e7c-8001-123456789abc"
}
}
]
},
"calendarEventParticipants": {
"__typename": "CalendarEventParticipantConnection",
"edges": [
{
"__typename": "CalendarEventParticipantEdge",
"node": {
"__typename": "CalendarEventParticipant",
"handle": "david.rodriguez@company.com",
"id": "20202020-0001-4e7c-8001-123456789def"
}
},
{
"__typename": "CalendarEventParticipantEdge",
"node": {
"__typename": "CalendarEventParticipant",
"handle": "member@company.com",
"id": "20202020-0002-4e7c-8001-123456789def"
}
},
{
"__typename": "CalendarEventParticipantEdge",
"node": {
"__typename": "CalendarEventParticipant",
"handle": "person570@company.com",
"id": "20202020-0003-4e7c-8001-123456789def"
}
},
{
"__typename": "CalendarEventParticipantEdge",
"node": {
"__typename": "CalendarEventParticipant",
"handle": "emily.davis@company.com",
"id": "20202020-0004-4e7c-8001-123456789def"
}
}
]
},
"conferenceLink": {
"__typename": "Links",
"primaryLinkUrl": "https://teams.com/j/7097393112",
"primaryLinkLabel": "https://teams.com/j/7097393112",
"secondaryLinks": []
},
"conferenceSolution": "Teams",
"createdAt": "2026-02-27T01:17:29.464Z",
"createdBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"deletedAt": null,
"description": "FIELD_RESTRICTED_ADDITIONAL_PERMISSIONS_REQUIRED",
"endsAt": "2025-10-23T12:00:00.000Z",
"externalCreatedAt": "2025-10-23T07:10:38.067Z",
"externalUpdatedAt": "2025-10-22T11:34:06.086Z",
"iCalUid": "event1@calendar.twentycrm.com",
"id": "20202020-0001-4e7c-8001-123456789cde",
"isCanceled": false,
"isFullDay": false,
"location": "Conference Room A",
"position": 0,
"startsAt": "2025-10-23T11:30:00.000Z",
"title": "FIELD_RESTRICTED_ADDITIONAL_PERMISSIONS_REQUIRED",
"updatedAt": "2026-02-27T01:17:29.464Z",
"updatedBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
}
},
{
"__typename": "CalendarEvent",
"calendarChannelEventAssociations": {
"__typename": "CalendarChannelEventAssociationConnection",
"edges": [
{
"__typename": "CalendarChannelEventAssociationEdge",
"node": {
"__typename": "CalendarChannelEventAssociation",
"id": "20202020-0002-4e7c-8001-123456789abc"
}
}
]
},
"calendarEventParticipants": {
"__typename": "CalendarEventParticipantConnection",
"edges": [
{
"__typename": "CalendarEventParticipantEdge",
"node": {
"__typename": "CalendarEventParticipant",
"handle": "alex.johnson@company.com",
"id": "20202020-0005-4e7c-8001-123456789def"
}
},
{
"__typename": "CalendarEventParticipantEdge",
"node": {
"__typename": "CalendarEventParticipant",
"handle": "person254@company.com",
"id": "20202020-0006-4e7c-8001-123456789def"
}
}
]
},
"conferenceLink": {
"__typename": "Links",
"primaryLinkUrl": "https://zoom.com/j/8113375940",
"primaryLinkLabel": "https://zoom.com/j/8113375940",
"secondaryLinks": []
},
"conferenceSolution": "Zoom",
"createdAt": "2026-02-27T01:17:29.464Z",
"createdBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"deletedAt": null,
"description": "FIELD_RESTRICTED_ADDITIONAL_PERMISSIONS_REQUIRED",
"endsAt": "2025-12-06T09:45:00.000Z",
"externalCreatedAt": "2025-12-02T22:30:49.748Z",
"externalUpdatedAt": "2025-12-05T15:44:06.870Z",
"iCalUid": "event2@calendar.twentycrm.com",
"id": "20202020-0002-4e7c-8001-123456789cde",
"isCanceled": false,
"isFullDay": false,
"location": "Zoom",
"position": 0,
"startsAt": "2025-12-06T08:45:00.000Z",
"title": "FIELD_RESTRICTED_ADDITIONAL_PERMISSIONS_REQUIRED",
"updatedAt": "2026-02-27T01:17:29.464Z",
"updatedBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
}
},
{
"__typename": "CalendarEvent",
"calendarChannelEventAssociations": {
"__typename": "CalendarChannelEventAssociationConnection",
"edges": [
{
"__typename": "CalendarChannelEventAssociationEdge",
"node": {
"__typename": "CalendarChannelEventAssociation",
"id": "20202020-0003-4e7c-8001-123456789abc"
}
}
]
},
"calendarEventParticipants": {
"__typename": "CalendarEventParticipantConnection",
"edges": [
{
"__typename": "CalendarEventParticipantEdge",
"node": {
"__typename": "CalendarEventParticipant",
"handle": "person913@company.com",
"id": "20202020-0007-4e7c-8001-123456789def"
}
},
{
"__typename": "CalendarEventParticipantEdge",
"node": {
"__typename": "CalendarEventParticipant",
"handle": "person973@company.com",
"id": "20202020-0008-4e7c-8001-123456789def"
}
}
]
},
"conferenceLink": {
"__typename": "Links",
"primaryLinkUrl": "https://googlemeet.com/j/2800305522",
"primaryLinkLabel": "https://googlemeet.com/j/2800305522",
"secondaryLinks": []
},
"conferenceSolution": "Google Meet",
"createdAt": "2026-02-27T01:17:29.464Z",
"createdBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"deletedAt": null,
"description": "Strategic planning session for upcoming project milestones and deliverables.",
"endsAt": "2026-03-23T18:00:00.000Z",
"externalCreatedAt": "2026-03-17T21:03:04.293Z",
"externalUpdatedAt": "2026-03-23T13:11:32.796Z",
"iCalUid": "event3@calendar.twentycrm.com",
"id": "20202020-0003-4e7c-8001-123456789cde",
"isCanceled": false,
"isFullDay": false,
"location": "Boardroom",
"position": 0,
"startsAt": "2026-03-23T16:30:00.000Z",
"title": "Project Planning Session",
"updatedAt": "2026-02-27T01:17:29.464Z",
"updatedBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
}
},
{
"__typename": "CalendarEvent",
"calendarChannelEventAssociations": {
"__typename": "CalendarChannelEventAssociationConnection",
"edges": [
{
"__typename": "CalendarChannelEventAssociationEdge",
"node": {
"__typename": "CalendarChannelEventAssociation",
"id": "20202020-0004-4e7c-8001-123456789abc"
}
}
]
},
"calendarEventParticipants": {
"__typename": "CalendarEventParticipantConnection",
"edges": [
{
"__typename": "CalendarEventParticipantEdge",
"node": {
"__typename": "CalendarEventParticipant",
"handle": "member@company.com",
"id": "20202020-0009-4e7c-8001-123456789def"
}
},
{
"__typename": "CalendarEventParticipantEdge",
"node": {
"__typename": "CalendarEventParticipant",
"handle": "james.wilson@company.com",
"id": "20202020-000a-4e7c-8001-123456789def"
}
},
{
"__typename": "CalendarEventParticipantEdge",
"node": {
"__typename": "CalendarEventParticipant",
"handle": "member@company.com",
"id": "20202020-000b-4e7c-8001-123456789def"
}
}
]
},
"conferenceLink": {
"__typename": "Links",
"primaryLinkUrl": "https://googlemeet.com/j/5896936049",
"primaryLinkLabel": "https://googlemeet.com/j/5896936049",
"secondaryLinks": []
},
"conferenceSolution": "Google Meet",
"createdAt": "2026-02-27T01:17:29.464Z",
"createdBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"deletedAt": null,
"description": "Regular one-on-one check-in to discuss performance and career development.",
"endsAt": "2026-07-18T15:45:00.000Z",
"externalCreatedAt": "2026-07-12T01:15:12.967Z",
"externalUpdatedAt": "2026-07-17T19:37:32.025Z",
"iCalUid": "event4@calendar.twentycrm.com",
"id": "20202020-0004-4e7c-8001-123456789cde",
"isCanceled": false,
"isFullDay": false,
"location": "Zoom",
"position": 0,
"startsAt": "2026-07-18T15:00:00.000Z",
"title": "One-on-One Meeting",
"updatedAt": "2026-02-27T01:17:29.464Z",
"updatedBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
}
},
{
"__typename": "CalendarEvent",
"calendarChannelEventAssociations": {
"__typename": "CalendarChannelEventAssociationConnection",
"edges": [
{
"__typename": "CalendarChannelEventAssociationEdge",
"node": {
"__typename": "CalendarChannelEventAssociation",
"id": "20202020-0005-4e7c-8001-123456789abc"
}
}
]
},
"calendarEventParticipants": {
"__typename": "CalendarEventParticipantConnection",
"edges": [
{
"__typename": "CalendarEventParticipantEdge",
"node": {
"__typename": "CalendarEventParticipant",
"handle": "james.wilson@company.com",
"id": "20202020-000c-4e7c-8001-123456789def"
}
},
{
"__typename": "CalendarEventParticipantEdge",
"node": {
"__typename": "CalendarEventParticipant",
"handle": "person876@company.com",
"id": "20202020-000d-4e7c-8001-123456789def"
}
}
]
},
"conferenceLink": {
"__typename": "Links",
"primaryLinkUrl": "https://googlemeet.com/j/3812632404",
"primaryLinkLabel": "https://googlemeet.com/j/3812632404",
"secondaryLinks": []
},
"conferenceSolution": "Google Meet",
"createdAt": "2026-02-27T01:17:29.464Z",
"createdBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"deletedAt": null,
"description": "Collaborative code review and technical discussion.",
"endsAt": "2026-07-10T13:00:00.000Z",
"externalCreatedAt": "2026-07-10T04:28:54.960Z",
"externalUpdatedAt": "2026-07-10T05:22:07.621Z",
"iCalUid": "event5@calendar.twentycrm.com",
"id": "20202020-0005-4e7c-8001-123456789cde",
"isCanceled": false,
"isFullDay": false,
"location": "Teams",
"position": 0,
"startsAt": "2026-07-10T12:00:00.000Z",
"title": "Code Review Session",
"updatedAt": "2026-02-27T01:17:29.464Z",
"updatedBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
}
},
{
"__typename": "CalendarEvent",
"calendarChannelEventAssociations": {
"__typename": "CalendarChannelEventAssociationConnection",
"edges": [
{
"__typename": "CalendarChannelEventAssociationEdge",
"node": {
"__typename": "CalendarChannelEventAssociation",
"id": "20202020-0006-4e7c-8001-123456789abc"
}
}
]
},
"calendarEventParticipants": {
"__typename": "CalendarEventParticipantConnection",
"edges": [
{
"__typename": "CalendarEventParticipantEdge",
"node": {
"__typename": "CalendarEventParticipant",
"handle": "robert.taylor@company.com",
"id": "20202020-000e-4e7c-8001-123456789def"
}
}
]
},
"conferenceLink": {
"__typename": "Links",
"primaryLinkUrl": "https://googlemeet.com/j/8745159251",
"primaryLinkLabel": "https://googlemeet.com/j/8745159251",
"secondaryLinks": []
},
"conferenceSolution": "Google Meet",
"createdAt": "2026-02-27T01:17:29.464Z",
"createdBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"deletedAt": null,
"description": "Quarterly strategic planning and goal setting workshop.",
"endsAt": "2026-06-19T22:00:00.000Z",
"externalCreatedAt": "2026-06-17T17:57:29.360Z",
"externalUpdatedAt": "2026-06-19T07:49:37.396Z",
"iCalUid": "event6@calendar.twentycrm.com",
"id": "20202020-0006-4e7c-8001-123456789cde",
"isCanceled": false,
"isFullDay": true,
"location": "Conference Center",
"position": 0,
"startsAt": "2026-06-19T11:00:00.000Z",
"title": "Strategic Planning Workshop",
"updatedAt": "2026-02-27T01:17:29.464Z",
"updatedBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
}
},
{
"__typename": "CalendarEvent",
"calendarChannelEventAssociations": {
"__typename": "CalendarChannelEventAssociationConnection",
"edges": [
{
"__typename": "CalendarChannelEventAssociationEdge",
"node": {
"__typename": "CalendarChannelEventAssociation",
"id": "20202020-0007-4e7c-8001-123456789abc"
}
}
]
},
"calendarEventParticipants": {
"__typename": "CalendarEventParticipantConnection",
"edges": [
{
"__typename": "CalendarEventParticipantEdge",
"node": {
"__typename": "CalendarEventParticipant",
"handle": "jennifer.martinez@company.com",
"id": "20202020-000f-4e7c-8001-123456789def"
}
},
{
"__typename": "CalendarEventParticipantEdge",
"node": {
"__typename": "CalendarEventParticipant",
"handle": "member@company.com",
"id": "20202020-0010-4e7c-8001-123456789def"
}
},
{
"__typename": "CalendarEventParticipantEdge",
"node": {
"__typename": "CalendarEventParticipant",
"handle": "member@company.com",
"id": "20202020-0011-4e7c-8001-123456789def"
}
}
]
},
"conferenceLink": {
"__typename": "Links",
"primaryLinkUrl": "https://teams.com/j/2210986422",
"primaryLinkLabel": "https://teams.com/j/2210986422",
"secondaryLinks": []
},
"conferenceSolution": "Teams",
"createdAt": "2026-02-27T01:17:29.464Z",
"createdBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"deletedAt": null,
"description": "Professional development and skills training session.",
"endsAt": "2026-04-30T10:00:00.000Z",
"externalCreatedAt": "2026-04-27T16:37:41.128Z",
"externalUpdatedAt": "2026-04-29T18:18:07.528Z",
"iCalUid": "event7@calendar.twentycrm.com",
"id": "20202020-0007-4e7c-8001-123456789cde",
"isCanceled": false,
"isFullDay": false,
"location": "Teams",
"position": 0,
"startsAt": "2026-04-30T08:00:00.000Z",
"title": "Training Session",
"updatedAt": "2026-02-27T01:17:29.464Z",
"updatedBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
}
},
{
"__typename": "CalendarEvent",
"calendarChannelEventAssociations": {
"__typename": "CalendarChannelEventAssociationConnection",
"edges": [
{
"__typename": "CalendarChannelEventAssociationEdge",
"node": {
"__typename": "CalendarChannelEventAssociation",
"id": "20202020-0008-4e7c-8001-123456789abc"
}
}
]
},
"calendarEventParticipants": {
"__typename": "CalendarEventParticipantConnection",
"edges": [
{
"__typename": "CalendarEventParticipantEdge",
"node": {
"__typename": "CalendarEventParticipant",
"handle": "person321@company.com",
"id": "20202020-0012-4e7c-8001-123456789def"
}
},
{
"__typename": "CalendarEventParticipantEdge",
"node": {
"__typename": "CalendarEventParticipant",
"handle": "member@company.com",
"id": "20202020-0013-4e7c-8001-123456789def"
}
},
{
"__typename": "CalendarEventParticipantEdge",
"node": {
"__typename": "CalendarEventParticipant",
"handle": "michael.chen@company.com",
"id": "20202020-0014-4e7c-8001-123456789def"
}
}
]
},
"conferenceLink": {
"__typename": "Links",
"primaryLinkUrl": "https://googlemeet.com/j/2260515052",
"primaryLinkLabel": "https://googlemeet.com/j/2260515052",
"secondaryLinks": []
},
"conferenceSolution": "Google Meet",
"createdAt": "2026-02-27T01:17:29.464Z",
"createdBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"deletedAt": null,
"description": "Customer interview to gather feedback and understand needs.",
"endsAt": "2026-04-01T11:00:00.000Z",
"externalCreatedAt": "2026-03-28T21:09:24.516Z",
"externalUpdatedAt": "2026-03-31T14:40:32.244Z",
"iCalUid": "event8@calendar.twentycrm.com",
"id": "20202020-0008-4e7c-8001-123456789cde",
"isCanceled": false,
"isFullDay": false,
"location": "Teams",
"position": 0,
"startsAt": "2026-04-01T10:15:00.000Z",
"title": "Customer Discovery Call",
"updatedAt": "2026-02-27T01:17:29.464Z",
"updatedBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
}
},
{
"__typename": "CalendarEvent",
"calendarChannelEventAssociations": {
"__typename": "CalendarChannelEventAssociationConnection",
"edges": [
{
"__typename": "CalendarChannelEventAssociationEdge",
"node": {
"__typename": "CalendarChannelEventAssociation",
"id": "20202020-0009-4e7c-8001-123456789abc"
}
}
]
},
"calendarEventParticipants": {
"__typename": "CalendarEventParticipantConnection",
"edges": [
{
"__typename": "CalendarEventParticipantEdge",
"node": {
"__typename": "CalendarEventParticipant",
"handle": "member@company.com",
"id": "20202020-0015-4e7c-8001-123456789def"
}
},
{
"__typename": "CalendarEventParticipantEdge",
"node": {
"__typename": "CalendarEventParticipant",
"handle": "person899@company.com",
"id": "20202020-0016-4e7c-8001-123456789def"
}
},
{
"__typename": "CalendarEventParticipantEdge",
"node": {
"__typename": "CalendarEventParticipant",
"handle": "person492@company.com",
"id": "20202020-0017-4e7c-8001-123456789def"
}
}
]
},
"conferenceLink": {
"__typename": "Links",
"primaryLinkUrl": "https://googlemeet.com/j/1181385220",
"primaryLinkLabel": "https://googlemeet.com/j/1181385220",
"secondaryLinks": []
},
"conferenceSolution": "Google Meet",
"createdAt": "2026-02-27T01:17:29.464Z",
"createdBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"deletedAt": null,
"description": "Quarterly budget review and financial planning session.",
"endsAt": "2026-06-09T12:45:00.000Z",
"externalCreatedAt": "2026-06-08T23:06:40.889Z",
"externalUpdatedAt": "2026-06-09T09:09:28.748Z",
"iCalUid": "event9@calendar.twentycrm.com",
"id": "20202020-0009-4e7c-8001-123456789cde",
"isCanceled": false,
"isFullDay": false,
"location": "Zoom",
"position": 0,
"startsAt": "2026-06-09T11:15:00.000Z",
"title": "Budget Review Meeting",
"updatedAt": "2026-02-27T01:17:29.464Z",
"updatedBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
}
},
{
"__typename": "CalendarEvent",
"calendarChannelEventAssociations": {
"__typename": "CalendarChannelEventAssociationConnection",
"edges": [
{
"__typename": "CalendarChannelEventAssociationEdge",
"node": {
"__typename": "CalendarChannelEventAssociation",
"id": "20202020-000a-4e7c-8001-123456789abc"
}
}
]
},
"calendarEventParticipants": {
"__typename": "CalendarEventParticipantConnection",
"edges": [
{
"__typename": "CalendarEventParticipantEdge",
"node": {
"__typename": "CalendarEventParticipant",
"handle": "alex.johnson@company.com",
"id": "20202020-0018-4e7c-8001-123456789def"
}
}
]
},
"conferenceLink": {
"__typename": "Links",
"primaryLinkUrl": "https://googlemeet.com/j/4116289029",
"primaryLinkLabel": "https://googlemeet.com/j/4116289029",
"secondaryLinks": []
},
"conferenceSolution": "Google Meet",
"createdAt": "2026-02-27T01:17:29.464Z",
"createdBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"deletedAt": null,
"description": "Product demonstration for potential customers and stakeholders.",
"endsAt": "2026-03-12T09:30:00.000Z",
"externalCreatedAt": "2026-03-05T20:44:15.718Z",
"externalUpdatedAt": "2026-03-11T22:42:25.619Z",
"iCalUid": "event10@calendar.twentycrm.com",
"id": "20202020-000a-4e7c-8001-123456789cde",
"isCanceled": false,
"isFullDay": false,
"location": "Client Site",
"position": 0,
"startsAt": "2026-03-12T08:30:00.000Z",
"title": "Product Demo",
"updatedAt": "2026-02-27T01:17:29.464Z",
"updatedBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
}
}
];
@@ -0,0 +1,246 @@
/* eslint-disable */
// @ts-nocheck
import { type ObjectRecord } from '@/object-record/types/ObjectRecord';
// This file was automatically generated — do not edit manually.
// prettier-ignore
export const mockedConnectedAccountRecords: ObjectRecord[] =
[
{
"__typename": "ConnectedAccount",
"accessToken": "exampleAccessToken",
"accountOwner": {
"__typename": "WorkspaceMember",
"id": "20202020-77d5-4cb6-b60a-f4a835a85d61",
"name": {
"__typename": "FullName",
"firstName": "Jony",
"lastName": "Ive"
}
},
"accountOwnerId": "20202020-77d5-4cb6-b60a-f4a835a85d61",
"authFailedAt": null,
"calendarChannels": {
"__typename": "CalendarChannelConnection",
"edges": [
{
"__typename": "CalendarChannelEdge",
"node": {
"__typename": "CalendarChannel",
"handle": "jony@apple.dev",
"id": "20202020-a40f-4faf-bb9f-c6f9945b8204"
}
}
]
},
"connectionParameters": null,
"createdAt": "2026-02-27T01:17:25.392Z",
"createdBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"deletedAt": null,
"handle": "jony.ive@apple.dev",
"handleAliases": "",
"id": "20202020-0cc8-4d60-a3a4-803245698908",
"lastCredentialsRefreshedAt": null,
"lastSyncHistoryId": "exampleLastSyncHistory",
"messageChannels": {
"__typename": "MessageChannelConnection",
"edges": [
{
"__typename": "MessageChannelEdge",
"node": {
"__typename": "MessageChannel",
"handle": "jony.ive@apple.dev",
"id": "20202020-5ffe-4b32-814a-983d5e4911cd"
}
}
]
},
"position": 0,
"provider": "google",
"refreshToken": "exampleRefreshToken",
"scopes": [],
"updatedAt": "2026-02-27T01:17:25.392Z",
"updatedBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
}
},
{
"__typename": "ConnectedAccount",
"accessToken": "exampleAccessToken",
"accountOwner": {
"__typename": "WorkspaceMember",
"id": "20202020-0687-4c41-b707-ed1bfca972a7",
"name": {
"__typename": "FullName",
"firstName": "Tim",
"lastName": "Apple"
}
},
"accountOwnerId": "20202020-0687-4c41-b707-ed1bfca972a7",
"authFailedAt": null,
"calendarChannels": {
"__typename": "CalendarChannelConnection",
"edges": [
{
"__typename": "CalendarChannelEdge",
"node": {
"__typename": "CalendarChannel",
"handle": "tim@apple.dev",
"id": "20202020-a40f-4faf-bb9f-c6f9945b8203"
}
},
{
"__typename": "CalendarChannelEdge",
"node": {
"__typename": "CalendarChannel",
"handle": "company-main@apple.dev",
"id": "20202020-a40f-4faf-bb9f-c6f9945b8206"
}
},
{
"__typename": "CalendarChannelEdge",
"node": {
"__typename": "CalendarChannel",
"handle": "team-calendar@apple.dev",
"id": "20202020-a40f-4faf-bb9f-c6f9945b8207"
}
}
]
},
"connectionParameters": null,
"createdAt": "2026-02-27T01:17:25.392Z",
"createdBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"deletedAt": null,
"handle": "tim@apple.dev",
"handleAliases": "",
"id": "20202020-9ac0-4390-9a1a-ab4d2c4e1bb7",
"lastCredentialsRefreshedAt": null,
"lastSyncHistoryId": "exampleLastSyncHistory",
"messageChannels": {
"__typename": "MessageChannelConnection",
"edges": [
{
"__typename": "MessageChannelEdge",
"node": {
"__typename": "MessageChannel",
"handle": "tim@apple.dev",
"id": "20202020-9b80-4c2c-a597-383db48de1d6"
}
},
{
"__typename": "MessageChannelEdge",
"node": {
"__typename": "MessageChannel",
"handle": "support@apple.dev",
"id": "20202020-e2f1-49b5-85d2-5d3a3386990d"
}
},
{
"__typename": "MessageChannelEdge",
"node": {
"__typename": "MessageChannel",
"handle": "sales@apple.dev",
"id": "20202020-e2f1-49b5-85d2-5d3a3386990e"
}
}
]
},
"position": 0,
"provider": "google",
"refreshToken": "exampleRefreshToken",
"scopes": [],
"updatedAt": "2026-02-27T01:17:25.392Z",
"updatedBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
}
},
{
"__typename": "ConnectedAccount",
"accessToken": "exampleAccessToken",
"accountOwner": {
"__typename": "WorkspaceMember",
"id": "20202020-1553-45c6-a028-5a9064cce07f",
"name": {
"__typename": "FullName",
"firstName": "Phil",
"lastName": "Schiler"
}
},
"accountOwnerId": "20202020-1553-45c6-a028-5a9064cce07f",
"authFailedAt": null,
"calendarChannels": {
"__typename": "CalendarChannelConnection",
"edges": [
{
"__typename": "CalendarChannelEdge",
"node": {
"__typename": "CalendarChannel",
"handle": "phil@apple.dev",
"id": "20202020-a40f-4faf-bb9f-c6f9945b8205"
}
}
]
},
"connectionParameters": null,
"createdAt": "2026-02-27T01:17:25.392Z",
"createdBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"deletedAt": null,
"handle": "phil.schiler@apple.dev",
"handleAliases": "",
"id": "20202020-cafc-4323-908d-e5b42ad69fdf",
"lastCredentialsRefreshedAt": null,
"lastSyncHistoryId": "exampleLastSyncHistory",
"messageChannels": {
"__typename": "MessageChannelConnection",
"edges": [
{
"__typename": "MessageChannelEdge",
"node": {
"__typename": "MessageChannel",
"handle": "phil.schiler@apple.dev",
"id": "20202020-e2f1-49b5-85d2-5d3a3386990c"
}
}
]
},
"position": 0,
"provider": "google",
"refreshToken": "exampleRefreshToken",
"scopes": [],
"updatedAt": "2026-02-27T01:17:25.392Z",
"updatedBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
}
}
];
@@ -0,0 +1,9 @@
/* eslint-disable */
// @ts-nocheck
import { type ObjectRecord } from '@/object-record/types/ObjectRecord';
// This file was automatically generated — do not edit manually.
// prettier-ignore
export const mockedFavoriteFolderRecords: ObjectRecord[] =
[];
@@ -0,0 +1,560 @@
/* eslint-disable */
// @ts-nocheck
import { type ObjectRecord } from '@/object-record/types/ObjectRecord';
// This file was automatically generated — do not edit manually.
// prettier-ignore
export const mockedFavoriteRecords: ObjectRecord[] =
[
{
"__typename": "Favorite",
"company": null,
"companyId": null,
"createdAt": "2026-02-27T01:17:27.120Z",
"createdBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"dashboard": null,
"dashboardId": null,
"deletedAt": null,
"employmentHistory": null,
"employmentHistoryId": null,
"favoriteFolder": null,
"favoriteFolderId": null,
"forWorkspaceMember": null,
"forWorkspaceMemberId": null,
"id": "36a3c23b-bdd7-4c03-8332-ba93fe82e0ef",
"note": null,
"noteId": null,
"opportunity": null,
"opportunityId": null,
"person": null,
"personId": null,
"pet": null,
"petCareAgreement": null,
"petCareAgreementId": null,
"petId": null,
"position": 3,
"rocket": null,
"rocketId": null,
"surveyResult": null,
"surveyResultId": null,
"task": null,
"taskId": null,
"updatedAt": "2026-02-27T01:17:27.120Z",
"updatedBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"viewId": "580054a7-0fb9-4193-b93b-ebe8dfe2a6e8",
"workflow": null,
"workflowId": null,
"workflowRun": null,
"workflowRunId": null,
"workflowVersion": null,
"workflowVersionId": null
},
{
"__typename": "Favorite",
"company": null,
"companyId": null,
"createdAt": "2026-02-27T01:17:28.065Z",
"createdBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"dashboard": null,
"dashboardId": null,
"deletedAt": null,
"employmentHistory": null,
"employmentHistoryId": null,
"favoriteFolder": null,
"favoriteFolderId": null,
"forWorkspaceMember": null,
"forWorkspaceMemberId": null,
"id": "42adcbab-c6ff-4c14-8d9f-64ea6a2ee07e",
"note": null,
"noteId": null,
"opportunity": null,
"opportunityId": null,
"person": null,
"personId": null,
"pet": null,
"petCareAgreement": null,
"petCareAgreementId": null,
"petId": null,
"position": 11,
"rocket": null,
"rocketId": null,
"surveyResult": null,
"surveyResultId": null,
"task": null,
"taskId": null,
"updatedAt": "2026-02-27T01:17:28.065Z",
"updatedBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"viewId": "efdbaee1-5bdf-4366-88e7-2ec9b35c2a8f",
"workflow": null,
"workflowId": null,
"workflowRun": null,
"workflowRunId": null,
"workflowVersion": null,
"workflowVersionId": null
},
{
"__typename": "Favorite",
"company": null,
"companyId": null,
"createdAt": "2026-02-27T01:17:27.120Z",
"createdBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"dashboard": null,
"dashboardId": null,
"deletedAt": null,
"employmentHistory": null,
"employmentHistoryId": null,
"favoriteFolder": null,
"favoriteFolderId": null,
"forWorkspaceMember": null,
"forWorkspaceMemberId": null,
"id": "45a4eab3-c3c8-4bb6-9dd0-a836d04de83d",
"note": null,
"noteId": null,
"opportunity": null,
"opportunityId": null,
"person": null,
"personId": null,
"pet": null,
"petCareAgreement": null,
"petCareAgreementId": null,
"petId": null,
"position": 1,
"rocket": null,
"rocketId": null,
"surveyResult": null,
"surveyResultId": null,
"task": null,
"taskId": null,
"updatedAt": "2026-02-27T01:17:27.120Z",
"updatedBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"viewId": "aacdfdf3-fab0-4452-8cef-6b3a7cdae65d",
"workflow": null,
"workflowId": null,
"workflowRun": null,
"workflowRunId": null,
"workflowVersion": null,
"workflowVersionId": null
},
{
"__typename": "Favorite",
"company": null,
"companyId": null,
"createdAt": "2026-02-27T01:17:27.366Z",
"createdBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"dashboard": null,
"dashboardId": null,
"deletedAt": null,
"employmentHistory": null,
"employmentHistoryId": null,
"favoriteFolder": null,
"favoriteFolderId": null,
"forWorkspaceMember": null,
"forWorkspaceMemberId": null,
"id": "47daf142-9f82-4f34-991a-17943ed3a612",
"note": null,
"noteId": null,
"opportunity": null,
"opportunityId": null,
"person": null,
"personId": null,
"pet": null,
"petCareAgreement": null,
"petCareAgreementId": null,
"petId": null,
"position": 7,
"rocket": null,
"rocketId": null,
"surveyResult": null,
"surveyResultId": null,
"task": null,
"taskId": null,
"updatedAt": "2026-02-27T01:17:27.366Z",
"updatedBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"viewId": "d7acbb01-5896-4cf3-9a8f-1da3fc0ccaad",
"workflow": null,
"workflowId": null,
"workflowRun": null,
"workflowRunId": null,
"workflowVersion": null,
"workflowVersionId": null
},
{
"__typename": "Favorite",
"company": null,
"companyId": null,
"createdAt": "2026-02-27T01:17:27.120Z",
"createdBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"dashboard": null,
"dashboardId": null,
"deletedAt": null,
"employmentHistory": null,
"employmentHistoryId": null,
"favoriteFolder": null,
"favoriteFolderId": null,
"forWorkspaceMember": null,
"forWorkspaceMemberId": null,
"id": "4bc58002-47cd-4081-bde4-e6ed626dab00",
"note": null,
"noteId": null,
"opportunity": null,
"opportunityId": null,
"person": null,
"personId": null,
"pet": null,
"petCareAgreement": null,
"petCareAgreementId": null,
"petId": null,
"position": 6,
"rocket": null,
"rocketId": null,
"surveyResult": null,
"surveyResultId": null,
"task": null,
"taskId": null,
"updatedAt": "2026-02-27T01:17:27.120Z",
"updatedBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"viewId": "fbcbcef2-9812-44ee-b4de-3ea16dbadc18",
"workflow": null,
"workflowId": null,
"workflowRun": null,
"workflowRunId": null,
"workflowVersion": null,
"workflowVersionId": null
},
{
"__typename": "Favorite",
"company": null,
"companyId": null,
"createdAt": "2026-02-27T01:17:27.773Z",
"createdBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"dashboard": null,
"dashboardId": null,
"deletedAt": null,
"employmentHistory": null,
"employmentHistoryId": null,
"favoriteFolder": null,
"favoriteFolderId": null,
"forWorkspaceMember": null,
"forWorkspaceMemberId": null,
"id": "5d1b4370-e3d9-4555-a4ba-35c65aba3036",
"note": null,
"noteId": null,
"opportunity": null,
"opportunityId": null,
"person": null,
"personId": null,
"pet": null,
"petCareAgreement": null,
"petCareAgreementId": null,
"petId": null,
"position": 9,
"rocket": null,
"rocketId": null,
"surveyResult": null,
"surveyResultId": null,
"task": null,
"taskId": null,
"updatedAt": "2026-02-27T01:17:27.773Z",
"updatedBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"viewId": "aabb1623-2f9d-40fe-8176-3de8e38ea388",
"workflow": null,
"workflowId": null,
"workflowRun": null,
"workflowRunId": null,
"workflowVersion": null,
"workflowVersionId": null
},
{
"__typename": "Favorite",
"company": null,
"companyId": null,
"createdAt": "2026-02-27T01:17:27.120Z",
"createdBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"dashboard": null,
"dashboardId": null,
"deletedAt": null,
"employmentHistory": null,
"employmentHistoryId": null,
"favoriteFolder": null,
"favoriteFolderId": null,
"forWorkspaceMember": null,
"forWorkspaceMemberId": null,
"id": "8f939c19-d22a-4a74-b128-053328461f54",
"note": null,
"noteId": null,
"opportunity": null,
"opportunityId": null,
"person": null,
"personId": null,
"pet": null,
"petCareAgreement": null,
"petCareAgreementId": null,
"petId": null,
"position": 0,
"rocket": null,
"rocketId": null,
"surveyResult": null,
"surveyResultId": null,
"task": null,
"taskId": null,
"updatedAt": "2026-02-27T01:17:27.120Z",
"updatedBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"viewId": "123952b3-15d7-4674-aa2c-f5e21a0ef4b7",
"workflow": null,
"workflowId": null,
"workflowRun": null,
"workflowRunId": null,
"workflowVersion": null,
"workflowVersionId": null
},
{
"__typename": "Favorite",
"company": null,
"companyId": null,
"createdAt": "2026-02-27T01:17:27.120Z",
"createdBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"dashboard": null,
"dashboardId": null,
"deletedAt": null,
"employmentHistory": null,
"employmentHistoryId": null,
"favoriteFolder": null,
"favoriteFolderId": null,
"forWorkspaceMember": null,
"forWorkspaceMemberId": null,
"id": "95132523-73dc-465e-867c-371a6b1e5274",
"note": null,
"noteId": null,
"opportunity": null,
"opportunityId": null,
"person": null,
"personId": null,
"pet": null,
"petCareAgreement": null,
"petCareAgreementId": null,
"petId": null,
"position": 4,
"rocket": null,
"rocketId": null,
"surveyResult": null,
"surveyResultId": null,
"task": null,
"taskId": null,
"updatedAt": "2026-02-27T01:17:27.120Z",
"updatedBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"viewId": "b565bc45-7edb-47d9-a4b1-0258a2fe8322",
"workflow": null,
"workflowId": null,
"workflowRun": null,
"workflowRunId": null,
"workflowVersion": null,
"workflowVersionId": null
},
{
"__typename": "Favorite",
"company": null,
"companyId": null,
"createdAt": "2026-02-27T01:17:27.952Z",
"createdBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"dashboard": null,
"dashboardId": null,
"deletedAt": null,
"employmentHistory": null,
"employmentHistoryId": null,
"favoriteFolder": null,
"favoriteFolderId": null,
"forWorkspaceMember": null,
"forWorkspaceMemberId": null,
"id": "cad55192-d483-41b6-ba3a-1275244cd700",
"note": null,
"noteId": null,
"opportunity": null,
"opportunityId": null,
"person": null,
"personId": null,
"pet": null,
"petCareAgreement": null,
"petCareAgreementId": null,
"petId": null,
"position": 10,
"rocket": null,
"rocketId": null,
"surveyResult": null,
"surveyResultId": null,
"task": null,
"taskId": null,
"updatedAt": "2026-02-27T01:17:27.952Z",
"updatedBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"viewId": "1c96690f-dfc9-4c40-8cf6-6903b968f8b6",
"workflow": null,
"workflowId": null,
"workflowRun": null,
"workflowRunId": null,
"workflowVersion": null,
"workflowVersionId": null
},
{
"__typename": "Favorite",
"company": null,
"companyId": null,
"createdAt": "2026-02-27T01:17:27.120Z",
"createdBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"dashboard": null,
"dashboardId": null,
"deletedAt": null,
"employmentHistory": null,
"employmentHistoryId": null,
"favoriteFolder": null,
"favoriteFolderId": null,
"forWorkspaceMember": null,
"forWorkspaceMemberId": null,
"id": "da35da1e-5189-4ef7-83d6-ebddf6eb86c2",
"note": null,
"noteId": null,
"opportunity": null,
"opportunityId": null,
"person": null,
"personId": null,
"pet": null,
"petCareAgreement": null,
"petCareAgreementId": null,
"petId": null,
"position": 2,
"rocket": null,
"rocketId": null,
"surveyResult": null,
"surveyResultId": null,
"task": null,
"taskId": null,
"updatedAt": "2026-02-27T01:17:27.120Z",
"updatedBy": {
"__typename": "Actor",
"source": "MANUAL",
"workspaceMemberId": null,
"name": "System",
"context": null
},
"viewId": "9e10e56a-a3f7-40e0-a9dd-a34ddbc4a709",
"workflow": null,
"workflowId": null,
"workflowRun": null,
"workflowRunId": null,
"workflowVersion": null,
"workflowVersionId": null
}
];
@@ -0,0 +1,25 @@
/* eslint-disable */
// @ts-nocheck
// This file was automatically generated — do not edit manually.
// prettier-ignore
export const mockedApiKeys: Record<string, unknown>[] =
[
{
"__typename": "ApiKey",
"id": "20202020-f401-4d8a-a731-64d007c27bad",
"name": "My api key",
"expiresAt": "2025-12-31T23:59:59.000Z",
"createdAt": "2026-02-27T01:17:26.394Z",
"updatedAt": "2026-02-27T01:17:26.394Z",
"revokedAt": null,
"role": {
"__typename": "Role",
"id": "28f0a741-33c8-4af0-8542-f9ca2ad43285",
"label": "Admin",
"icon": "IconUserCog"
}
}
];
@@ -11202,7 +11202,7 @@ export const mockedRoles: Role[] =
"userEmail": "richard.palmer1000@apple.dev"
}
],
"agents": [],
"apiKeys": []
"apiKeys": [],
"agents": []
}
];
@@ -1,411 +0,0 @@
import { getMockObjectMetadataItemOrThrow } from '~/testing/utils/getMockObjectMetadataItemOrThrow';
import { mockedViewsData } from './views';
const companyObjectMetadata = getMockObjectMetadataItemOrThrow('company');
const personObjectMetadata = getMockObjectMetadataItemOrThrow('person');
const opportunityObjectMetadata =
getMockObjectMetadataItemOrThrow('opportunity');
export const mockedViewFieldsData = [
// Companies
{
id: '79035310-e955-4986-a4a4-73f9d9949c6a',
fieldMetadataId: companyObjectMetadata?.fields.find(
(field) => field.name === 'name',
)?.id,
viewId: mockedViewsData[0].id,
position: 0,
isVisible: true,
size: 180,
createdAt: '2021-09-01T00:00:00.000Z',
updatedAt: '2021-09-01T00:00:00.000Z',
deletedAt: null,
__typename: 'ViewField',
},
{
id: '2a96bbc8-d86d-439a-8e50-4b07ebd27750',
fieldMetadataId: companyObjectMetadata?.fields.find(
(field) => field.name === 'domainName',
)?.id,
viewId: mockedViewsData[0].id,
position: 1,
isVisible: true,
size: 100,
createdAt: '2021-09-01T00:00:00.000Z',
updatedAt: '2021-09-01T00:00:00.000Z',
deletedAt: null,
__typename: 'ViewField',
},
{
id: '0c1b4c7b-6a3d-4fb0-bf2b-5d7c8fb844ed',
fieldMetadataId: companyObjectMetadata?.fields.find(
(field) => field.name === 'accountOwner',
)?.id,
viewId: mockedViewsData[0].id,
position: 2,
isVisible: true,
size: 150,
createdAt: '2021-09-01T00:00:00.000Z',
updatedAt: '2021-09-01T00:00:00.000Z',
deletedAt: null,
__typename: 'ViewField',
},
{
id: 'cc7f9560-32b5-4b82-8fd9-b05fe77c8cf7',
fieldMetadataId: companyObjectMetadata?.fields.find(
(field) => field.name === 'createdAt',
)?.id,
viewId: mockedViewsData[0].id,
position: 3,
isVisible: true,
size: 150,
createdAt: '2021-09-01T00:00:00.000Z',
updatedAt: '2021-09-01T00:00:00.000Z',
deletedAt: null,
__typename: 'ViewField',
},
{
id: '3de4d078-3396-4480-be2d-6f3b1a228b0d',
fieldMetadataId: companyObjectMetadata?.fields.find(
(field) => field.name === 'employees',
)?.id,
viewId: mockedViewsData[0].id,
position: 4,
isVisible: true,
size: 150,
createdAt: '2021-09-01T00:00:00.000Z',
updatedAt: '2021-09-01T00:00:00.000Z',
deletedAt: null,
__typename: 'ViewField',
},
{
id: '4650c8fb-0f1e-4342-88dc-adedae1445f9',
fieldMetadataId: companyObjectMetadata?.fields.find(
(field) => field.name === 'linkedinLink',
)?.id,
viewId: mockedViewsData[0].id,
position: 5,
isVisible: true,
size: 170,
createdAt: '2021-09-01T00:00:00.000Z',
updatedAt: '2021-09-01T00:00:00.000Z',
deletedAt: null,
__typename: 'ViewField',
},
{
id: '727430bf-6ff8-4c85-9828-cbe72ac0fc27',
fieldMetadataId: companyObjectMetadata?.fields.find(
(field) => field.name === 'address',
)?.id,
viewId: mockedViewsData[0].id,
position: 6,
isVisible: true,
size: 170,
createdAt: '2021-09-01T00:00:00.000Z',
updatedAt: '2021-09-01T00:00:00.000Z',
deletedAt: null,
__typename: 'ViewField',
},
// Companies v2
{
id: '79035310-e955-4986-a4a4-73f9d9949c6a',
fieldMetadataId: companyObjectMetadata?.fields.find(
(field) => field.name === 'name',
)?.id,
viewId: mockedViewsData[3].id,
position: 0,
isVisible: true,
size: 180,
createdAt: '2021-09-01T00:00:00.000Z',
updatedAt: '2021-09-01T00:00:00.000Z',
deletedAt: null,
__typename: 'ViewField',
},
{
id: '2a96bbc8-d86d-439a-8e50-4b07ebd27750',
fieldMetadataId: companyObjectMetadata?.fields.find(
(field) => field.name === 'domainName',
)?.id,
viewId: mockedViewsData[3].id,
position: 1,
isVisible: true,
size: 100,
createdAt: '2021-09-01T00:00:00.000Z',
updatedAt: '2021-09-01T00:00:00.000Z',
deletedAt: null,
__typename: 'ViewField',
},
{
id: '0c1b4c7b-6a3d-4fb0-bf2b-5d7c8fb844ed',
fieldMetadataId: companyObjectMetadata?.fields.find(
(field) => field.name === 'accountOwner',
)?.id,
viewId: mockedViewsData[3].id,
position: 2,
isVisible: true,
size: 150,
createdAt: '2021-09-01T00:00:00.000Z',
updatedAt: '2021-09-01T00:00:00.000Z',
deletedAt: null,
__typename: 'ViewField',
},
{
id: 'cc7f9560-32b5-4b82-8fd9-b05fe77c8cf7',
fieldMetadataId: companyObjectMetadata?.fields.find(
(field) => field.name === 'createdAt',
)?.id,
viewId: mockedViewsData[3].id,
position: 3,
isVisible: true,
size: 150,
createdAt: '2021-09-01T00:00:00.000Z',
updatedAt: '2021-09-01T00:00:00.000Z',
deletedAt: null,
__typename: 'ViewField',
},
{
id: '3de4d078-3396-4480-be2d-6f3b1a228b0d',
fieldMetadataId: companyObjectMetadata?.fields.find(
(field) => field.name === 'employees',
)?.id,
viewId: mockedViewsData[3].id,
position: 4,
isVisible: true,
size: 150,
createdAt: '2021-09-01T00:00:00.000Z',
updatedAt: '2021-09-01T00:00:00.000Z',
deletedAt: null,
__typename: 'ViewField',
},
{
id: '4650c8fb-0f1e-4342-88dc-adedae1445f9',
fieldMetadataId: companyObjectMetadata?.fields.find(
(field) => field.name === 'linkedinLink',
)?.id,
viewId: mockedViewsData[3].id,
position: 5,
isVisible: true,
size: 170,
createdAt: '2021-09-01T00:00:00.000Z',
updatedAt: '2021-09-01T00:00:00.000Z',
deletedAt: null,
__typename: 'ViewField',
},
{
id: '727430bf-6ff8-4c85-9828-cbe72ac0fc27',
fieldMetadataId: companyObjectMetadata?.fields.find(
(field) => field.name === 'address',
)?.id,
viewId: mockedViewsData[3].id,
position: 6,
isVisible: true,
size: 170,
createdAt: '2021-09-01T00:00:00.000Z',
updatedAt: '2021-09-01T00:00:00.000Z',
deletedAt: null,
__typename: 'ViewField',
},
// People
{
id: '28894146-4fde-4a16-a9ca-1a31b5b788b4',
fieldMetadataId: personObjectMetadata?.fields.find(
(field) => field.name === 'name',
)?.id,
viewId: mockedViewsData[1].id,
position: 0,
isVisible: true,
size: 210,
createdAt: '2021-09-01T00:00:00.000Z',
updatedAt: '2021-09-01T00:00:00.000Z',
deletedAt: null,
__typename: 'ViewField',
},
{
id: 'e1e24864-8601-4cd8-8a63-09c1285f2e39',
fieldMetadataId: personObjectMetadata?.fields.find(
(field) => field.name === 'emails',
)?.id,
viewId: mockedViewsData[1].id,
position: 1,
isVisible: true,
size: 150,
createdAt: '2021-09-01T00:00:00.000Z',
updatedAt: '2021-09-01T00:00:00.000Z',
deletedAt: null,
__typename: 'ViewField',
},
{
id: '5a1df716-7211-445a-9f16-9783a00998a7',
fieldMetadataId: personObjectMetadata?.fields.find(
(field) => field.name === 'company',
)?.id,
viewId: mockedViewsData[1].id,
position: 2,
isVisible: true,
size: 150,
createdAt: '2021-09-01T00:00:00.000Z',
updatedAt: '2021-09-01T00:00:00.000Z',
deletedAt: null,
__typename: 'ViewField',
},
{
id: 'a6e1197a-7e84-4d92-ace2-367c0bc46c49',
fieldMetadataId: personObjectMetadata?.fields.find(
(field) => field.name === 'phones',
)?.id,
viewId: mockedViewsData[1].id,
position: 3,
isVisible: true,
size: 150,
createdAt: '2021-09-01T00:00:00.000Z',
updatedAt: '2021-09-01T00:00:00.000Z',
deletedAt: null,
__typename: 'ViewField',
},
{
id: 'c9343097-d14b-4559-a5fa-626c1527d39f',
fieldMetadataId: personObjectMetadata?.fields.find(
(field) => field.name === 'createdAt',
)?.id,
viewId: mockedViewsData[1].id,
position: 4,
isVisible: true,
size: 150,
createdAt: '2021-09-01T00:00:00.000Z',
updatedAt: '2021-09-01T00:00:00.000Z',
deletedAt: null,
__typename: 'ViewField',
},
{
id: 'a873e5f0-fed6-47e9-a712-6854eab3ec77',
fieldMetadataId: personObjectMetadata?.fields.find(
(field) => field.name === 'city',
)?.id,
viewId: mockedViewsData[1].id,
position: 5,
isVisible: true,
size: 150,
createdAt: '2021-09-01T00:00:00.000Z',
updatedAt: '2021-09-01T00:00:00.000Z',
deletedAt: null,
__typename: 'ViewField',
},
{
id: '66f134b8-5329-422f-b88e-83e6bb707eb5',
fieldMetadataId: personObjectMetadata?.fields.find(
(field) => field.name === 'jobTitle',
)?.id,
viewId: mockedViewsData[1].id,
position: 6,
isVisible: true,
size: 150,
createdAt: '2021-09-01T00:00:00.000Z',
updatedAt: '2021-09-01T00:00:00.000Z',
deletedAt: null,
__typename: 'ViewField',
},
{
id: '648faa24-cabb-482a-8578-ba3f09906017',
fieldMetadataId: personObjectMetadata?.fields.find(
(field) => field.name === 'linkedinLink',
)?.id,
viewId: mockedViewsData[1].id,
position: 7,
isVisible: true,
size: 150,
createdAt: '2021-09-01T00:00:00.000Z',
updatedAt: '2021-09-01T00:00:00.000Z',
deletedAt: null,
__typename: 'ViewField',
},
{
id: '3a9e7f0d-a4ce-4ad5-aac7-3a24eb1a412d',
fieldMetadataId: personObjectMetadata?.fields.find(
(field) => field.name === 'xLink',
)?.id,
viewId: mockedViewsData[1].id,
position: 8,
isVisible: true,
size: 150,
createdAt: '2021-09-01T00:00:00.000Z',
updatedAt: '2021-09-01T00:00:00.000Z',
deletedAt: null,
__typename: 'ViewField',
},
// Opportunities
{
id: '35a42e2d-83dd-4b57-ada6-f90616da706d',
fieldMetadataId: opportunityObjectMetadata?.fields.find(
(field) => field.name === 'name',
)?.id,
viewId: mockedViewsData[2].id,
position: 0,
isVisible: true,
size: 180,
createdAt: '2021-09-01T00:00:00.000Z',
updatedAt: '2021-09-01T00:00:00.000Z',
deletedAt: null,
__typename: 'ViewField',
},
{
id: '3159acd8-463f-458d-bf9a-af8ac6f57dc0',
fieldMetadataId: opportunityObjectMetadata?.fields.find(
(field) => field.name === 'closeDate',
)?.id,
viewId: mockedViewsData[2].id,
position: 2,
isVisible: true,
size: 100,
createdAt: '2021-09-01T00:00:00.000Z',
updatedAt: '2021-09-01T00:00:00.000Z',
deletedAt: null,
__typename: 'ViewField',
},
{
id: 'afc0819d-b694-4e3c-a2e6-25261aa3ed2c',
fieldMetadataId: opportunityObjectMetadata?.fields.find(
(field) => field.name === 'company',
)?.id,
viewId: mockedViewsData[2].id,
position: 3,
isVisible: true,
size: 150,
createdAt: '2021-09-01T00:00:00.000Z',
updatedAt: '2021-09-01T00:00:00.000Z',
deletedAt: null,
__typename: 'ViewField',
},
{
id: 'ec0507bb-aedc-4695-ba96-d81bdeb9db83',
fieldMetadataId: opportunityObjectMetadata?.fields.find(
(field) => field.name === 'createdAt',
)?.id,
viewId: mockedViewsData[2].id,
position: 4,
isVisible: true,
size: 150,
createdAt: '2021-09-01T00:00:00.000Z',
updatedAt: '2021-09-01T00:00:00.000Z',
deletedAt: null,
__typename: 'ViewField',
},
{
id: '3f1585f6-44f6-45c5-b840-bc05af5d0008',
fieldMetadataId: opportunityObjectMetadata?.fields.find(
(field) => field.name === 'pointOfContact',
)?.id,
viewId: mockedViewsData[2].id,
position: 5,
isVisible: true,
size: 150,
createdAt: '2021-09-01T00:00:00.000Z',
updatedAt: '2021-09-01T00:00:00.000Z',
deletedAt: null,
__typename: 'ViewField',
},
];
@@ -1,207 +0,0 @@
import { AggregateOperations } from '@/object-record/record-table/constants/AggregateOperations';
import { type CoreViewWithRelations } from '@/views/types/CoreViewWithRelations';
import { type View } from '@/views/types/View';
import { ViewKey } from '@/views/types/ViewKey';
import { ViewOpenRecordInType } from '@/views/types/ViewOpenRecordInType';
import { ViewType } from '@/views/types/ViewType';
import {
ViewKey as CoreViewKey,
ViewOpenRecordIn as CoreViewOpenRecordIn,
ViewType as CoreViewType,
ViewVisibility as CoreViewVisibility,
ViewVisibility,
} from '~/generated-metadata/graphql';
import { getMockObjectMetadataItemOrThrow } from '~/testing/utils/getMockObjectMetadataItemOrThrow';
const companyObjectMetadata = getMockObjectMetadataItemOrThrow('company');
const personObjectMetadata = getMockObjectMetadataItemOrThrow('person');
const opportunityObjectMetadata =
getMockObjectMetadataItemOrThrow('opportunity');
export const mockedViewsData: View[] = [
{
id: '37a8a866-eb17-4e76-9382-03143a2f6a80',
name: 'All companies',
objectMetadataId: companyObjectMetadata.id,
type: ViewType.Table,
icon: 'IconSkyline',
key: ViewKey.Index,
mainGroupByFieldMetadataId: null,
shouldHideEmptyGroups: false,
kanbanAggregateOperation: AggregateOperations.COUNT,
kanbanAggregateOperationFieldMetadataId: '',
position: 0,
isCompact: false,
openRecordIn: ViewOpenRecordInType.SIDE_PANEL,
viewFilterGroups: [],
viewGroups: [],
viewFields: [],
viewFilters: [],
viewSorts: [],
visibility: ViewVisibility.WORKSPACE,
__typename: 'View',
},
{
id: '6095799e-b48f-4e00-b071-10818083593a',
name: 'All people',
objectMetadataId: personObjectMetadata.id,
type: ViewType.Table,
icon: 'IconPerson',
key: ViewKey.Index,
mainGroupByFieldMetadataId: null,
shouldHideEmptyGroups: false,
kanbanAggregateOperation: AggregateOperations.COUNT,
kanbanAggregateOperationFieldMetadataId: '',
position: 0,
isCompact: false,
openRecordIn: ViewOpenRecordInType.SIDE_PANEL,
viewFilterGroups: [],
viewGroups: [],
viewFields: [],
viewFilters: [],
viewSorts: [],
visibility: ViewVisibility.WORKSPACE,
__typename: 'View',
},
{
id: 'e26f66b7-f890-4a5c-b4d2-ec09987b5308',
name: 'All opportunities',
objectMetadataId: opportunityObjectMetadata.id,
type: ViewType.Kanban,
icon: 'IconOpportunity',
key: ViewKey.Index,
mainGroupByFieldMetadataId: null,
shouldHideEmptyGroups: false,
kanbanAggregateOperation: AggregateOperations.COUNT,
kanbanAggregateOperationFieldMetadataId: '',
position: 0,
isCompact: false,
openRecordIn: ViewOpenRecordInType.SIDE_PANEL,
viewFilterGroups: [],
viewGroups: [],
viewFields: [],
viewFilters: [],
viewSorts: [],
visibility: ViewVisibility.WORKSPACE,
__typename: 'View',
},
{
id: '5c307222-1dd5-4ff3-ab06-8d990e9b3c74',
name: 'All companies (v2)',
objectMetadataId: companyObjectMetadata.id,
type: ViewType.Table,
icon: 'IconSkyline',
key: null,
mainGroupByFieldMetadataId: null,
shouldHideEmptyGroups: false,
kanbanAggregateOperation: AggregateOperations.COUNT,
kanbanAggregateOperationFieldMetadataId: '',
position: 0,
isCompact: false,
openRecordIn: ViewOpenRecordInType.SIDE_PANEL,
viewFilterGroups: [],
viewGroups: [],
viewFields: [],
viewFilters: [],
viewSorts: [],
visibility: ViewVisibility.WORKSPACE,
__typename: 'View',
},
];
export const mockedCoreViewsData: CoreViewWithRelations[] = [
{
id: '37a8a866-eb17-4e76-9382-03143a2f6a80',
name: 'All companies',
objectMetadataId: companyObjectMetadata.id,
type: CoreViewType.TABLE,
icon: 'IconSkyline',
key: CoreViewKey.INDEX,
shouldHideEmptyGroups: false,
kanbanAggregateOperation: AggregateOperations.COUNT,
kanbanAggregateOperationFieldMetadataId: '',
position: 0,
isCompact: false,
openRecordIn: CoreViewOpenRecordIn.SIDE_PANEL,
viewFieldGroups: [],
viewFilterGroups: [],
viewGroups: [],
viewFields: [],
viewFilters: [],
viewSorts: [],
visibility: CoreViewVisibility.WORKSPACE,
createdByUserWorkspaceId: null,
__typename: 'CoreView',
},
{
id: '6095799e-b48f-4e00-b071-10818083593a',
name: 'All people',
objectMetadataId: personObjectMetadata.id,
type: CoreViewType.TABLE,
icon: 'IconPerson',
key: CoreViewKey.INDEX,
shouldHideEmptyGroups: false,
kanbanAggregateOperation: AggregateOperations.COUNT,
kanbanAggregateOperationFieldMetadataId: '',
position: 0,
isCompact: false,
openRecordIn: CoreViewOpenRecordIn.SIDE_PANEL,
viewFieldGroups: [],
viewFilterGroups: [],
viewGroups: [],
viewFields: [],
viewFilters: [],
viewSorts: [],
visibility: CoreViewVisibility.WORKSPACE,
createdByUserWorkspaceId: null,
__typename: 'CoreView',
},
{
id: 'e26f66b7-f890-4a5c-b4d2-ec09987b5308',
name: 'All opportunities',
objectMetadataId: opportunityObjectMetadata.id,
type: CoreViewType.KANBAN,
icon: 'IconOpportunity',
key: CoreViewKey.INDEX,
shouldHideEmptyGroups: false,
kanbanAggregateOperation: AggregateOperations.COUNT,
kanbanAggregateOperationFieldMetadataId: '',
position: 0,
isCompact: false,
openRecordIn: CoreViewOpenRecordIn.SIDE_PANEL,
viewFieldGroups: [],
viewFilterGroups: [],
viewGroups: [],
viewFields: [],
viewFilters: [],
viewSorts: [],
visibility: CoreViewVisibility.WORKSPACE,
createdByUserWorkspaceId: null,
__typename: 'CoreView',
},
{
id: '5c307222-1dd5-4ff3-ab06-8d990e9b3c74',
name: 'All companies (v2)',
objectMetadataId: companyObjectMetadata.id,
type: CoreViewType.TABLE,
icon: 'IconSkyline',
key: null,
shouldHideEmptyGroups: false,
kanbanAggregateOperation: AggregateOperations.COUNT,
kanbanAggregateOperationFieldMetadataId: '',
position: 0,
isCompact: false,
openRecordIn: CoreViewOpenRecordIn.SIDE_PANEL,
viewFieldGroups: [],
viewFilterGroups: [],
viewGroups: [],
viewFields: [],
viewFilters: [],
viewSorts: [],
visibility: CoreViewVisibility.WORKSPACE,
createdByUserWorkspaceId: null,
__typename: 'CoreView',
},
];
@@ -1,70 +0,0 @@
import { type CurrentWorkspaceMember } from '@/auth/states/currentWorkspaceMemberState';
import { type WorkspaceMember } from '@/workspace-member/types/WorkspaceMember';
import {
WorkspaceMemberDateFormatEnum,
WorkspaceMemberTimeFormatEnum,
} from '~/generated-metadata/graphql';
export const mockWorkspaceMembers: WorkspaceMember[] = [
{
id: '20202020-463f-435b-828c-107e007a2711',
name: {
firstName: 'Jane',
lastName: 'Doe',
},
__typename: 'WorkspaceMember',
userEmail: 'jane.doe@twenty.com',
locale: 'en',
avatarUrl: '',
createdAt: '2023-12-18T09:51:19.645Z',
updatedAt: '2023-12-18T09:51:19.645Z',
userId: '20202020-7169-42cf-bc47-1cfef15264b8',
colorScheme: 'Light' as const,
timeZone: 'America/New_York',
dateFormat: WorkspaceMemberDateFormatEnum.DAY_FIRST,
timeFormat: WorkspaceMemberTimeFormatEnum.HOUR_24,
},
{
id: '20202020-77d5-4cb6-b60a-f4a835a85d61',
name: {
firstName: 'John',
lastName: 'Wick',
},
userEmail: 'john.wick@twenty.com',
__typename: 'WorkspaceMember',
locale: 'en',
avatarUrl: '',
createdAt: '2023-12-18T09:51:19.645Z',
updatedAt: '2023-12-18T09:51:19.645Z',
userId: '20202020-3957-4908-9c36-2929a23f8357',
colorScheme: 'Dark' as const,
timeZone: 'America/New_York',
dateFormat: WorkspaceMemberDateFormatEnum.DAY_FIRST,
timeFormat: WorkspaceMemberTimeFormatEnum.HOUR_24,
},
];
export const mockCurrentWorkspaceMembers: CurrentWorkspaceMember[] =
mockWorkspaceMembers.map(
({
id,
locale,
name,
avatarUrl,
colorScheme,
dateFormat,
timeFormat,
timeZone,
userEmail,
}) => ({
id,
locale,
name,
avatarUrl,
colorScheme,
dateFormat,
timeFormat,
timeZone,
userEmail,
}),
);