[Server Integration tests] Enrich integration GraphQL API tests (#7699)

### Description

- We are using gql instead of strings to be able to see the graphql code
highlighted

### Demo


![](https://assets-service.gitstart.com/28455/d06016b9-c62c-4e0d-bb16-3d7dd42c5b6b.png)

Fixes #7526

---------

Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
Co-authored-by: Charles Bochet <charlesBochet@users.noreply.github.com>
This commit is contained in:
gitstart-app[bot]
2024-10-17 19:16:19 +02:00
committed by GitHub
parent f08b8fda16
commit 58fd34071c
99 changed files with 3595 additions and 102 deletions

View File

@ -0,0 +1,67 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('activitiesResolver (e2e)', () => {
it('should find many activities', () => {
const queryData = {
query: `
query activities {
activities {
edges {
node {
title
body
type
reminderAt
dueAt
completedAt
id
createdAt
updatedAt
deletedAt
authorId
assigneeId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.activities;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const activities = edges[0].node;
expect(activities).toHaveProperty('title');
expect(activities).toHaveProperty('body');
expect(activities).toHaveProperty('type');
expect(activities).toHaveProperty('reminderAt');
expect(activities).toHaveProperty('dueAt');
expect(activities).toHaveProperty('completedAt');
expect(activities).toHaveProperty('id');
expect(activities).toHaveProperty('createdAt');
expect(activities).toHaveProperty('updatedAt');
expect(activities).toHaveProperty('deletedAt');
expect(activities).toHaveProperty('authorId');
expect(activities).toHaveProperty('assigneeId');
}
});
});
});

View File

@ -0,0 +1,61 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('activityTargetsResolver (e2e)', () => {
it('should find many activityTargets', () => {
const queryData = {
query: `
query activityTargets {
activityTargets {
edges {
node {
id
createdAt
updatedAt
deletedAt
activityId
personId
companyId
opportunityId
rocketId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.activityTargets;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const activityTargets = edges[0].node;
expect(activityTargets).toHaveProperty('id');
expect(activityTargets).toHaveProperty('createdAt');
expect(activityTargets).toHaveProperty('updatedAt');
expect(activityTargets).toHaveProperty('deletedAt');
expect(activityTargets).toHaveProperty('activityId');
expect(activityTargets).toHaveProperty('personId');
expect(activityTargets).toHaveProperty('companyId');
expect(activityTargets).toHaveProperty('opportunityId');
expect(activityTargets).toHaveProperty('rocketId');
}
});
});
});

View File

@ -0,0 +1,57 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('apiKeysResolver (e2e)', () => {
it('should find many apiKeys', () => {
const queryData = {
query: `
query apiKeys {
apiKeys {
edges {
node {
name
expiresAt
revokedAt
id
createdAt
updatedAt
deletedAt
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.apiKeys;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const apiKeys = edges[0].node;
expect(apiKeys).toHaveProperty('name');
expect(apiKeys).toHaveProperty('expiresAt');
expect(apiKeys).toHaveProperty('revokedAt');
expect(apiKeys).toHaveProperty('id');
expect(apiKeys).toHaveProperty('createdAt');
expect(apiKeys).toHaveProperty('updatedAt');
expect(apiKeys).toHaveProperty('deletedAt');
}
});
});
});

View File

@ -0,0 +1,73 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('attachmentsResolver (e2e)', () => {
it('should find many attachments', () => {
const queryData = {
query: `
query attachments {
attachments {
edges {
node {
name
fullPath
type
id
createdAt
updatedAt
deletedAt
authorId
activityId
taskId
noteId
personId
companyId
opportunityId
rocketId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.attachments;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const attachments = edges[0].node;
expect(attachments).toHaveProperty('name');
expect(attachments).toHaveProperty('fullPath');
expect(attachments).toHaveProperty('type');
expect(attachments).toHaveProperty('id');
expect(attachments).toHaveProperty('createdAt');
expect(attachments).toHaveProperty('updatedAt');
expect(attachments).toHaveProperty('deletedAt');
expect(attachments).toHaveProperty('authorId');
expect(attachments).toHaveProperty('activityId');
expect(attachments).toHaveProperty('taskId');
expect(attachments).toHaveProperty('noteId');
expect(attachments).toHaveProperty('personId');
expect(attachments).toHaveProperty('companyId');
expect(attachments).toHaveProperty('opportunityId');
expect(attachments).toHaveProperty('rocketId');
}
});
});
});

View File

@ -0,0 +1,65 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('auditLogsResolver (e2e)', () => {
it('should find many auditLogs', () => {
const queryData = {
query: `
query auditLogs {
auditLogs {
edges {
node {
name
properties
context
objectName
objectMetadataId
recordId
id
createdAt
updatedAt
deletedAt
workspaceMemberId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.auditLogs;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const auditLogs = edges[0].node;
expect(auditLogs).toHaveProperty('name');
expect(auditLogs).toHaveProperty('properties');
expect(auditLogs).toHaveProperty('context');
expect(auditLogs).toHaveProperty('objectName');
expect(auditLogs).toHaveProperty('objectMetadataId');
expect(auditLogs).toHaveProperty('recordId');
expect(auditLogs).toHaveProperty('id');
expect(auditLogs).toHaveProperty('createdAt');
expect(auditLogs).toHaveProperty('updatedAt');
expect(auditLogs).toHaveProperty('deletedAt');
expect(auditLogs).toHaveProperty('workspaceMemberId');
}
});
});
});

View File

@ -0,0 +1,55 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('blocklistsResolver (e2e)', () => {
it('should find many blocklists', () => {
const queryData = {
query: `
query blocklists {
blocklists {
edges {
node {
handle
id
createdAt
updatedAt
deletedAt
workspaceMemberId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.blocklists;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const blocklists = edges[0].node;
expect(blocklists).toHaveProperty('handle');
expect(blocklists).toHaveProperty('id');
expect(blocklists).toHaveProperty('createdAt');
expect(blocklists).toHaveProperty('updatedAt');
expect(blocklists).toHaveProperty('deletedAt');
expect(blocklists).toHaveProperty('workspaceMemberId');
}
});
});
});

View File

@ -0,0 +1,67 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('calendarChannelEventAssociationsResolver (e2e)', () => {
it('should find many calendarChannelEventAssociations', () => {
const queryData = {
query: `
query calendarChannelEventAssociations {
calendarChannelEventAssociations {
edges {
node {
eventExternalId
recurringEventExternalId
id
createdAt
updatedAt
deletedAt
calendarChannelId
calendarEventId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.calendarChannelEventAssociations;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const calendarChannelEventAssociations = edges[0].node;
expect(calendarChannelEventAssociations).toHaveProperty(
'eventExternalId',
);
expect(calendarChannelEventAssociations).toHaveProperty(
'recurringEventExternalId',
);
expect(calendarChannelEventAssociations).toHaveProperty('id');
expect(calendarChannelEventAssociations).toHaveProperty('createdAt');
expect(calendarChannelEventAssociations).toHaveProperty('updatedAt');
expect(calendarChannelEventAssociations).toHaveProperty('deletedAt');
expect(calendarChannelEventAssociations).toHaveProperty(
'calendarChannelId',
);
expect(calendarChannelEventAssociations).toHaveProperty(
'calendarEventId',
);
}
});
});
});

View File

@ -0,0 +1,77 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('calendarChannelsResolver (e2e)', () => {
it('should find many calendarChannels', () => {
const queryData = {
query: `
query calendarChannels {
calendarChannels {
edges {
node {
handle
syncStatus
syncStage
visibility
isContactAutoCreationEnabled
contactAutoCreationPolicy
isSyncEnabled
syncCursor
syncedAt
syncStageStartedAt
throttleFailureCount
id
createdAt
updatedAt
deletedAt
connectedAccountId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.calendarChannels;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const calendarChannels = edges[0].node;
expect(calendarChannels).toHaveProperty('handle');
expect(calendarChannels).toHaveProperty('syncStatus');
expect(calendarChannels).toHaveProperty('syncStage');
expect(calendarChannels).toHaveProperty('visibility');
expect(calendarChannels).toHaveProperty(
'isContactAutoCreationEnabled',
);
expect(calendarChannels).toHaveProperty('contactAutoCreationPolicy');
expect(calendarChannels).toHaveProperty('isSyncEnabled');
expect(calendarChannels).toHaveProperty('syncCursor');
expect(calendarChannels).toHaveProperty('syncedAt');
expect(calendarChannels).toHaveProperty('syncStageStartedAt');
expect(calendarChannels).toHaveProperty('throttleFailureCount');
expect(calendarChannels).toHaveProperty('id');
expect(calendarChannels).toHaveProperty('createdAt');
expect(calendarChannels).toHaveProperty('updatedAt');
expect(calendarChannels).toHaveProperty('deletedAt');
expect(calendarChannels).toHaveProperty('connectedAccountId');
}
});
});
});

View File

@ -0,0 +1,65 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('calendarEventParticipantsResolver (e2e)', () => {
it('should find many calendarEventParticipants', () => {
const queryData = {
query: `
query calendarEventParticipants {
calendarEventParticipants {
edges {
node {
handle
displayName
isOrganizer
responseStatus
id
createdAt
updatedAt
deletedAt
calendarEventId
personId
workspaceMemberId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.calendarEventParticipants;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const calendarEventParticipants = edges[0].node;
expect(calendarEventParticipants).toHaveProperty('handle');
expect(calendarEventParticipants).toHaveProperty('displayName');
expect(calendarEventParticipants).toHaveProperty('isOrganizer');
expect(calendarEventParticipants).toHaveProperty('responseStatus');
expect(calendarEventParticipants).toHaveProperty('id');
expect(calendarEventParticipants).toHaveProperty('createdAt');
expect(calendarEventParticipants).toHaveProperty('updatedAt');
expect(calendarEventParticipants).toHaveProperty('deletedAt');
expect(calendarEventParticipants).toHaveProperty('calendarEventId');
expect(calendarEventParticipants).toHaveProperty('personId');
expect(calendarEventParticipants).toHaveProperty('workspaceMemberId');
}
});
});
});

View File

@ -0,0 +1,57 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('commentsResolver (e2e)', () => {
it('should find many comments', () => {
const queryData = {
query: `
query comments {
comments {
edges {
node {
body
id
createdAt
updatedAt
deletedAt
authorId
activityId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.comments;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const comments = edges[0].node;
expect(comments).toHaveProperty('body');
expect(comments).toHaveProperty('id');
expect(comments).toHaveProperty('createdAt');
expect(comments).toHaveProperty('updatedAt');
expect(comments).toHaveProperty('deletedAt');
expect(comments).toHaveProperty('authorId');
expect(comments).toHaveProperty('activityId');
}
});
});
});

View File

@ -0,0 +1,69 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('companiesResolver (e2e)', () => {
it('should find many companies', () => {
const queryData = {
query: `
query companies {
companies {
edges {
node {
name
employees
idealCustomerProfile
position
searchVector
id
createdAt
updatedAt
deletedAt
accountOwnerId
tagline
workPolicy
visaSponsorship
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.companies;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const companies = edges[0].node;
expect(companies).toHaveProperty('name');
expect(companies).toHaveProperty('employees');
expect(companies).toHaveProperty('idealCustomerProfile');
expect(companies).toHaveProperty('position');
expect(companies).toHaveProperty('searchVector');
expect(companies).toHaveProperty('id');
expect(companies).toHaveProperty('createdAt');
expect(companies).toHaveProperty('updatedAt');
expect(companies).toHaveProperty('deletedAt');
expect(companies).toHaveProperty('accountOwnerId');
expect(companies).toHaveProperty('tagline');
expect(companies).toHaveProperty('workPolicy');
expect(companies).toHaveProperty('visaSponsorship');
}
});
});
});

View File

@ -0,0 +1,69 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('connectedAccountsResolver (e2e)', () => {
it('should find many connectedAccounts', () => {
const queryData = {
query: `
query connectedAccounts {
connectedAccounts {
edges {
node {
handle
provider
accessToken
refreshToken
lastSyncHistoryId
authFailedAt
handleAliases
scopes
id
createdAt
updatedAt
deletedAt
accountOwnerId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.connectedAccounts;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const connectedAccounts = edges[0].node;
expect(connectedAccounts).toHaveProperty('handle');
expect(connectedAccounts).toHaveProperty('provider');
expect(connectedAccounts).toHaveProperty('accessToken');
expect(connectedAccounts).toHaveProperty('refreshToken');
expect(connectedAccounts).toHaveProperty('lastSyncHistoryId');
expect(connectedAccounts).toHaveProperty('authFailedAt');
expect(connectedAccounts).toHaveProperty('handleAliases');
expect(connectedAccounts).toHaveProperty('scopes');
expect(connectedAccounts).toHaveProperty('id');
expect(connectedAccounts).toHaveProperty('createdAt');
expect(connectedAccounts).toHaveProperty('updatedAt');
expect(connectedAccounts).toHaveProperty('deletedAt');
expect(connectedAccounts).toHaveProperty('accountOwnerId');
}
});
});
});

View File

@ -0,0 +1,75 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('favoritesResolver (e2e)', () => {
it('should find many favorites', () => {
const queryData = {
query: `
query favorites {
favorites {
edges {
node {
position
id
createdAt
updatedAt
deletedAt
workspaceMemberId
personId
companyId
opportunityId
workflowId
workflowVersionId
workflowRunId
taskId
noteId
viewId
rocketId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.favorites;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const favorites = edges[0].node;
expect(favorites).toHaveProperty('position');
expect(favorites).toHaveProperty('id');
expect(favorites).toHaveProperty('createdAt');
expect(favorites).toHaveProperty('updatedAt');
expect(favorites).toHaveProperty('deletedAt');
expect(favorites).toHaveProperty('workspaceMemberId');
expect(favorites).toHaveProperty('personId');
expect(favorites).toHaveProperty('companyId');
expect(favorites).toHaveProperty('opportunityId');
expect(favorites).toHaveProperty('workflowId');
expect(favorites).toHaveProperty('workflowVersionId');
expect(favorites).toHaveProperty('workflowRunId');
expect(favorites).toHaveProperty('taskId');
expect(favorites).toHaveProperty('noteId');
expect(favorites).toHaveProperty('viewId');
expect(favorites).toHaveProperty('rocketId');
}
});
});
});

View File

@ -0,0 +1,59 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('indexMetadatasResolver (e2e)', () => {
it('should find many indexMetadatas', () => {
const queryData = {
query: `
query indexMetadatas {
indexMetadatas {
edges {
node {
id
name
isCustom
isUnique
indexWhereClause
indexType
createdAt
updatedAt
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.indexMetadatas;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const indexMetadatas = edges[0].node;
expect(indexMetadatas).toHaveProperty('id');
expect(indexMetadatas).toHaveProperty('name');
expect(indexMetadatas).toHaveProperty('isCustom');
expect(indexMetadatas).toHaveProperty('isUnique');
expect(indexMetadatas).toHaveProperty('indexWhereClause');
expect(indexMetadatas).toHaveProperty('indexType');
expect(indexMetadatas).toHaveProperty('createdAt');
expect(indexMetadatas).toHaveProperty('updatedAt');
}
});
});
});

View File

@ -0,0 +1,67 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('messageChannelMessageAssociationsResolver (e2e)', () => {
it('should find many messageChannelMessageAssociations', () => {
const queryData = {
query: `
query messageChannelMessageAssociations {
messageChannelMessageAssociations {
edges {
node {
messageExternalId
messageThreadExternalId
direction
id
createdAt
updatedAt
deletedAt
messageChannelId
messageId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.messageChannelMessageAssociations;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const messageChannelMessageAssociations = edges[0].node;
expect(messageChannelMessageAssociations).toHaveProperty(
'messageExternalId',
);
expect(messageChannelMessageAssociations).toHaveProperty(
'messageThreadExternalId',
);
expect(messageChannelMessageAssociations).toHaveProperty('direction');
expect(messageChannelMessageAssociations).toHaveProperty('id');
expect(messageChannelMessageAssociations).toHaveProperty('createdAt');
expect(messageChannelMessageAssociations).toHaveProperty('updatedAt');
expect(messageChannelMessageAssociations).toHaveProperty('deletedAt');
expect(messageChannelMessageAssociations).toHaveProperty(
'messageChannelId',
);
expect(messageChannelMessageAssociations).toHaveProperty('messageId');
}
});
});
});

View File

@ -0,0 +1,85 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('messageChannelsResolver (e2e)', () => {
it('should find many messageChannels', () => {
const queryData = {
query: `
query messageChannels {
messageChannels {
edges {
node {
visibility
handle
type
isContactAutoCreationEnabled
contactAutoCreationPolicy
excludeNonProfessionalEmails
excludeGroupEmails
isSyncEnabled
syncCursor
syncedAt
syncStatus
syncStage
syncStageStartedAt
throttleFailureCount
id
createdAt
updatedAt
deletedAt
connectedAccountId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.messageChannels;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const messageChannels = edges[0].node;
expect(messageChannels).toHaveProperty('visibility');
expect(messageChannels).toHaveProperty('handle');
expect(messageChannels).toHaveProperty('type');
expect(messageChannels).toHaveProperty(
'isContactAutoCreationEnabled',
);
expect(messageChannels).toHaveProperty('contactAutoCreationPolicy');
expect(messageChannels).toHaveProperty(
'excludeNonProfessionalEmails',
);
expect(messageChannels).toHaveProperty('excludeGroupEmails');
expect(messageChannels).toHaveProperty('isSyncEnabled');
expect(messageChannels).toHaveProperty('syncCursor');
expect(messageChannels).toHaveProperty('syncedAt');
expect(messageChannels).toHaveProperty('syncStatus');
expect(messageChannels).toHaveProperty('syncStage');
expect(messageChannels).toHaveProperty('syncStageStartedAt');
expect(messageChannels).toHaveProperty('throttleFailureCount');
expect(messageChannels).toHaveProperty('id');
expect(messageChannels).toHaveProperty('createdAt');
expect(messageChannels).toHaveProperty('updatedAt');
expect(messageChannels).toHaveProperty('deletedAt');
expect(messageChannels).toHaveProperty('connectedAccountId');
}
});
});
});

View File

@ -0,0 +1,63 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('messageParticipantsResolver (e2e)', () => {
it('should find many messageParticipants', () => {
const queryData = {
query: `
query messageParticipants {
messageParticipants {
edges {
node {
role
handle
displayName
id
createdAt
updatedAt
deletedAt
messageId
personId
workspaceMemberId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.messageParticipants;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const messageParticipants = edges[0].node;
expect(messageParticipants).toHaveProperty('role');
expect(messageParticipants).toHaveProperty('handle');
expect(messageParticipants).toHaveProperty('displayName');
expect(messageParticipants).toHaveProperty('id');
expect(messageParticipants).toHaveProperty('createdAt');
expect(messageParticipants).toHaveProperty('updatedAt');
expect(messageParticipants).toHaveProperty('deletedAt');
expect(messageParticipants).toHaveProperty('messageId');
expect(messageParticipants).toHaveProperty('personId');
expect(messageParticipants).toHaveProperty('workspaceMemberId');
}
});
});
});

View File

@ -0,0 +1,51 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('messageThreadsResolver (e2e)', () => {
it('should find many messageThreads', () => {
const queryData = {
query: `
query messageThreads {
messageThreads {
edges {
node {
id
createdAt
updatedAt
deletedAt
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.messageThreads;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const messageThreads = edges[0].node;
expect(messageThreads).toHaveProperty('id');
expect(messageThreads).toHaveProperty('createdAt');
expect(messageThreads).toHaveProperty('updatedAt');
expect(messageThreads).toHaveProperty('deletedAt');
}
});
});
});

View File

@ -0,0 +1,61 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('noteTargetsResolver (e2e)', () => {
it('should find many noteTargets', () => {
const queryData = {
query: `
query noteTargets {
noteTargets {
edges {
node {
id
createdAt
updatedAt
deletedAt
noteId
personId
companyId
opportunityId
rocketId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.noteTargets;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const noteTargets = edges[0].node;
expect(noteTargets).toHaveProperty('id');
expect(noteTargets).toHaveProperty('createdAt');
expect(noteTargets).toHaveProperty('updatedAt');
expect(noteTargets).toHaveProperty('deletedAt');
expect(noteTargets).toHaveProperty('noteId');
expect(noteTargets).toHaveProperty('personId');
expect(noteTargets).toHaveProperty('companyId');
expect(noteTargets).toHaveProperty('opportunityId');
expect(noteTargets).toHaveProperty('rocketId');
}
});
});
});

View File

@ -0,0 +1,57 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('notesResolver (e2e)', () => {
it('should find many notes', () => {
const queryData = {
query: `
query notes {
notes {
edges {
node {
position
title
body
id
createdAt
updatedAt
deletedAt
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.notes;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const notes = edges[0].node;
expect(notes).toHaveProperty('position');
expect(notes).toHaveProperty('title');
expect(notes).toHaveProperty('body');
expect(notes).toHaveProperty('id');
expect(notes).toHaveProperty('createdAt');
expect(notes).toHaveProperty('updatedAt');
expect(notes).toHaveProperty('deletedAt');
}
});
});
});

View File

@ -0,0 +1,75 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('objectsResolver (e2e)', () => {
it('should find many objects', () => {
const queryData = {
query: `
query objects {
objects {
edges {
node {
id
dataSourceId
nameSingular
namePlural
labelSingular
labelPlural
description
icon
isCustom
isRemote
isActive
isSystem
createdAt
updatedAt
labelIdentifierFieldMetadataId
imageIdentifierFieldMetadataId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.objects;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const objects = edges[0].node;
expect(objects).toHaveProperty('id');
expect(objects).toHaveProperty('dataSourceId');
expect(objects).toHaveProperty('nameSingular');
expect(objects).toHaveProperty('namePlural');
expect(objects).toHaveProperty('labelSingular');
expect(objects).toHaveProperty('labelPlural');
expect(objects).toHaveProperty('description');
expect(objects).toHaveProperty('icon');
expect(objects).toHaveProperty('isCustom');
expect(objects).toHaveProperty('isRemote');
expect(objects).toHaveProperty('isActive');
expect(objects).toHaveProperty('isSystem');
expect(objects).toHaveProperty('createdAt');
expect(objects).toHaveProperty('updatedAt');
expect(objects).toHaveProperty('labelIdentifierFieldMetadataId');
expect(objects).toHaveProperty('imageIdentifierFieldMetadataId');
}
});
});
});

View File

@ -0,0 +1,65 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('opportunitiesResolver (e2e)', () => {
it('should find many opportunities', () => {
const queryData = {
query: `
query opportunities {
opportunities {
edges {
node {
name
closeDate
stage
position
searchVector
id
createdAt
updatedAt
deletedAt
pointOfContactId
companyId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.opportunities;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const opportunities = edges[0].node;
expect(opportunities).toHaveProperty('name');
expect(opportunities).toHaveProperty('closeDate');
expect(opportunities).toHaveProperty('stage');
expect(opportunities).toHaveProperty('position');
expect(opportunities).toHaveProperty('searchVector');
expect(opportunities).toHaveProperty('id');
expect(opportunities).toHaveProperty('createdAt');
expect(opportunities).toHaveProperty('updatedAt');
expect(opportunities).toHaveProperty('deletedAt');
expect(opportunities).toHaveProperty('pointOfContactId');
expect(opportunities).toHaveProperty('companyId');
}
});
});
});

View File

@ -0,0 +1,69 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('peopleResolver (e2e)', () => {
it('should find many people', () => {
const queryData = {
query: `
query people {
people {
edges {
node {
jobTitle
city
avatarUrl
position
searchVector
id
createdAt
updatedAt
deletedAt
companyId
intro
workPreference
performanceRating
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.people;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const people = edges[0].node;
expect(people).toHaveProperty('jobTitle');
expect(people).toHaveProperty('city');
expect(people).toHaveProperty('avatarUrl');
expect(people).toHaveProperty('position');
expect(people).toHaveProperty('searchVector');
expect(people).toHaveProperty('id');
expect(people).toHaveProperty('createdAt');
expect(people).toHaveProperty('updatedAt');
expect(people).toHaveProperty('deletedAt');
expect(people).toHaveProperty('companyId');
expect(people).toHaveProperty('intro');
expect(people).toHaveProperty('workPreference');
expect(people).toHaveProperty('performanceRating');
}
});
});
});

View File

@ -0,0 +1,57 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('rocketsResolver (e2e)', () => {
it('should find many rockets', () => {
const queryData = {
query: `
query rockets {
rockets {
edges {
node {
id
name
createdAt
updatedAt
deletedAt
position
searchVector
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.rockets;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const rockets = edges[0].node;
expect(rockets).toHaveProperty('id');
expect(rockets).toHaveProperty('name');
expect(rockets).toHaveProperty('createdAt');
expect(rockets).toHaveProperty('updatedAt');
expect(rockets).toHaveProperty('deletedAt');
expect(rockets).toHaveProperty('position');
expect(rockets).toHaveProperty('searchVector');
}
});
});
});

View File

@ -0,0 +1,67 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchActivitiesResolver (e2e)', () => {
it('should find many searchActivities', () => {
const queryData = {
query: `
query searchActivities {
searchActivities {
edges {
node {
title
body
type
reminderAt
dueAt
completedAt
id
createdAt
updatedAt
deletedAt
authorId
assigneeId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchActivities;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchActivities = edges[0].node;
expect(searchActivities).toHaveProperty('title');
expect(searchActivities).toHaveProperty('body');
expect(searchActivities).toHaveProperty('type');
expect(searchActivities).toHaveProperty('reminderAt');
expect(searchActivities).toHaveProperty('dueAt');
expect(searchActivities).toHaveProperty('completedAt');
expect(searchActivities).toHaveProperty('id');
expect(searchActivities).toHaveProperty('createdAt');
expect(searchActivities).toHaveProperty('updatedAt');
expect(searchActivities).toHaveProperty('deletedAt');
expect(searchActivities).toHaveProperty('authorId');
expect(searchActivities).toHaveProperty('assigneeId');
}
});
});
});

View File

@ -0,0 +1,61 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchActivityTargetsResolver (e2e)', () => {
it('should find many searchActivityTargets', () => {
const queryData = {
query: `
query searchActivityTargets {
searchActivityTargets {
edges {
node {
id
createdAt
updatedAt
deletedAt
activityId
personId
companyId
opportunityId
rocketId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchActivityTargets;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchActivityTargets = edges[0].node;
expect(searchActivityTargets).toHaveProperty('id');
expect(searchActivityTargets).toHaveProperty('createdAt');
expect(searchActivityTargets).toHaveProperty('updatedAt');
expect(searchActivityTargets).toHaveProperty('deletedAt');
expect(searchActivityTargets).toHaveProperty('activityId');
expect(searchActivityTargets).toHaveProperty('personId');
expect(searchActivityTargets).toHaveProperty('companyId');
expect(searchActivityTargets).toHaveProperty('opportunityId');
expect(searchActivityTargets).toHaveProperty('rocketId');
}
});
});
});

View File

@ -0,0 +1,57 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchApiKeysResolver (e2e)', () => {
it('should find many searchApiKeys', () => {
const queryData = {
query: `
query searchApiKeys {
searchApiKeys {
edges {
node {
name
expiresAt
revokedAt
id
createdAt
updatedAt
deletedAt
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchApiKeys;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchApiKeys = edges[0].node;
expect(searchApiKeys).toHaveProperty('name');
expect(searchApiKeys).toHaveProperty('expiresAt');
expect(searchApiKeys).toHaveProperty('revokedAt');
expect(searchApiKeys).toHaveProperty('id');
expect(searchApiKeys).toHaveProperty('createdAt');
expect(searchApiKeys).toHaveProperty('updatedAt');
expect(searchApiKeys).toHaveProperty('deletedAt');
}
});
});
});

View File

@ -0,0 +1,73 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchAttachmentsResolver (e2e)', () => {
it('should find many searchAttachments', () => {
const queryData = {
query: `
query searchAttachments {
searchAttachments {
edges {
node {
name
fullPath
type
id
createdAt
updatedAt
deletedAt
authorId
activityId
taskId
noteId
personId
companyId
opportunityId
rocketId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchAttachments;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchAttachments = edges[0].node;
expect(searchAttachments).toHaveProperty('name');
expect(searchAttachments).toHaveProperty('fullPath');
expect(searchAttachments).toHaveProperty('type');
expect(searchAttachments).toHaveProperty('id');
expect(searchAttachments).toHaveProperty('createdAt');
expect(searchAttachments).toHaveProperty('updatedAt');
expect(searchAttachments).toHaveProperty('deletedAt');
expect(searchAttachments).toHaveProperty('authorId');
expect(searchAttachments).toHaveProperty('activityId');
expect(searchAttachments).toHaveProperty('taskId');
expect(searchAttachments).toHaveProperty('noteId');
expect(searchAttachments).toHaveProperty('personId');
expect(searchAttachments).toHaveProperty('companyId');
expect(searchAttachments).toHaveProperty('opportunityId');
expect(searchAttachments).toHaveProperty('rocketId');
}
});
});
});

View File

@ -0,0 +1,65 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchAuditLogsResolver (e2e)', () => {
it('should find many searchAuditLogs', () => {
const queryData = {
query: `
query searchAuditLogs {
searchAuditLogs {
edges {
node {
name
properties
context
objectName
objectMetadataId
recordId
id
createdAt
updatedAt
deletedAt
workspaceMemberId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchAuditLogs;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchAuditLogs = edges[0].node;
expect(searchAuditLogs).toHaveProperty('name');
expect(searchAuditLogs).toHaveProperty('properties');
expect(searchAuditLogs).toHaveProperty('context');
expect(searchAuditLogs).toHaveProperty('objectName');
expect(searchAuditLogs).toHaveProperty('objectMetadataId');
expect(searchAuditLogs).toHaveProperty('recordId');
expect(searchAuditLogs).toHaveProperty('id');
expect(searchAuditLogs).toHaveProperty('createdAt');
expect(searchAuditLogs).toHaveProperty('updatedAt');
expect(searchAuditLogs).toHaveProperty('deletedAt');
expect(searchAuditLogs).toHaveProperty('workspaceMemberId');
}
});
});
});

View File

@ -0,0 +1,55 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchBlocklistsResolver (e2e)', () => {
it('should find many searchBlocklists', () => {
const queryData = {
query: `
query searchBlocklists {
searchBlocklists {
edges {
node {
handle
id
createdAt
updatedAt
deletedAt
workspaceMemberId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchBlocklists;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchBlocklists = edges[0].node;
expect(searchBlocklists).toHaveProperty('handle');
expect(searchBlocklists).toHaveProperty('id');
expect(searchBlocklists).toHaveProperty('createdAt');
expect(searchBlocklists).toHaveProperty('updatedAt');
expect(searchBlocklists).toHaveProperty('deletedAt');
expect(searchBlocklists).toHaveProperty('workspaceMemberId');
}
});
});
});

View File

@ -0,0 +1,73 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchCalendarChannelEventAssociationsResolver (e2e)', () => {
it('should find many searchCalendarChannelEventAssociations', () => {
const queryData = {
query: `
query searchCalendarChannelEventAssociations {
searchCalendarChannelEventAssociations {
edges {
node {
eventExternalId
recurringEventExternalId
id
createdAt
updatedAt
deletedAt
calendarChannelId
calendarEventId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchCalendarChannelEventAssociations;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchCalendarChannelEventAssociations = edges[0].node;
expect(searchCalendarChannelEventAssociations).toHaveProperty(
'eventExternalId',
);
expect(searchCalendarChannelEventAssociations).toHaveProperty(
'recurringEventExternalId',
);
expect(searchCalendarChannelEventAssociations).toHaveProperty('id');
expect(searchCalendarChannelEventAssociations).toHaveProperty(
'createdAt',
);
expect(searchCalendarChannelEventAssociations).toHaveProperty(
'updatedAt',
);
expect(searchCalendarChannelEventAssociations).toHaveProperty(
'deletedAt',
);
expect(searchCalendarChannelEventAssociations).toHaveProperty(
'calendarChannelId',
);
expect(searchCalendarChannelEventAssociations).toHaveProperty(
'calendarEventId',
);
}
});
});
});

View File

@ -0,0 +1,79 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchCalendarChannelsResolver (e2e)', () => {
it('should find many searchCalendarChannels', () => {
const queryData = {
query: `
query searchCalendarChannels {
searchCalendarChannels {
edges {
node {
handle
syncStatus
syncStage
visibility
isContactAutoCreationEnabled
contactAutoCreationPolicy
isSyncEnabled
syncCursor
syncedAt
syncStageStartedAt
throttleFailureCount
id
createdAt
updatedAt
deletedAt
connectedAccountId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchCalendarChannels;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchCalendarChannels = edges[0].node;
expect(searchCalendarChannels).toHaveProperty('handle');
expect(searchCalendarChannels).toHaveProperty('syncStatus');
expect(searchCalendarChannels).toHaveProperty('syncStage');
expect(searchCalendarChannels).toHaveProperty('visibility');
expect(searchCalendarChannels).toHaveProperty(
'isContactAutoCreationEnabled',
);
expect(searchCalendarChannels).toHaveProperty(
'contactAutoCreationPolicy',
);
expect(searchCalendarChannels).toHaveProperty('isSyncEnabled');
expect(searchCalendarChannels).toHaveProperty('syncCursor');
expect(searchCalendarChannels).toHaveProperty('syncedAt');
expect(searchCalendarChannels).toHaveProperty('syncStageStartedAt');
expect(searchCalendarChannels).toHaveProperty('throttleFailureCount');
expect(searchCalendarChannels).toHaveProperty('id');
expect(searchCalendarChannels).toHaveProperty('createdAt');
expect(searchCalendarChannels).toHaveProperty('updatedAt');
expect(searchCalendarChannels).toHaveProperty('deletedAt');
expect(searchCalendarChannels).toHaveProperty('connectedAccountId');
}
});
});
});

View File

@ -0,0 +1,71 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchCalendarEventParticipantsResolver (e2e)', () => {
it('should find many searchCalendarEventParticipants', () => {
const queryData = {
query: `
query searchCalendarEventParticipants {
searchCalendarEventParticipants {
edges {
node {
handle
displayName
isOrganizer
responseStatus
id
createdAt
updatedAt
deletedAt
calendarEventId
personId
workspaceMemberId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchCalendarEventParticipants;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchCalendarEventParticipants = edges[0].node;
expect(searchCalendarEventParticipants).toHaveProperty('handle');
expect(searchCalendarEventParticipants).toHaveProperty('displayName');
expect(searchCalendarEventParticipants).toHaveProperty('isOrganizer');
expect(searchCalendarEventParticipants).toHaveProperty(
'responseStatus',
);
expect(searchCalendarEventParticipants).toHaveProperty('id');
expect(searchCalendarEventParticipants).toHaveProperty('createdAt');
expect(searchCalendarEventParticipants).toHaveProperty('updatedAt');
expect(searchCalendarEventParticipants).toHaveProperty('deletedAt');
expect(searchCalendarEventParticipants).toHaveProperty(
'calendarEventId',
);
expect(searchCalendarEventParticipants).toHaveProperty('personId');
expect(searchCalendarEventParticipants).toHaveProperty(
'workspaceMemberId',
);
}
});
});
});

View File

@ -0,0 +1,73 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchCalendarEventsResolver (e2e)', () => {
it('should find many searchCalendarEvents', () => {
const queryData = {
query: `
query searchCalendarEvents {
searchCalendarEvents {
edges {
node {
title
isCanceled
isFullDay
startsAt
endsAt
externalCreatedAt
externalUpdatedAt
description
location
iCalUID
conferenceSolution
id
createdAt
updatedAt
deletedAt
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchCalendarEvents;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchCalendarEvents = edges[0].node;
expect(searchCalendarEvents).toHaveProperty('title');
expect(searchCalendarEvents).toHaveProperty('isCanceled');
expect(searchCalendarEvents).toHaveProperty('isFullDay');
expect(searchCalendarEvents).toHaveProperty('startsAt');
expect(searchCalendarEvents).toHaveProperty('endsAt');
expect(searchCalendarEvents).toHaveProperty('externalCreatedAt');
expect(searchCalendarEvents).toHaveProperty('externalUpdatedAt');
expect(searchCalendarEvents).toHaveProperty('description');
expect(searchCalendarEvents).toHaveProperty('location');
expect(searchCalendarEvents).toHaveProperty('iCalUID');
expect(searchCalendarEvents).toHaveProperty('conferenceSolution');
expect(searchCalendarEvents).toHaveProperty('id');
expect(searchCalendarEvents).toHaveProperty('createdAt');
expect(searchCalendarEvents).toHaveProperty('updatedAt');
expect(searchCalendarEvents).toHaveProperty('deletedAt');
}
});
});
});

View File

@ -0,0 +1,57 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchCommentsResolver (e2e)', () => {
it('should find many searchComments', () => {
const queryData = {
query: `
query searchComments {
searchComments {
edges {
node {
body
id
createdAt
updatedAt
deletedAt
authorId
activityId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchComments;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchComments = edges[0].node;
expect(searchComments).toHaveProperty('body');
expect(searchComments).toHaveProperty('id');
expect(searchComments).toHaveProperty('createdAt');
expect(searchComments).toHaveProperty('updatedAt');
expect(searchComments).toHaveProperty('deletedAt');
expect(searchComments).toHaveProperty('authorId');
expect(searchComments).toHaveProperty('activityId');
}
});
});
});

View File

@ -0,0 +1,69 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchCompaniesResolver (e2e)', () => {
it('should find many searchCompanies', () => {
const queryData = {
query: `
query searchCompanies {
searchCompanies {
edges {
node {
name
employees
idealCustomerProfile
position
searchVector
id
createdAt
updatedAt
deletedAt
accountOwnerId
tagline
workPolicy
visaSponsorship
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchCompanies;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchCompanies = edges[0].node;
expect(searchCompanies).toHaveProperty('name');
expect(searchCompanies).toHaveProperty('employees');
expect(searchCompanies).toHaveProperty('idealCustomerProfile');
expect(searchCompanies).toHaveProperty('position');
expect(searchCompanies).toHaveProperty('searchVector');
expect(searchCompanies).toHaveProperty('id');
expect(searchCompanies).toHaveProperty('createdAt');
expect(searchCompanies).toHaveProperty('updatedAt');
expect(searchCompanies).toHaveProperty('deletedAt');
expect(searchCompanies).toHaveProperty('accountOwnerId');
expect(searchCompanies).toHaveProperty('tagline');
expect(searchCompanies).toHaveProperty('workPolicy');
expect(searchCompanies).toHaveProperty('visaSponsorship');
}
});
});
});

View File

@ -0,0 +1,69 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchConnectedAccountsResolver (e2e)', () => {
it('should find many searchConnectedAccounts', () => {
const queryData = {
query: `
query searchConnectedAccounts {
searchConnectedAccounts {
edges {
node {
handle
provider
accessToken
refreshToken
lastSyncHistoryId
authFailedAt
handleAliases
scopes
id
createdAt
updatedAt
deletedAt
accountOwnerId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchConnectedAccounts;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchConnectedAccounts = edges[0].node;
expect(searchConnectedAccounts).toHaveProperty('handle');
expect(searchConnectedAccounts).toHaveProperty('provider');
expect(searchConnectedAccounts).toHaveProperty('accessToken');
expect(searchConnectedAccounts).toHaveProperty('refreshToken');
expect(searchConnectedAccounts).toHaveProperty('lastSyncHistoryId');
expect(searchConnectedAccounts).toHaveProperty('authFailedAt');
expect(searchConnectedAccounts).toHaveProperty('handleAliases');
expect(searchConnectedAccounts).toHaveProperty('scopes');
expect(searchConnectedAccounts).toHaveProperty('id');
expect(searchConnectedAccounts).toHaveProperty('createdAt');
expect(searchConnectedAccounts).toHaveProperty('updatedAt');
expect(searchConnectedAccounts).toHaveProperty('deletedAt');
expect(searchConnectedAccounts).toHaveProperty('accountOwnerId');
}
});
});
});

View File

@ -0,0 +1,75 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchFavoritesResolver (e2e)', () => {
it('should find many searchFavorites', () => {
const queryData = {
query: `
query searchFavorites {
searchFavorites {
edges {
node {
position
id
createdAt
updatedAt
deletedAt
workspaceMemberId
personId
companyId
opportunityId
workflowId
workflowVersionId
workflowRunId
taskId
noteId
viewId
rocketId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchFavorites;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchFavorites = edges[0].node;
expect(searchFavorites).toHaveProperty('position');
expect(searchFavorites).toHaveProperty('id');
expect(searchFavorites).toHaveProperty('createdAt');
expect(searchFavorites).toHaveProperty('updatedAt');
expect(searchFavorites).toHaveProperty('deletedAt');
expect(searchFavorites).toHaveProperty('workspaceMemberId');
expect(searchFavorites).toHaveProperty('personId');
expect(searchFavorites).toHaveProperty('companyId');
expect(searchFavorites).toHaveProperty('opportunityId');
expect(searchFavorites).toHaveProperty('workflowId');
expect(searchFavorites).toHaveProperty('workflowVersionId');
expect(searchFavorites).toHaveProperty('workflowRunId');
expect(searchFavorites).toHaveProperty('taskId');
expect(searchFavorites).toHaveProperty('noteId');
expect(searchFavorites).toHaveProperty('viewId');
expect(searchFavorites).toHaveProperty('rocketId');
}
});
});
});

View File

@ -0,0 +1,77 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchMessageChannelMessageAssociationsResolver (e2e)', () => {
it('should find many searchMessageChannelMessageAssociations', () => {
const queryData = {
query: `
query searchMessageChannelMessageAssociations {
searchMessageChannelMessageAssociations {
edges {
node {
messageExternalId
messageThreadExternalId
direction
id
createdAt
updatedAt
deletedAt
messageChannelId
messageId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchMessageChannelMessageAssociations;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchMessageChannelMessageAssociations = edges[0].node;
expect(searchMessageChannelMessageAssociations).toHaveProperty(
'messageExternalId',
);
expect(searchMessageChannelMessageAssociations).toHaveProperty(
'messageThreadExternalId',
);
expect(searchMessageChannelMessageAssociations).toHaveProperty(
'direction',
);
expect(searchMessageChannelMessageAssociations).toHaveProperty('id');
expect(searchMessageChannelMessageAssociations).toHaveProperty(
'createdAt',
);
expect(searchMessageChannelMessageAssociations).toHaveProperty(
'updatedAt',
);
expect(searchMessageChannelMessageAssociations).toHaveProperty(
'deletedAt',
);
expect(searchMessageChannelMessageAssociations).toHaveProperty(
'messageChannelId',
);
expect(searchMessageChannelMessageAssociations).toHaveProperty(
'messageId',
);
}
});
});
});

View File

@ -0,0 +1,87 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchMessageChannelsResolver (e2e)', () => {
it('should find many searchMessageChannels', () => {
const queryData = {
query: `
query searchMessageChannels {
searchMessageChannels {
edges {
node {
visibility
handle
type
isContactAutoCreationEnabled
contactAutoCreationPolicy
excludeNonProfessionalEmails
excludeGroupEmails
isSyncEnabled
syncCursor
syncedAt
syncStatus
syncStage
syncStageStartedAt
throttleFailureCount
id
createdAt
updatedAt
deletedAt
connectedAccountId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchMessageChannels;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchMessageChannels = edges[0].node;
expect(searchMessageChannels).toHaveProperty('visibility');
expect(searchMessageChannels).toHaveProperty('handle');
expect(searchMessageChannels).toHaveProperty('type');
expect(searchMessageChannels).toHaveProperty(
'isContactAutoCreationEnabled',
);
expect(searchMessageChannels).toHaveProperty(
'contactAutoCreationPolicy',
);
expect(searchMessageChannels).toHaveProperty(
'excludeNonProfessionalEmails',
);
expect(searchMessageChannels).toHaveProperty('excludeGroupEmails');
expect(searchMessageChannels).toHaveProperty('isSyncEnabled');
expect(searchMessageChannels).toHaveProperty('syncCursor');
expect(searchMessageChannels).toHaveProperty('syncedAt');
expect(searchMessageChannels).toHaveProperty('syncStatus');
expect(searchMessageChannels).toHaveProperty('syncStage');
expect(searchMessageChannels).toHaveProperty('syncStageStartedAt');
expect(searchMessageChannels).toHaveProperty('throttleFailureCount');
expect(searchMessageChannels).toHaveProperty('id');
expect(searchMessageChannels).toHaveProperty('createdAt');
expect(searchMessageChannels).toHaveProperty('updatedAt');
expect(searchMessageChannels).toHaveProperty('deletedAt');
expect(searchMessageChannels).toHaveProperty('connectedAccountId');
}
});
});
});

View File

@ -0,0 +1,63 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchMessageParticipantsResolver (e2e)', () => {
it('should find many searchMessageParticipants', () => {
const queryData = {
query: `
query searchMessageParticipants {
searchMessageParticipants {
edges {
node {
role
handle
displayName
id
createdAt
updatedAt
deletedAt
messageId
personId
workspaceMemberId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchMessageParticipants;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchMessageParticipants = edges[0].node;
expect(searchMessageParticipants).toHaveProperty('role');
expect(searchMessageParticipants).toHaveProperty('handle');
expect(searchMessageParticipants).toHaveProperty('displayName');
expect(searchMessageParticipants).toHaveProperty('id');
expect(searchMessageParticipants).toHaveProperty('createdAt');
expect(searchMessageParticipants).toHaveProperty('updatedAt');
expect(searchMessageParticipants).toHaveProperty('deletedAt');
expect(searchMessageParticipants).toHaveProperty('messageId');
expect(searchMessageParticipants).toHaveProperty('personId');
expect(searchMessageParticipants).toHaveProperty('workspaceMemberId');
}
});
});
});

View File

@ -0,0 +1,51 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchMessageThreadsResolver (e2e)', () => {
it('should find many searchMessageThreads', () => {
const queryData = {
query: `
query searchMessageThreads {
searchMessageThreads {
edges {
node {
id
createdAt
updatedAt
deletedAt
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchMessageThreads;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchMessageThreads = edges[0].node;
expect(searchMessageThreads).toHaveProperty('id');
expect(searchMessageThreads).toHaveProperty('createdAt');
expect(searchMessageThreads).toHaveProperty('updatedAt');
expect(searchMessageThreads).toHaveProperty('deletedAt');
}
});
});
});

View File

@ -0,0 +1,61 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchMessagesResolver (e2e)', () => {
it('should find many searchMessages', () => {
const queryData = {
query: `
query searchMessages {
searchMessages {
edges {
node {
headerMessageId
subject
text
receivedAt
id
createdAt
updatedAt
deletedAt
messageThreadId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchMessages;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchMessages = edges[0].node;
expect(searchMessages).toHaveProperty('headerMessageId');
expect(searchMessages).toHaveProperty('subject');
expect(searchMessages).toHaveProperty('text');
expect(searchMessages).toHaveProperty('receivedAt');
expect(searchMessages).toHaveProperty('id');
expect(searchMessages).toHaveProperty('createdAt');
expect(searchMessages).toHaveProperty('updatedAt');
expect(searchMessages).toHaveProperty('deletedAt');
expect(searchMessages).toHaveProperty('messageThreadId');
}
});
});
});

View File

@ -0,0 +1,61 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchNoteTargetsResolver (e2e)', () => {
it('should find many searchNoteTargets', () => {
const queryData = {
query: `
query searchNoteTargets {
searchNoteTargets {
edges {
node {
id
createdAt
updatedAt
deletedAt
noteId
personId
companyId
opportunityId
rocketId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchNoteTargets;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchNoteTargets = edges[0].node;
expect(searchNoteTargets).toHaveProperty('id');
expect(searchNoteTargets).toHaveProperty('createdAt');
expect(searchNoteTargets).toHaveProperty('updatedAt');
expect(searchNoteTargets).toHaveProperty('deletedAt');
expect(searchNoteTargets).toHaveProperty('noteId');
expect(searchNoteTargets).toHaveProperty('personId');
expect(searchNoteTargets).toHaveProperty('companyId');
expect(searchNoteTargets).toHaveProperty('opportunityId');
expect(searchNoteTargets).toHaveProperty('rocketId');
}
});
});
});

View File

@ -0,0 +1,57 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchNotesResolver (e2e)', () => {
it('should find many searchNotes', () => {
const queryData = {
query: `
query searchNotes {
searchNotes {
edges {
node {
position
title
body
id
createdAt
updatedAt
deletedAt
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchNotes;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchNotes = edges[0].node;
expect(searchNotes).toHaveProperty('position');
expect(searchNotes).toHaveProperty('title');
expect(searchNotes).toHaveProperty('body');
expect(searchNotes).toHaveProperty('id');
expect(searchNotes).toHaveProperty('createdAt');
expect(searchNotes).toHaveProperty('updatedAt');
expect(searchNotes).toHaveProperty('deletedAt');
}
});
});
});

View File

@ -0,0 +1,65 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchOpportunitiesResolver (e2e)', () => {
it('should find many searchOpportunities', () => {
const queryData = {
query: `
query searchOpportunities {
searchOpportunities {
edges {
node {
name
closeDate
stage
position
searchVector
id
createdAt
updatedAt
deletedAt
pointOfContactId
companyId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchOpportunities;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchOpportunities = edges[0].node;
expect(searchOpportunities).toHaveProperty('name');
expect(searchOpportunities).toHaveProperty('closeDate');
expect(searchOpportunities).toHaveProperty('stage');
expect(searchOpportunities).toHaveProperty('position');
expect(searchOpportunities).toHaveProperty('searchVector');
expect(searchOpportunities).toHaveProperty('id');
expect(searchOpportunities).toHaveProperty('createdAt');
expect(searchOpportunities).toHaveProperty('updatedAt');
expect(searchOpportunities).toHaveProperty('deletedAt');
expect(searchOpportunities).toHaveProperty('pointOfContactId');
expect(searchOpportunities).toHaveProperty('companyId');
}
});
});
});

View File

@ -0,0 +1,69 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchPeopleResolver (e2e)', () => {
it('should find many searchPeople', () => {
const queryData = {
query: `
query searchPeople {
searchPeople {
edges {
node {
jobTitle
city
avatarUrl
position
searchVector
id
createdAt
updatedAt
deletedAt
companyId
intro
workPreference
performanceRating
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchPeople;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchPeople = edges[0].node;
expect(searchPeople).toHaveProperty('jobTitle');
expect(searchPeople).toHaveProperty('city');
expect(searchPeople).toHaveProperty('avatarUrl');
expect(searchPeople).toHaveProperty('position');
expect(searchPeople).toHaveProperty('searchVector');
expect(searchPeople).toHaveProperty('id');
expect(searchPeople).toHaveProperty('createdAt');
expect(searchPeople).toHaveProperty('updatedAt');
expect(searchPeople).toHaveProperty('deletedAt');
expect(searchPeople).toHaveProperty('companyId');
expect(searchPeople).toHaveProperty('intro');
expect(searchPeople).toHaveProperty('workPreference');
expect(searchPeople).toHaveProperty('performanceRating');
}
});
});
});

View File

@ -0,0 +1,57 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchRocketsResolver (e2e)', () => {
it('should find many searchRockets', () => {
const queryData = {
query: `
query searchRockets {
searchRockets {
edges {
node {
id
name
createdAt
updatedAt
deletedAt
position
searchVector
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchRockets;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchRockets = edges[0].node;
expect(searchRockets).toHaveProperty('id');
expect(searchRockets).toHaveProperty('name');
expect(searchRockets).toHaveProperty('createdAt');
expect(searchRockets).toHaveProperty('updatedAt');
expect(searchRockets).toHaveProperty('deletedAt');
expect(searchRockets).toHaveProperty('position');
expect(searchRockets).toHaveProperty('searchVector');
}
});
});
});

View File

@ -0,0 +1,61 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchTaskTargetsResolver (e2e)', () => {
it('should find many searchTaskTargets', () => {
const queryData = {
query: `
query searchTaskTargets {
searchTaskTargets {
edges {
node {
id
createdAt
updatedAt
deletedAt
taskId
personId
companyId
opportunityId
rocketId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchTaskTargets;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchTaskTargets = edges[0].node;
expect(searchTaskTargets).toHaveProperty('id');
expect(searchTaskTargets).toHaveProperty('createdAt');
expect(searchTaskTargets).toHaveProperty('updatedAt');
expect(searchTaskTargets).toHaveProperty('deletedAt');
expect(searchTaskTargets).toHaveProperty('taskId');
expect(searchTaskTargets).toHaveProperty('personId');
expect(searchTaskTargets).toHaveProperty('companyId');
expect(searchTaskTargets).toHaveProperty('opportunityId');
expect(searchTaskTargets).toHaveProperty('rocketId');
}
});
});
});

View File

@ -0,0 +1,63 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchTasksResolver (e2e)', () => {
it('should find many searchTasks', () => {
const queryData = {
query: `
query searchTasks {
searchTasks {
edges {
node {
position
title
body
dueAt
status
id
createdAt
updatedAt
deletedAt
assigneeId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchTasks;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchTasks = edges[0].node;
expect(searchTasks).toHaveProperty('position');
expect(searchTasks).toHaveProperty('title');
expect(searchTasks).toHaveProperty('body');
expect(searchTasks).toHaveProperty('dueAt');
expect(searchTasks).toHaveProperty('status');
expect(searchTasks).toHaveProperty('id');
expect(searchTasks).toHaveProperty('createdAt');
expect(searchTasks).toHaveProperty('updatedAt');
expect(searchTasks).toHaveProperty('deletedAt');
expect(searchTasks).toHaveProperty('assigneeId');
}
});
});
});

View File

@ -0,0 +1,87 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchTimelineActivitiesResolver (e2e)', () => {
it('should find many searchTimelineActivities', () => {
const queryData = {
query: `
query searchTimelineActivities {
searchTimelineActivities {
edges {
node {
happensAt
name
properties
linkedRecordCachedName
linkedRecordId
linkedObjectMetadataId
id
createdAt
updatedAt
deletedAt
workspaceMemberId
personId
companyId
opportunityId
noteId
taskId
workflowId
workflowVersionId
workflowRunId
rocketId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchTimelineActivities;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchTimelineActivities = edges[0].node;
expect(searchTimelineActivities).toHaveProperty('happensAt');
expect(searchTimelineActivities).toHaveProperty('name');
expect(searchTimelineActivities).toHaveProperty('properties');
expect(searchTimelineActivities).toHaveProperty(
'linkedRecordCachedName',
);
expect(searchTimelineActivities).toHaveProperty('linkedRecordId');
expect(searchTimelineActivities).toHaveProperty(
'linkedObjectMetadataId',
);
expect(searchTimelineActivities).toHaveProperty('id');
expect(searchTimelineActivities).toHaveProperty('createdAt');
expect(searchTimelineActivities).toHaveProperty('updatedAt');
expect(searchTimelineActivities).toHaveProperty('deletedAt');
expect(searchTimelineActivities).toHaveProperty('workspaceMemberId');
expect(searchTimelineActivities).toHaveProperty('personId');
expect(searchTimelineActivities).toHaveProperty('companyId');
expect(searchTimelineActivities).toHaveProperty('opportunityId');
expect(searchTimelineActivities).toHaveProperty('noteId');
expect(searchTimelineActivities).toHaveProperty('taskId');
expect(searchTimelineActivities).toHaveProperty('workflowId');
expect(searchTimelineActivities).toHaveProperty('workflowVersionId');
expect(searchTimelineActivities).toHaveProperty('workflowRunId');
expect(searchTimelineActivities).toHaveProperty('rocketId');
}
});
});
});

View File

@ -0,0 +1,61 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchViewFieldsResolver (e2e)', () => {
it('should find many searchViewFields', () => {
const queryData = {
query: `
query searchViewFields {
searchViewFields {
edges {
node {
fieldMetadataId
isVisible
size
position
id
createdAt
updatedAt
deletedAt
viewId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchViewFields;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchViewFields = edges[0].node;
expect(searchViewFields).toHaveProperty('fieldMetadataId');
expect(searchViewFields).toHaveProperty('isVisible');
expect(searchViewFields).toHaveProperty('size');
expect(searchViewFields).toHaveProperty('position');
expect(searchViewFields).toHaveProperty('id');
expect(searchViewFields).toHaveProperty('createdAt');
expect(searchViewFields).toHaveProperty('updatedAt');
expect(searchViewFields).toHaveProperty('deletedAt');
expect(searchViewFields).toHaveProperty('viewId');
}
});
});
});

View File

@ -0,0 +1,61 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchViewFiltersResolver (e2e)', () => {
it('should find many searchViewFilters', () => {
const queryData = {
query: `
query searchViewFilters {
searchViewFilters {
edges {
node {
fieldMetadataId
operand
value
displayValue
id
createdAt
updatedAt
deletedAt
viewId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchViewFilters;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchViewFilters = edges[0].node;
expect(searchViewFilters).toHaveProperty('fieldMetadataId');
expect(searchViewFilters).toHaveProperty('operand');
expect(searchViewFilters).toHaveProperty('value');
expect(searchViewFilters).toHaveProperty('displayValue');
expect(searchViewFilters).toHaveProperty('id');
expect(searchViewFilters).toHaveProperty('createdAt');
expect(searchViewFilters).toHaveProperty('updatedAt');
expect(searchViewFilters).toHaveProperty('deletedAt');
expect(searchViewFilters).toHaveProperty('viewId');
}
});
});
});

View File

@ -0,0 +1,57 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchViewSortsResolver (e2e)', () => {
it('should find many searchViewSorts', () => {
const queryData = {
query: `
query searchViewSorts {
searchViewSorts {
edges {
node {
fieldMetadataId
direction
id
createdAt
updatedAt
deletedAt
viewId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchViewSorts;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchViewSorts = edges[0].node;
expect(searchViewSorts).toHaveProperty('fieldMetadataId');
expect(searchViewSorts).toHaveProperty('direction');
expect(searchViewSorts).toHaveProperty('id');
expect(searchViewSorts).toHaveProperty('createdAt');
expect(searchViewSorts).toHaveProperty('updatedAt');
expect(searchViewSorts).toHaveProperty('deletedAt');
expect(searchViewSorts).toHaveProperty('viewId');
}
});
});
});

View File

@ -0,0 +1,67 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchViewsResolver (e2e)', () => {
it('should find many searchViews', () => {
const queryData = {
query: `
query searchViews {
searchViews {
edges {
node {
name
objectMetadataId
type
key
icon
kanbanFieldMetadataId
position
isCompact
id
createdAt
updatedAt
deletedAt
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchViews;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchViews = edges[0].node;
expect(searchViews).toHaveProperty('name');
expect(searchViews).toHaveProperty('objectMetadataId');
expect(searchViews).toHaveProperty('type');
expect(searchViews).toHaveProperty('key');
expect(searchViews).toHaveProperty('icon');
expect(searchViews).toHaveProperty('kanbanFieldMetadataId');
expect(searchViews).toHaveProperty('position');
expect(searchViews).toHaveProperty('isCompact');
expect(searchViews).toHaveProperty('id');
expect(searchViews).toHaveProperty('createdAt');
expect(searchViews).toHaveProperty('updatedAt');
expect(searchViews).toHaveProperty('deletedAt');
}
});
});
});

View File

@ -0,0 +1,57 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchWebhooksResolver (e2e)', () => {
it('should find many searchWebhooks', () => {
const queryData = {
query: `
query searchWebhooks {
searchWebhooks {
edges {
node {
id
targetUrl
operation
description
createdAt
updatedAt
deletedAt
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchWebhooks;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchWebhooks = edges[0].node;
expect(searchWebhooks).toHaveProperty('id');
expect(searchWebhooks).toHaveProperty('targetUrl');
expect(searchWebhooks).toHaveProperty('operation');
expect(searchWebhooks).toHaveProperty('description');
expect(searchWebhooks).toHaveProperty('createdAt');
expect(searchWebhooks).toHaveProperty('updatedAt');
expect(searchWebhooks).toHaveProperty('deletedAt');
}
});
});
});

View File

@ -0,0 +1,55 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchWorkflowEventListenersResolver (e2e)', () => {
it('should find many searchWorkflowEventListeners', () => {
const queryData = {
query: `
query searchWorkflowEventListeners {
searchWorkflowEventListeners {
edges {
node {
eventName
id
createdAt
updatedAt
deletedAt
workflowId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchWorkflowEventListeners;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchWorkflowEventListeners = edges[0].node;
expect(searchWorkflowEventListeners).toHaveProperty('eventName');
expect(searchWorkflowEventListeners).toHaveProperty('id');
expect(searchWorkflowEventListeners).toHaveProperty('createdAt');
expect(searchWorkflowEventListeners).toHaveProperty('updatedAt');
expect(searchWorkflowEventListeners).toHaveProperty('deletedAt');
expect(searchWorkflowEventListeners).toHaveProperty('workflowId');
}
});
});
});

View File

@ -0,0 +1,69 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchWorkflowRunsResolver (e2e)', () => {
it('should find many searchWorkflowRuns', () => {
const queryData = {
query: `
query searchWorkflowRuns {
searchWorkflowRuns {
edges {
node {
workflowRunId
name
startedAt
endedAt
status
output
position
id
createdAt
updatedAt
deletedAt
workflowVersionId
workflowId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchWorkflowRuns;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchWorkflowRuns = edges[0].node;
expect(searchWorkflowRuns).toHaveProperty('workflowRunId');
expect(searchWorkflowRuns).toHaveProperty('name');
expect(searchWorkflowRuns).toHaveProperty('startedAt');
expect(searchWorkflowRuns).toHaveProperty('endedAt');
expect(searchWorkflowRuns).toHaveProperty('status');
expect(searchWorkflowRuns).toHaveProperty('output');
expect(searchWorkflowRuns).toHaveProperty('position');
expect(searchWorkflowRuns).toHaveProperty('id');
expect(searchWorkflowRuns).toHaveProperty('createdAt');
expect(searchWorkflowRuns).toHaveProperty('updatedAt');
expect(searchWorkflowRuns).toHaveProperty('deletedAt');
expect(searchWorkflowRuns).toHaveProperty('workflowVersionId');
expect(searchWorkflowRuns).toHaveProperty('workflowId');
}
});
});
});

View File

@ -0,0 +1,63 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchWorkflowVersionsResolver (e2e)', () => {
it('should find many searchWorkflowVersions', () => {
const queryData = {
query: `
query searchWorkflowVersions {
searchWorkflowVersions {
edges {
node {
name
trigger
steps
status
position
id
createdAt
updatedAt
deletedAt
workflowId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchWorkflowVersions;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchWorkflowVersions = edges[0].node;
expect(searchWorkflowVersions).toHaveProperty('name');
expect(searchWorkflowVersions).toHaveProperty('trigger');
expect(searchWorkflowVersions).toHaveProperty('steps');
expect(searchWorkflowVersions).toHaveProperty('status');
expect(searchWorkflowVersions).toHaveProperty('position');
expect(searchWorkflowVersions).toHaveProperty('id');
expect(searchWorkflowVersions).toHaveProperty('createdAt');
expect(searchWorkflowVersions).toHaveProperty('updatedAt');
expect(searchWorkflowVersions).toHaveProperty('deletedAt');
expect(searchWorkflowVersions).toHaveProperty('workflowId');
}
});
});
});

View File

@ -0,0 +1,59 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchWorkflowsResolver (e2e)', () => {
it('should find many searchWorkflows', () => {
const queryData = {
query: `
query searchWorkflows {
searchWorkflows {
edges {
node {
name
lastPublishedVersionId
statuses
position
id
createdAt
updatedAt
deletedAt
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchWorkflows;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchWorkflows = edges[0].node;
expect(searchWorkflows).toHaveProperty('name');
expect(searchWorkflows).toHaveProperty('lastPublishedVersionId');
expect(searchWorkflows).toHaveProperty('statuses');
expect(searchWorkflows).toHaveProperty('position');
expect(searchWorkflows).toHaveProperty('id');
expect(searchWorkflows).toHaveProperty('createdAt');
expect(searchWorkflows).toHaveProperty('updatedAt');
expect(searchWorkflows).toHaveProperty('deletedAt');
}
});
});
});

View File

@ -0,0 +1,67 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('searchWorkspaceMembersResolver (e2e)', () => {
it('should find many searchWorkspaceMembers', () => {
const queryData = {
query: `
query searchWorkspaceMembers {
searchWorkspaceMembers {
edges {
node {
id
colorScheme
avatarUrl
locale
timeZone
dateFormat
timeFormat
userEmail
userId
createdAt
updatedAt
deletedAt
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.searchWorkspaceMembers;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const searchWorkspaceMembers = edges[0].node;
expect(searchWorkspaceMembers).toHaveProperty('id');
expect(searchWorkspaceMembers).toHaveProperty('colorScheme');
expect(searchWorkspaceMembers).toHaveProperty('avatarUrl');
expect(searchWorkspaceMembers).toHaveProperty('locale');
expect(searchWorkspaceMembers).toHaveProperty('timeZone');
expect(searchWorkspaceMembers).toHaveProperty('dateFormat');
expect(searchWorkspaceMembers).toHaveProperty('timeFormat');
expect(searchWorkspaceMembers).toHaveProperty('userEmail');
expect(searchWorkspaceMembers).toHaveProperty('userId');
expect(searchWorkspaceMembers).toHaveProperty('createdAt');
expect(searchWorkspaceMembers).toHaveProperty('updatedAt');
expect(searchWorkspaceMembers).toHaveProperty('deletedAt');
}
});
});
});

View File

@ -0,0 +1,59 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('serverlessFunctionsResolver (e2e)', () => {
it('should find many serverlessFunctions', () => {
const queryData = {
query: `
query serverlessFunctions {
serverlessFunctions {
edges {
node {
id
name
description
runtime
latestVersion
syncStatus
createdAt
updatedAt
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.serverlessFunctions;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const serverlessFunctions = edges[0].node;
expect(serverlessFunctions).toHaveProperty('id');
expect(serverlessFunctions).toHaveProperty('name');
expect(serverlessFunctions).toHaveProperty('description');
expect(serverlessFunctions).toHaveProperty('runtime');
expect(serverlessFunctions).toHaveProperty('latestVersion');
expect(serverlessFunctions).toHaveProperty('syncStatus');
expect(serverlessFunctions).toHaveProperty('createdAt');
expect(serverlessFunctions).toHaveProperty('updatedAt');
}
});
});
});

View File

@ -0,0 +1,61 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('taskTargetsResolver (e2e)', () => {
it('should find many taskTargets', () => {
const queryData = {
query: `
query taskTargets {
taskTargets {
edges {
node {
id
createdAt
updatedAt
deletedAt
taskId
personId
companyId
opportunityId
rocketId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.taskTargets;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const taskTargets = edges[0].node;
expect(taskTargets).toHaveProperty('id');
expect(taskTargets).toHaveProperty('createdAt');
expect(taskTargets).toHaveProperty('updatedAt');
expect(taskTargets).toHaveProperty('deletedAt');
expect(taskTargets).toHaveProperty('taskId');
expect(taskTargets).toHaveProperty('personId');
expect(taskTargets).toHaveProperty('companyId');
expect(taskTargets).toHaveProperty('opportunityId');
expect(taskTargets).toHaveProperty('rocketId');
}
});
});
});

View File

@ -0,0 +1,63 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('tasksResolver (e2e)', () => {
it('should find many tasks', () => {
const queryData = {
query: `
query tasks {
tasks {
edges {
node {
position
title
body
dueAt
status
id
createdAt
updatedAt
deletedAt
assigneeId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.tasks;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const tasks = edges[0].node;
expect(tasks).toHaveProperty('position');
expect(tasks).toHaveProperty('title');
expect(tasks).toHaveProperty('body');
expect(tasks).toHaveProperty('dueAt');
expect(tasks).toHaveProperty('status');
expect(tasks).toHaveProperty('id');
expect(tasks).toHaveProperty('createdAt');
expect(tasks).toHaveProperty('updatedAt');
expect(tasks).toHaveProperty('deletedAt');
expect(tasks).toHaveProperty('assigneeId');
}
});
});
});

View File

@ -0,0 +1,83 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('timelineActivitiesResolver (e2e)', () => {
it('should find many timelineActivities', () => {
const queryData = {
query: `
query timelineActivities {
timelineActivities {
edges {
node {
happensAt
name
properties
linkedRecordCachedName
linkedRecordId
linkedObjectMetadataId
id
createdAt
updatedAt
deletedAt
workspaceMemberId
personId
companyId
opportunityId
noteId
taskId
workflowId
workflowVersionId
workflowRunId
rocketId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.timelineActivities;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const timelineActivities = edges[0].node;
expect(timelineActivities).toHaveProperty('happensAt');
expect(timelineActivities).toHaveProperty('name');
expect(timelineActivities).toHaveProperty('properties');
expect(timelineActivities).toHaveProperty('linkedRecordCachedName');
expect(timelineActivities).toHaveProperty('linkedRecordId');
expect(timelineActivities).toHaveProperty('linkedObjectMetadataId');
expect(timelineActivities).toHaveProperty('id');
expect(timelineActivities).toHaveProperty('createdAt');
expect(timelineActivities).toHaveProperty('updatedAt');
expect(timelineActivities).toHaveProperty('deletedAt');
expect(timelineActivities).toHaveProperty('workspaceMemberId');
expect(timelineActivities).toHaveProperty('personId');
expect(timelineActivities).toHaveProperty('companyId');
expect(timelineActivities).toHaveProperty('opportunityId');
expect(timelineActivities).toHaveProperty('noteId');
expect(timelineActivities).toHaveProperty('taskId');
expect(timelineActivities).toHaveProperty('workflowId');
expect(timelineActivities).toHaveProperty('workflowVersionId');
expect(timelineActivities).toHaveProperty('workflowRunId');
expect(timelineActivities).toHaveProperty('rocketId');
}
});
});
});

View File

@ -0,0 +1,61 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('viewFieldsResolver (e2e)', () => {
it('should find many viewFields', () => {
const queryData = {
query: `
query viewFields {
viewFields {
edges {
node {
fieldMetadataId
isVisible
size
position
id
createdAt
updatedAt
deletedAt
viewId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.viewFields;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const viewFields = edges[0].node;
expect(viewFields).toHaveProperty('fieldMetadataId');
expect(viewFields).toHaveProperty('isVisible');
expect(viewFields).toHaveProperty('size');
expect(viewFields).toHaveProperty('position');
expect(viewFields).toHaveProperty('id');
expect(viewFields).toHaveProperty('createdAt');
expect(viewFields).toHaveProperty('updatedAt');
expect(viewFields).toHaveProperty('deletedAt');
expect(viewFields).toHaveProperty('viewId');
}
});
});
});

View File

@ -0,0 +1,61 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('viewFiltersResolver (e2e)', () => {
it('should find many viewFilters', () => {
const queryData = {
query: `
query viewFilters {
viewFilters {
edges {
node {
fieldMetadataId
operand
value
displayValue
id
createdAt
updatedAt
deletedAt
viewId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.viewFilters;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const viewFilters = edges[0].node;
expect(viewFilters).toHaveProperty('fieldMetadataId');
expect(viewFilters).toHaveProperty('operand');
expect(viewFilters).toHaveProperty('value');
expect(viewFilters).toHaveProperty('displayValue');
expect(viewFilters).toHaveProperty('id');
expect(viewFilters).toHaveProperty('createdAt');
expect(viewFilters).toHaveProperty('updatedAt');
expect(viewFilters).toHaveProperty('deletedAt');
expect(viewFilters).toHaveProperty('viewId');
}
});
});
});

View File

@ -0,0 +1,57 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('viewSortsResolver (e2e)', () => {
it('should find many viewSorts', () => {
const queryData = {
query: `
query viewSorts {
viewSorts {
edges {
node {
fieldMetadataId
direction
id
createdAt
updatedAt
deletedAt
viewId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.viewSorts;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const viewSorts = edges[0].node;
expect(viewSorts).toHaveProperty('fieldMetadataId');
expect(viewSorts).toHaveProperty('direction');
expect(viewSorts).toHaveProperty('id');
expect(viewSorts).toHaveProperty('createdAt');
expect(viewSorts).toHaveProperty('updatedAt');
expect(viewSorts).toHaveProperty('deletedAt');
expect(viewSorts).toHaveProperty('viewId');
}
});
});
});

View File

@ -0,0 +1,67 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('viewsResolver (e2e)', () => {
it('should find many views', () => {
const queryData = {
query: `
query views {
views {
edges {
node {
name
objectMetadataId
type
key
icon
kanbanFieldMetadataId
position
isCompact
id
createdAt
updatedAt
deletedAt
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.views;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const views = edges[0].node;
expect(views).toHaveProperty('name');
expect(views).toHaveProperty('objectMetadataId');
expect(views).toHaveProperty('type');
expect(views).toHaveProperty('key');
expect(views).toHaveProperty('icon');
expect(views).toHaveProperty('kanbanFieldMetadataId');
expect(views).toHaveProperty('position');
expect(views).toHaveProperty('isCompact');
expect(views).toHaveProperty('id');
expect(views).toHaveProperty('createdAt');
expect(views).toHaveProperty('updatedAt');
expect(views).toHaveProperty('deletedAt');
}
});
});
});

View File

@ -0,0 +1,57 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('webhooksResolver (e2e)', () => {
it('should find many webhooks', () => {
const queryData = {
query: `
query webhooks {
webhooks {
edges {
node {
id
targetUrl
operation
description
createdAt
updatedAt
deletedAt
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.webhooks;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const webhooks = edges[0].node;
expect(webhooks).toHaveProperty('id');
expect(webhooks).toHaveProperty('targetUrl');
expect(webhooks).toHaveProperty('operation');
expect(webhooks).toHaveProperty('description');
expect(webhooks).toHaveProperty('createdAt');
expect(webhooks).toHaveProperty('updatedAt');
expect(webhooks).toHaveProperty('deletedAt');
}
});
});
});

View File

@ -0,0 +1,55 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('workflowEventListenersResolver (e2e)', () => {
it('should find many workflowEventListeners', () => {
const queryData = {
query: `
query workflowEventListeners {
workflowEventListeners {
edges {
node {
eventName
id
createdAt
updatedAt
deletedAt
workflowId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.workflowEventListeners;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const workflowEventListeners = edges[0].node;
expect(workflowEventListeners).toHaveProperty('eventName');
expect(workflowEventListeners).toHaveProperty('id');
expect(workflowEventListeners).toHaveProperty('createdAt');
expect(workflowEventListeners).toHaveProperty('updatedAt');
expect(workflowEventListeners).toHaveProperty('deletedAt');
expect(workflowEventListeners).toHaveProperty('workflowId');
}
});
});
});

View File

@ -0,0 +1,63 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('workflowVersionsResolver (e2e)', () => {
it('should find many workflowVersions', () => {
const queryData = {
query: `
query workflowVersions {
workflowVersions {
edges {
node {
name
trigger
steps
status
position
id
createdAt
updatedAt
deletedAt
workflowId
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.workflowVersions;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const workflowVersions = edges[0].node;
expect(workflowVersions).toHaveProperty('name');
expect(workflowVersions).toHaveProperty('trigger');
expect(workflowVersions).toHaveProperty('steps');
expect(workflowVersions).toHaveProperty('status');
expect(workflowVersions).toHaveProperty('position');
expect(workflowVersions).toHaveProperty('id');
expect(workflowVersions).toHaveProperty('createdAt');
expect(workflowVersions).toHaveProperty('updatedAt');
expect(workflowVersions).toHaveProperty('deletedAt');
expect(workflowVersions).toHaveProperty('workflowId');
}
});
});
});

View File

@ -0,0 +1,59 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('workflowsResolver (e2e)', () => {
it('should find many workflows', () => {
const queryData = {
query: `
query workflows {
workflows {
edges {
node {
name
lastPublishedVersionId
statuses
position
id
createdAt
updatedAt
deletedAt
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.workflows;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const workflows = edges[0].node;
expect(workflows).toHaveProperty('name');
expect(workflows).toHaveProperty('lastPublishedVersionId');
expect(workflows).toHaveProperty('statuses');
expect(workflows).toHaveProperty('position');
expect(workflows).toHaveProperty('id');
expect(workflows).toHaveProperty('createdAt');
expect(workflows).toHaveProperty('updatedAt');
expect(workflows).toHaveProperty('deletedAt');
}
});
});
});

View File

@ -0,0 +1,67 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('workspaceMembersResolver (e2e)', () => {
it('should find many workspaceMembers', () => {
const queryData = {
query: `
query workspaceMembers {
workspaceMembers {
edges {
node {
id
colorScheme
avatarUrl
locale
timeZone
dateFormat
timeFormat
userEmail
userId
createdAt
updatedAt
deletedAt
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.workspaceMembers;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const workspaceMembers = edges[0].node;
expect(workspaceMembers).toHaveProperty('id');
expect(workspaceMembers).toHaveProperty('colorScheme');
expect(workspaceMembers).toHaveProperty('avatarUrl');
expect(workspaceMembers).toHaveProperty('locale');
expect(workspaceMembers).toHaveProperty('timeZone');
expect(workspaceMembers).toHaveProperty('dateFormat');
expect(workspaceMembers).toHaveProperty('timeFormat');
expect(workspaceMembers).toHaveProperty('userEmail');
expect(workspaceMembers).toHaveProperty('userId');
expect(workspaceMembers).toHaveProperty('createdAt');
expect(workspaceMembers).toHaveProperty('updatedAt');
expect(workspaceMembers).toHaveProperty('deletedAt');
}
});
});
});