[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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
99 changed files with 3595 additions and 102 deletions

View File

@ -11,7 +11,7 @@ EXCEPTION_HANDLER_DRIVER=console
SENTRY_DSN=https://ba869cb8fd72d5faeb6643560939cee0@o4505516959793152.ingest.sentry.io/4506660900306944 SENTRY_DSN=https://ba869cb8fd72d5faeb6643560939cee0@o4505516959793152.ingest.sentry.io/4506660900306944
DEMO_WORKSPACE_IDS=63db4589-590f-42b3-bdf1-85268b3da02f,8de58f3f-7e86-4a0b-998d-b2cbe314ee3a,4d957b72-0b37-4bad-9468-8dc828ee082d,daa0b739-269e-49b6-9be5-5f0215941489,59c15f6a-909a-4495-9cf4-3ce1b0abbb6a,7202cc9d-92da-4b52-a323-d29d38cd3b4e,5f071b0d-646b-411a-94f1-5d9ba9d5c6ac,7bc10973-897b-4767-ab2f-35cdac3b2aec,4b3ba0be-2d29-4b1e-be66-8ac7eb65d000,edfb500d-cc4e-4f22-8e2b-f139a9758a68,eee459c9-9057-4459-ae0d-d51d14c01635,3dd2f505-0075-4217-ba33-fc4244aeaaa9,3d1a9165-3f3f-494e-a99d-f858eae95144,84db6ded-cfce-4aee-9160-6553b05c8143,96fb1540-269b-4d13-af21-2a8268eff8ca,b2463e69-d121-4ea5-80c9-bba82403e93e,5af30c15-867d-49ed-b939-d4856bed8514,b5677aa1-68fa-4818-aaaa-434a07ae2ed4,1ec7fa9a-d6bf-4fa2-a753-9a235d75ee3f,753a6fa2-df27-4c87-8c90-4da78fcb30dd,2138f2f2-bbe9-41df-b483-687a9075f94e,a885cfef-4636-4c3a-9788-1ff6e6b92df5,5458f7fb-9431-47a2-b7a0-32f31d115e23,6c09929f-11c3-4f92-9508-aa0e6b934d1e,57ae0a2c-7a4e-4c7d-8f43-68548e7f1206,cc7f0b85-6868-4c2d-85c5-3ce9977ea346,21871a7f-f067-45ea-989e-44339bb5ad07,c3efedab-84f5-4656-8297-55964b3d26cb,647dcdd1-4540-4003-9f58-fd84d4d759b7,fc5e6857-8d67-47b8-98f2-edeb0671e326,1ad8d72c-1826-40ed-8b44-d15a1d2aab70,eac6c90a-d25d-4c8c-a053-cfbc7cde0afb,023a70de-a85e-43fc-bbc6-757fbf6562f0,f3f0a7fb-1409-443b-8e39-4e58e628796e,62828804-97d4-40ec-82fa-2992a6ce4a81,af5441fe-b16f-4996-87f4-1a433ec53dd6,e8857860-f7b1-4478-9741-1eb9e7c11f2c,6bca9c44-c8c0-49f8-b0b5-1bb2ca7842b8,d50da092-09df-448f-84ea-3ebddfe1d9f6,9efd5d6d-db64-47d4-9ad3-5e4d8b65ff7f,6f089094-2dd2-4b0e-b5b7-8bb52b93ea8e,299b0822-68e9-4bfa-af35-da799012e80e,a3dd579c-93be-45a0-ad35-f518d8ed45dd,023b1b3e-4891-4061-aae0-f34368644f40,50174445-33c5-4482-bb8c-3ef6c511c8cd,9933c048-07a7-4735-9af2-940c2f9b6683,beadc568-3962-46bd-ad4d-06e23b37615b,0cdafc9f-d4c1-4576-837e-d7f6ec28643d,50bb24ce-1709-4928-a87b-d9d9e147a2ab,7690ed72-910d-4357-8e0e-17aa702b0b94,1ad0d69f-60fa-414f-bf79-4f94c2abba43,946d84a4-db4d-48cb-a5d3-03081b5c7e8e,1a080055-d2bf-4b14-8957-88a7d08769b8,ed343e38-e405-4fae-9486-27b09c98bdad,c8bdef75-a98c-4646-a372-3251340d2dea,87a8c6fa-f93e-4950-aff2-5f956ca1a6ba,604781ba-23c2-4220-a717-b5615431fcd9,31af6841-ad9f-4f28-a637-b5c5e6589447,cf067451-7b88-4ff2-a96d-3fc9c5d6fea0,26a8ad5e-29d9-4e7d-aa1f-e6221e8ea32a,fd14db29-e4df-44a7-9b3f-d00384458122,73b477a8-fcf4-4860-a685-65a0a79b8653,82e0f305-4c6c-4160-be1d-b0de834124e6,e38567ab-a6e2-4a94-99c5-a7db31c0aae8,faf3d6dc-66ff-4c1b-9658-f65a9cd9fcf1,6df6bb90-200e-4290-b73d-9bb374554229,2ff10cf4-a871-404a-9e7b-5ca7a232567e,06c614e2-0f36-4b72-8c82-59631680add2,5e508c81-3453-4185-ae8c-4c9b841f8c15,21b5c371-6010-4b1b-be67-7538eb877efb,54e61442-e291-4eea-8d49-7f11b5f85bd2,b6b7260a-4eea-40b0-9f7f-1dfd4c3cc7a8,e163fe76-30fb-44fb-b51a-50cc78745a21,4da672f2-29b4-4a98-b27c-b39a4aecc858,2fdb0601-c882-4aaf-ad49-ae17e530d47a,49525e1b-1b47-4545-a98c-0ba58778179f,f958ab32-b152-4004-9228-18148f7380f1,0ff5025a-62cd-4a10-a722-79f7cf360f01,642df445-e314-409a-a97d-64fc2aa2a15e,38b0dab5-d4fb-44f9-8cf9-bb35cf82e91d,62054133-f35a-4f64-a2ee-a31e48952835,536dbe8c-af33-4eab-a0a8-8d039a00db40,a04998ba-52c9-4538-b6d9-6d04408dbaf2,89016c7a-3d36-4619-a5c6-4f31795eebf7,7708b9a9-776c-46fc-94a4-dc28e7880958,5c92bc69-b328-4c66-a791-a05dbaf7a6f8,ad580a50-80b4-44be-9bc4-f2b57cd23207,36c0241c-891e-4b74-bd10-5e99df96bbc8,a96842ff-18be-4536-a23d-20d973d91621,0ea549b0-9558-4bdf-9944-5abc707c7660,0186c353-5ed2-4c94-b71a-fc0b48c90288,1508a165-2217-4911-b31c-1ea42a08f097,1731e392-dfdf-4fc4-863b-27ae62b0e374,0b245cea-96a6-4a3a-af6a-ef43496c239c,a844e208-7078-43a2-8bd0-86f31498cd3f,53d112b5-87f2-490b-a788-df1f4624f9ad,0d5794d4-3a52-482b-9a6a-f8185018bad1,df877aa6-231c-47fb-9be0-906e61677356,c56c6d1a-3418-49d2-82ce-bd9370668043,6e0b6f34-3cd0-4aa0-ae1f-25f5545dca68 DEMO_WORKSPACE_IDS=63db4589-590f-42b3-bdf1-85268b3da02f,8de58f3f-7e86-4a0b-998d-b2cbe314ee3a,4d957b72-0b37-4bad-9468-8dc828ee082d,daa0b739-269e-49b6-9be5-5f0215941489,59c15f6a-909a-4495-9cf4-3ce1b0abbb6a,7202cc9d-92da-4b52-a323-d29d38cd3b4e,5f071b0d-646b-411a-94f1-5d9ba9d5c6ac,7bc10973-897b-4767-ab2f-35cdac3b2aec,4b3ba0be-2d29-4b1e-be66-8ac7eb65d000,edfb500d-cc4e-4f22-8e2b-f139a9758a68,eee459c9-9057-4459-ae0d-d51d14c01635,3dd2f505-0075-4217-ba33-fc4244aeaaa9,3d1a9165-3f3f-494e-a99d-f858eae95144,84db6ded-cfce-4aee-9160-6553b05c8143,96fb1540-269b-4d13-af21-2a8268eff8ca,b2463e69-d121-4ea5-80c9-bba82403e93e,5af30c15-867d-49ed-b939-d4856bed8514,b5677aa1-68fa-4818-aaaa-434a07ae2ed4,1ec7fa9a-d6bf-4fa2-a753-9a235d75ee3f,753a6fa2-df27-4c87-8c90-4da78fcb30dd,2138f2f2-bbe9-41df-b483-687a9075f94e,a885cfef-4636-4c3a-9788-1ff6e6b92df5,5458f7fb-9431-47a2-b7a0-32f31d115e23,6c09929f-11c3-4f92-9508-aa0e6b934d1e,57ae0a2c-7a4e-4c7d-8f43-68548e7f1206,cc7f0b85-6868-4c2d-85c5-3ce9977ea346,21871a7f-f067-45ea-989e-44339bb5ad07,c3efedab-84f5-4656-8297-55964b3d26cb,647dcdd1-4540-4003-9f58-fd84d4d759b7,fc5e6857-8d67-47b8-98f2-edeb0671e326,1ad8d72c-1826-40ed-8b44-d15a1d2aab70,eac6c90a-d25d-4c8c-a053-cfbc7cde0afb,023a70de-a85e-43fc-bbc6-757fbf6562f0,f3f0a7fb-1409-443b-8e39-4e58e628796e,62828804-97d4-40ec-82fa-2992a6ce4a81,af5441fe-b16f-4996-87f4-1a433ec53dd6,e8857860-f7b1-4478-9741-1eb9e7c11f2c,6bca9c44-c8c0-49f8-b0b5-1bb2ca7842b8,d50da092-09df-448f-84ea-3ebddfe1d9f6,9efd5d6d-db64-47d4-9ad3-5e4d8b65ff7f,6f089094-2dd2-4b0e-b5b7-8bb52b93ea8e,299b0822-68e9-4bfa-af35-da799012e80e,a3dd579c-93be-45a0-ad35-f518d8ed45dd,023b1b3e-4891-4061-aae0-f34368644f40,50174445-33c5-4482-bb8c-3ef6c511c8cd,9933c048-07a7-4735-9af2-940c2f9b6683,beadc568-3962-46bd-ad4d-06e23b37615b,0cdafc9f-d4c1-4576-837e-d7f6ec28643d,50bb24ce-1709-4928-a87b-d9d9e147a2ab,7690ed72-910d-4357-8e0e-17aa702b0b94,1ad0d69f-60fa-414f-bf79-4f94c2abba43,946d84a4-db4d-48cb-a5d3-03081b5c7e8e,1a080055-d2bf-4b14-8957-88a7d08769b8,ed343e38-e405-4fae-9486-27b09c98bdad,c8bdef75-a98c-4646-a372-3251340d2dea,87a8c6fa-f93e-4950-aff2-5f956ca1a6ba,604781ba-23c2-4220-a717-b5615431fcd9,31af6841-ad9f-4f28-a637-b5c5e6589447,cf067451-7b88-4ff2-a96d-3fc9c5d6fea0,26a8ad5e-29d9-4e7d-aa1f-e6221e8ea32a,fd14db29-e4df-44a7-9b3f-d00384458122,73b477a8-fcf4-4860-a685-65a0a79b8653,82e0f305-4c6c-4160-be1d-b0de834124e6,e38567ab-a6e2-4a94-99c5-a7db31c0aae8,faf3d6dc-66ff-4c1b-9658-f65a9cd9fcf1,6df6bb90-200e-4290-b73d-9bb374554229,2ff10cf4-a871-404a-9e7b-5ca7a232567e,06c614e2-0f36-4b72-8c82-59631680add2,5e508c81-3453-4185-ae8c-4c9b841f8c15,21b5c371-6010-4b1b-be67-7538eb877efb,54e61442-e291-4eea-8d49-7f11b5f85bd2,b6b7260a-4eea-40b0-9f7f-1dfd4c3cc7a8,e163fe76-30fb-44fb-b51a-50cc78745a21,4da672f2-29b4-4a98-b27c-b39a4aecc858,2fdb0601-c882-4aaf-ad49-ae17e530d47a,49525e1b-1b47-4545-a98c-0ba58778179f,f958ab32-b152-4004-9228-18148f7380f1,0ff5025a-62cd-4a10-a722-79f7cf360f01,642df445-e314-409a-a97d-64fc2aa2a15e,38b0dab5-d4fb-44f9-8cf9-bb35cf82e91d,62054133-f35a-4f64-a2ee-a31e48952835,536dbe8c-af33-4eab-a0a8-8d039a00db40,a04998ba-52c9-4538-b6d9-6d04408dbaf2,89016c7a-3d36-4619-a5c6-4f31795eebf7,7708b9a9-776c-46fc-94a4-dc28e7880958,5c92bc69-b328-4c66-a791-a05dbaf7a6f8,ad580a50-80b4-44be-9bc4-f2b57cd23207,36c0241c-891e-4b74-bd10-5e99df96bbc8,a96842ff-18be-4536-a23d-20d973d91621,0ea549b0-9558-4bdf-9944-5abc707c7660,0186c353-5ed2-4c94-b71a-fc0b48c90288,1508a165-2217-4911-b31c-1ea42a08f097,1731e392-dfdf-4fc4-863b-27ae62b0e374,0b245cea-96a6-4a3a-af6a-ef43496c239c,a844e208-7078-43a2-8bd0-86f31498cd3f,53d112b5-87f2-490b-a788-df1f4624f9ad,0d5794d4-3a52-482b-9a6a-f8185018bad1,df877aa6-231c-47fb-9be0-906e61677356,c56c6d1a-3418-49d2-82ce-bd9370668043,6e0b6f34-3cd0-4aa0-ae1f-25f5545dca68
MUTATION_MAXIMUM_RECORD_AFFECTED=100 MUTATION_MAXIMUM_RECORD_AFFECTED=100
MESSAGE_QUEUE_TYPE=pg-boss MESSAGE_QUEUE_TYPE=bull-mq
CACHE_STORAGE_TYPE=redis CACHE_STORAGE_TYPE=redis
REDIS_URL=redis://localhost:6379 REDIS_URL=redis://localhost:6379

@ -1 +0,0 @@
Subproject commit a33b01797795419edef84f122b5214472648d1ce

View File

@ -11,11 +11,14 @@ const jestConfig: JestConfigWithTsJest = {
testEnvironment: 'node', testEnvironment: 'node',
testRegex: '.integration-spec.ts$', testRegex: '.integration-spec.ts$',
modulePathIgnorePatterns: ['<rootDir>/dist'], modulePathIgnorePatterns: ['<rootDir>/dist'],
globalSetup: '<rootDir>/test/utils/setup-test.ts', globalSetup: '<rootDir>/test/integration/utils/setup-test.ts',
globalTeardown: '<rootDir>/test/utils/teardown-test.ts', globalTeardown: '<rootDir>/test/integration/utils/teardown-test.ts',
testTimeout: 15000, testTimeout: 15000,
moduleNameMapper: { moduleNameMapper: {
...pathsToModuleNameMapper(tsConfig.compilerOptions.paths), ...pathsToModuleNameMapper(tsConfig.compilerOptions.paths, {
prefix: '<rootDir>/../..',
}),
'^test/(.*)$': '<rootDir>/test/$1',
'twenty-emails': '<rootDir>/../twenty-emails/dist/index.js', 'twenty-emails': '<rootDir>/../twenty-emails/dist/index.js',
}, },
fakeTimers: { fakeTimers: {

View File

@ -162,7 +162,7 @@
"options": { "options": {
"cwd": "packages/twenty-server", "cwd": "packages/twenty-server",
"commands": [ "commands": [
"nx ts-node-no-deps -- ./scripts/generate-integration-tests/index.ts" "nx ts-node-no-deps -- ./test/integration/graphql/codegen/index.ts"
], ],
"parallel": false "parallel": false
} }

View File

@ -1,48 +0,0 @@
import request from 'supertest';
const graphqlClient = request(`http://localhost:${APP_PORT}`);
describe('CompanyResolver (integration)', () => {
it('should find many companies', () => {
const queryData = {
query: `
query Companies {
companies {
edges {
node {
id
name
}
}
}
}
`,
};
return graphqlClient
.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 company = edges[0].node;
expect(company).toBeDefined();
expect(company).toHaveProperty('id');
expect(company).toHaveProperty('name');
}
});
});
});

View File

@ -13,7 +13,7 @@ import {
const GRAPHQL_URL = 'http://localhost:3000/graphql'; const GRAPHQL_URL = 'http://localhost:3000/graphql';
const BEARER_TOKEN = const BEARER_TOKEN =
'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyMDIwMjAyMC05ZTNiLTQ2ZDQtYTU1Ni04OGI5ZGRjMmIwMzQiLCJ3b3Jrc3BhY2VJZCI6IjIwMjAyMDIwLTFjMjUtNGQwMi1iZjI1LTZhZWNjZjdlYTQxOSIsIndvcmtzcGFjZU1lbWJlcklkIjoiMjAyMDIwMjAtMDY4Ny00YzQxLWI3MDctZWQxYmZjYTk3MmE3IiwiaWF0IjoxNzI2NDkyNTAyLCJleHAiOjEzMjQ1MDE2NTAyfQ.zM6TbfeOqYVH5Sgryc2zf02hd9uqUOSL1-iJlMgwzsI'; 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyMDIwMjAyMC05ZTNiLTQ2ZDQtYTU1Ni04OGI5ZGRjMmIwMzQiLCJ3b3Jrc3BhY2VJZCI6IjIwMjAyMDIwLTFjMjUtNGQwMi1iZjI1LTZhZWNjZjdlYTQxOSIsIndvcmtzcGFjZU1lbWJlcklkIjoiMjAyMDIwMjAtMDY4Ny00YzQxLWI3MDctZWQxYmZjYTk3MmE3IiwiaWF0IjoxNzI2NDkyNTAyLCJleHAiOjEzMjQ1MDE2NTAyfQ.zM6TbfeOqYVH5Sgryc2zf02hd9uqUOSL1-iJlMgwzsI';
const TEST_OUTPUT_DIR = './test'; const TEST_OUTPUT_DIR = './test/integration/graphql/suites/object-generated';
const fetchGraphQLSchema = async (): Promise<IntrospectionResponse> => { const fetchGraphQLSchema = async (): Promise<IntrospectionResponse> => {
const headers = { const headers = {

View File

@ -0,0 +1,430 @@
import { createManyOperationFactory } from 'test/integration/graphql/utils/create-many-operation-factory.util';
import { createOneOperationFactory } from 'test/integration/graphql/utils/create-one-operation-factory.util';
import { deleteManyOperationFactory } from 'test/integration/graphql/utils/delete-many-operation-factory.util';
import { deleteOneOperationFactory } from 'test/integration/graphql/utils/delete-one-operation-factory.util';
import { destroyManyOperationFactory } from 'test/integration/graphql/utils/destroy-many-operation-factory.util';
import { destroyOneOperationFactory } from 'test/integration/graphql/utils/destroy-one-operation-factory.util';
import { findManyOperationFactory } from 'test/integration/graphql/utils/find-many-operation-factory.util';
import { findOneOperationFactory } from 'test/integration/graphql/utils/find-one-operation-factory.util';
import { makeGraphqlAPIRequest } from 'test/integration/graphql/utils/make-graphql-api-request.util';
import { updateManyOperationFactory } from 'test/integration/graphql/utils/update-many-operation-factory.util';
import { updateOneOperationFactory } from 'test/integration/graphql/utils/update-one-operation-factory.util';
import { generateRecordName } from 'test/integration/utils/generate-record-name';
const COMPANY_1_ID = '777a8457-eb2d-40ac-a707-551b615b6987';
const COMPANY_2_ID = '777a8457-eb2d-40ac-a707-551b615b6988';
const COMPANY_3_ID = '777a8457-eb2d-40ac-a707-551b615b6989';
const COMPANY_GQL_FIELDS = `
id
name
employees
idealCustomerProfile
position
createdAt
updatedAt
deletedAt
accountOwnerId
tagline
workPolicy
visaSponsorship
`;
describe('companies resolvers (integration)', () => {
it('1. should create and return companies', async () => {
const companyName1 = generateRecordName(COMPANY_1_ID);
const companyName2 = generateRecordName(COMPANY_2_ID);
const graphqlOperation = createManyOperationFactory({
objectMetadataSingularName: 'company',
objectMetadataPluralName: 'companies',
gqlFields: COMPANY_GQL_FIELDS,
data: [
{
id: COMPANY_1_ID,
name: companyName1,
},
{
id: COMPANY_2_ID,
name: companyName2,
},
],
});
const response = await makeGraphqlAPIRequest(graphqlOperation);
expect(response.body.data.createCompanies).toHaveLength(2);
response.body.data.createCompanies.forEach((company) => {
expect(company).toHaveProperty('name');
expect([companyName1, companyName2]).toContain(company.name);
expect(company).toHaveProperty('employees');
expect(company).toHaveProperty('idealCustomerProfile');
expect(company).toHaveProperty('position');
expect(company).toHaveProperty('id');
expect(company).toHaveProperty('createdAt');
expect(company).toHaveProperty('updatedAt');
expect(company).toHaveProperty('deletedAt');
expect(company).toHaveProperty('accountOwnerId');
expect(company).toHaveProperty('tagline');
expect(company).toHaveProperty('workPolicy');
expect(company).toHaveProperty('visaSponsorship');
});
});
it('1b. should create and return one company', async () => {
const companyName = generateRecordName(COMPANY_3_ID);
const graphqlOperation = createOneOperationFactory({
objectMetadataSingularName: 'company',
gqlFields: COMPANY_GQL_FIELDS,
data: {
id: COMPANY_3_ID,
name: companyName,
},
});
const response = await makeGraphqlAPIRequest(graphqlOperation);
const createdCompany = response.body.data.createCompany;
expect(createdCompany).toHaveProperty('name');
expect(createdCompany.name).toEqual(companyName);
expect(createdCompany).toHaveProperty('employees');
expect(createdCompany).toHaveProperty('idealCustomerProfile');
expect(createdCompany).toHaveProperty('position');
expect(createdCompany).toHaveProperty('id');
expect(createdCompany).toHaveProperty('createdAt');
expect(createdCompany).toHaveProperty('updatedAt');
expect(createdCompany).toHaveProperty('deletedAt');
expect(createdCompany).toHaveProperty('accountOwnerId');
expect(createdCompany).toHaveProperty('tagline');
expect(createdCompany).toHaveProperty('workPolicy');
expect(createdCompany).toHaveProperty('visaSponsorship');
});
it('2. should find many companies', async () => {
const graphqlOperation = findManyOperationFactory({
objectMetadataSingularName: 'company',
objectMetadataPluralName: 'companies',
gqlFields: COMPANY_GQL_FIELDS,
});
const response = await makeGraphqlAPIRequest(graphqlOperation);
const data = response.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('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');
}
});
it('2b. should find one company', async () => {
const graphqlOperation = findOneOperationFactory({
objectMetadataSingularName: 'company',
gqlFields: COMPANY_GQL_FIELDS,
filter: {
id: {
eq: COMPANY_3_ID,
},
},
});
const response = await makeGraphqlAPIRequest(graphqlOperation);
const company = response.body.data.company;
expect(company).toHaveProperty('name');
expect(company).toHaveProperty('employees');
expect(company).toHaveProperty('idealCustomerProfile');
expect(company).toHaveProperty('position');
expect(company).toHaveProperty('id');
expect(company).toHaveProperty('createdAt');
expect(company).toHaveProperty('updatedAt');
expect(company).toHaveProperty('deletedAt');
expect(company).toHaveProperty('accountOwnerId');
expect(company).toHaveProperty('tagline');
expect(company).toHaveProperty('workPolicy');
expect(company).toHaveProperty('visaSponsorship');
});
it('3. should update many companies', async () => {
const graphqlOperation = updateManyOperationFactory({
objectMetadataSingularName: 'company',
objectMetadataPluralName: 'companies',
gqlFields: COMPANY_GQL_FIELDS,
data: {
employees: 123,
},
filter: {
id: {
in: [COMPANY_1_ID, COMPANY_2_ID],
},
},
});
const response = await makeGraphqlAPIRequest(graphqlOperation);
const updatedCompanies = response.body.data.updateCompanies;
expect(updatedCompanies).toHaveLength(2);
updatedCompanies.forEach((company) => {
expect(company.employees).toEqual(123);
});
});
it('3b. should update one company', async () => {
const graphqlOperation = updateOneOperationFactory({
objectMetadataSingularName: 'company',
gqlFields: COMPANY_GQL_FIELDS,
data: {
employees: 122,
},
recordId: COMPANY_3_ID,
});
const response = await makeGraphqlAPIRequest(graphqlOperation);
const updatedCompany = response.body.data.updateCompany;
expect(updatedCompany.employees).toEqual(122);
});
it('4. should find many companies with updated employees', async () => {
const graphqlOperation = findManyOperationFactory({
objectMetadataSingularName: 'company',
objectMetadataPluralName: 'companies',
gqlFields: COMPANY_GQL_FIELDS,
filter: {
employees: {
eq: 123,
},
},
});
const response = await makeGraphqlAPIRequest(graphqlOperation);
expect(response.body.data.companies.edges).toHaveLength(2);
});
it('4b. should find one company with updated employees', async () => {
const graphqlOperation = findOneOperationFactory({
objectMetadataSingularName: 'company',
gqlFields: COMPANY_GQL_FIELDS,
filter: {
employees: {
eq: 122,
},
},
});
const response = await makeGraphqlAPIRequest(graphqlOperation);
expect(response.body.data.company.employees).toEqual(122);
});
it('5. should delete many companies', async () => {
const graphqlOperation = deleteManyOperationFactory({
objectMetadataSingularName: 'company',
objectMetadataPluralName: 'companies',
gqlFields: COMPANY_GQL_FIELDS,
filter: {
id: {
in: [COMPANY_1_ID, COMPANY_2_ID],
},
},
});
const response = await makeGraphqlAPIRequest(graphqlOperation);
const deleteCompanies = response.body.data.deleteCompanies;
expect(deleteCompanies).toHaveLength(2);
deleteCompanies.forEach((company) => {
expect(company.deletedAt).toBeTruthy();
});
});
it('5b. should delete one company', async () => {
const graphqlOperation = deleteOneOperationFactory({
objectMetadataSingularName: 'company',
gqlFields: COMPANY_GQL_FIELDS,
recordId: COMPANY_3_ID,
});
const response = await makeGraphqlAPIRequest(graphqlOperation);
expect(response.body.data.deleteCompany.deletedAt).toBeTruthy();
});
it('6. should not find many companies anymore', async () => {
const graphqlOperation = findManyOperationFactory({
objectMetadataSingularName: 'company',
objectMetadataPluralName: 'companies',
gqlFields: COMPANY_GQL_FIELDS,
filter: {
id: {
in: [COMPANY_1_ID, COMPANY_2_ID],
},
},
});
const findCompaniesResponse = await makeGraphqlAPIRequest(graphqlOperation);
expect(findCompaniesResponse.body.data.companies.edges).toHaveLength(0);
});
it('6b. should not find one company anymore', async () => {
const graphqlOperation = findOneOperationFactory({
objectMetadataSingularName: 'company',
gqlFields: COMPANY_GQL_FIELDS,
filter: {
id: {
eq: COMPANY_3_ID,
},
},
});
const response = await makeGraphqlAPIRequest(graphqlOperation);
expect(response.body.data.company).toBeNull();
});
it('7. should find many deleted companies with deletedAt filter', async () => {
const graphqlOperation = findManyOperationFactory({
objectMetadataSingularName: 'company',
objectMetadataPluralName: 'companies',
gqlFields: COMPANY_GQL_FIELDS,
filter: {
id: {
in: [COMPANY_1_ID, COMPANY_2_ID],
},
not: {
deletedAt: {
is: 'NULL',
},
},
},
});
const response = await makeGraphqlAPIRequest(graphqlOperation);
expect(response.body.data.companies.edges).toHaveLength(2);
});
it('7b. should find one deleted company with deletedAt filter', async () => {
const graphqlOperation = findOneOperationFactory({
objectMetadataSingularName: 'company',
gqlFields: COMPANY_GQL_FIELDS,
filter: {
id: {
eq: COMPANY_3_ID,
},
not: {
deletedAt: {
is: 'NULL',
},
},
},
});
const response = await makeGraphqlAPIRequest(graphqlOperation);
expect(response.body.data.company.id).toEqual(COMPANY_3_ID);
});
it('8. should destroy many companies', async () => {
const graphqlOperation = destroyManyOperationFactory({
objectMetadataSingularName: 'company',
objectMetadataPluralName: 'companies',
gqlFields: COMPANY_GQL_FIELDS,
filter: {
id: {
in: [COMPANY_1_ID, COMPANY_2_ID],
},
},
});
const response = await makeGraphqlAPIRequest(graphqlOperation);
expect(response.body.data.destroyCompanies).toHaveLength(2);
});
it('8b. should destroy one company', async () => {
const graphqlOperation = destroyOneOperationFactory({
objectMetadataSingularName: 'company',
gqlFields: COMPANY_GQL_FIELDS,
recordId: COMPANY_3_ID,
});
const destroyCompanyResponse =
await makeGraphqlAPIRequest(graphqlOperation);
expect(destroyCompanyResponse.body.data.destroyCompany).toBeTruthy();
});
it('9. should not find many companies anymore', async () => {
const graphqlOperation = findManyOperationFactory({
objectMetadataSingularName: 'company',
objectMetadataPluralName: 'companies',
gqlFields: COMPANY_GQL_FIELDS,
filter: {
id: {
in: [COMPANY_1_ID, COMPANY_2_ID],
},
not: {
deletedAt: {
is: 'NULL',
},
},
},
});
const response = await makeGraphqlAPIRequest(graphqlOperation);
expect(response.body.data.companies.edges).toHaveLength(0);
});
it('9b. should not find one company anymore', async () => {
const graphqlOperation = findOneOperationFactory({
objectMetadataSingularName: 'company',
gqlFields: COMPANY_GQL_FIELDS,
filter: {
id: {
eq: COMPANY_3_ID,
},
not: {
deletedAt: {
is: 'NULL',
},
},
},
});
const response = await makeGraphqlAPIRequest(graphqlOperation);
expect(response.body.data.company).toBeNull();
});
});

View File

@ -2,7 +2,7 @@ import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`); const client = request(`http://localhost:${APP_PORT}`);
describe('activitiesResolver (integration)', () => { describe('activitiesResolver (e2e)', () => {
it('should find many activities', () => { it('should find many activities', () => {
const queryData = { const queryData = {
query: ` query: `

View File

@ -2,7 +2,7 @@ import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`); const client = request(`http://localhost:${APP_PORT}`);
describe('activityTargetsResolver (integration)', () => { describe('activityTargetsResolver (e2e)', () => {
it('should find many activityTargets', () => { it('should find many activityTargets', () => {
const queryData = { const queryData = {
query: ` query: `
@ -18,6 +18,7 @@ describe('activityTargetsResolver (integration)', () => {
personId personId
companyId companyId
opportunityId opportunityId
rocketId
} }
} }
} }
@ -53,6 +54,7 @@ describe('activityTargetsResolver (integration)', () => {
expect(activityTargets).toHaveProperty('personId'); expect(activityTargets).toHaveProperty('personId');
expect(activityTargets).toHaveProperty('companyId'); expect(activityTargets).toHaveProperty('companyId');
expect(activityTargets).toHaveProperty('opportunityId'); expect(activityTargets).toHaveProperty('opportunityId');
expect(activityTargets).toHaveProperty('rocketId');
} }
}); });
}); });

View File

@ -2,7 +2,7 @@ import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`); const client = request(`http://localhost:${APP_PORT}`);
describe('apiKeysResolver (integration)', () => { describe('apiKeysResolver (e2e)', () => {
it('should find many apiKeys', () => { it('should find many apiKeys', () => {
const queryData = { const queryData = {
query: ` query: `

View File

@ -2,7 +2,7 @@ import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`); const client = request(`http://localhost:${APP_PORT}`);
describe('attachmentsResolver (integration)', () => { describe('attachmentsResolver (e2e)', () => {
it('should find many attachments', () => { it('should find many attachments', () => {
const queryData = { const queryData = {
query: ` query: `
@ -24,6 +24,7 @@ describe('attachmentsResolver (integration)', () => {
personId personId
companyId companyId
opportunityId opportunityId
rocketId
} }
} }
} }
@ -65,6 +66,7 @@ describe('attachmentsResolver (integration)', () => {
expect(attachments).toHaveProperty('personId'); expect(attachments).toHaveProperty('personId');
expect(attachments).toHaveProperty('companyId'); expect(attachments).toHaveProperty('companyId');
expect(attachments).toHaveProperty('opportunityId'); expect(attachments).toHaveProperty('opportunityId');
expect(attachments).toHaveProperty('rocketId');
} }
}); });
}); });

View File

@ -2,7 +2,7 @@ import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`); const client = request(`http://localhost:${APP_PORT}`);
describe('auditLogsResolver (integration)', () => { describe('auditLogsResolver (e2e)', () => {
it('should find many auditLogs', () => { it('should find many auditLogs', () => {
const queryData = { const queryData = {
query: ` query: `

View File

@ -2,7 +2,7 @@ import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`); const client = request(`http://localhost:${APP_PORT}`);
describe('blocklistsResolver (integration)', () => { describe('blocklistsResolver (e2e)', () => {
it('should find many blocklists', () => { it('should find many blocklists', () => {
const queryData = { const queryData = {
query: ` query: `

View File

@ -2,7 +2,7 @@ import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`); const client = request(`http://localhost:${APP_PORT}`);
describe('calendarChannelEventAssociationsResolver (integration)', () => { describe('calendarChannelEventAssociationsResolver (e2e)', () => {
it('should find many calendarChannelEventAssociations', () => { it('should find many calendarChannelEventAssociations', () => {
const queryData = { const queryData = {
query: ` query: `
@ -11,6 +11,7 @@ describe('calendarChannelEventAssociationsResolver (integration)', () => {
edges { edges {
node { node {
eventExternalId eventExternalId
recurringEventExternalId
id id
createdAt createdAt
updatedAt updatedAt
@ -47,6 +48,9 @@ describe('calendarChannelEventAssociationsResolver (integration)', () => {
expect(calendarChannelEventAssociations).toHaveProperty( expect(calendarChannelEventAssociations).toHaveProperty(
'eventExternalId', 'eventExternalId',
); );
expect(calendarChannelEventAssociations).toHaveProperty(
'recurringEventExternalId',
);
expect(calendarChannelEventAssociations).toHaveProperty('id'); expect(calendarChannelEventAssociations).toHaveProperty('id');
expect(calendarChannelEventAssociations).toHaveProperty('createdAt'); expect(calendarChannelEventAssociations).toHaveProperty('createdAt');
expect(calendarChannelEventAssociations).toHaveProperty('updatedAt'); expect(calendarChannelEventAssociations).toHaveProperty('updatedAt');

View File

@ -2,7 +2,7 @@ import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`); const client = request(`http://localhost:${APP_PORT}`);
describe('calendarChannelsResolver (integration)', () => { describe('calendarChannelsResolver (e2e)', () => {
it('should find many calendarChannels', () => { it('should find many calendarChannels', () => {
const queryData = { const queryData = {
query: ` query: `
@ -18,6 +18,7 @@ describe('calendarChannelsResolver (integration)', () => {
contactAutoCreationPolicy contactAutoCreationPolicy
isSyncEnabled isSyncEnabled
syncCursor syncCursor
syncedAt
syncStageStartedAt syncStageStartedAt
throttleFailureCount throttleFailureCount
id id
@ -62,6 +63,7 @@ describe('calendarChannelsResolver (integration)', () => {
expect(calendarChannels).toHaveProperty('contactAutoCreationPolicy'); expect(calendarChannels).toHaveProperty('contactAutoCreationPolicy');
expect(calendarChannels).toHaveProperty('isSyncEnabled'); expect(calendarChannels).toHaveProperty('isSyncEnabled');
expect(calendarChannels).toHaveProperty('syncCursor'); expect(calendarChannels).toHaveProperty('syncCursor');
expect(calendarChannels).toHaveProperty('syncedAt');
expect(calendarChannels).toHaveProperty('syncStageStartedAt'); expect(calendarChannels).toHaveProperty('syncStageStartedAt');
expect(calendarChannels).toHaveProperty('throttleFailureCount'); expect(calendarChannels).toHaveProperty('throttleFailureCount');
expect(calendarChannels).toHaveProperty('id'); expect(calendarChannels).toHaveProperty('id');

View File

@ -2,7 +2,7 @@ import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`); const client = request(`http://localhost:${APP_PORT}`);
describe('calendarEventParticipantsResolver (integration)', () => { describe('calendarEventParticipantsResolver (e2e)', () => {
it('should find many calendarEventParticipants', () => { it('should find many calendarEventParticipants', () => {
const queryData = { const queryData = {
query: ` query: `

View File

@ -2,7 +2,7 @@ import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`); const client = request(`http://localhost:${APP_PORT}`);
describe('commentsResolver (integration)', () => { describe('commentsResolver (e2e)', () => {
it('should find many comments', () => { it('should find many comments', () => {
const queryData = { const queryData = {
query: ` query: `

View File

@ -2,7 +2,7 @@ import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`); const client = request(`http://localhost:${APP_PORT}`);
describe('companiesResolver (integration)', () => { describe('companiesResolver (e2e)', () => {
it('should find many companies', () => { it('should find many companies', () => {
const queryData = { const queryData = {
query: ` query: `
@ -14,6 +14,7 @@ describe('companiesResolver (integration)', () => {
employees employees
idealCustomerProfile idealCustomerProfile
position position
searchVector
id id
createdAt createdAt
updatedAt updatedAt
@ -53,6 +54,7 @@ describe('companiesResolver (integration)', () => {
expect(companies).toHaveProperty('employees'); expect(companies).toHaveProperty('employees');
expect(companies).toHaveProperty('idealCustomerProfile'); expect(companies).toHaveProperty('idealCustomerProfile');
expect(companies).toHaveProperty('position'); expect(companies).toHaveProperty('position');
expect(companies).toHaveProperty('searchVector');
expect(companies).toHaveProperty('id'); expect(companies).toHaveProperty('id');
expect(companies).toHaveProperty('createdAt'); expect(companies).toHaveProperty('createdAt');
expect(companies).toHaveProperty('updatedAt'); expect(companies).toHaveProperty('updatedAt');

View File

@ -2,7 +2,7 @@ import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`); const client = request(`http://localhost:${APP_PORT}`);
describe('connectedAccountsResolver (integration)', () => { describe('connectedAccountsResolver (e2e)', () => {
it('should find many connectedAccounts', () => { it('should find many connectedAccounts', () => {
const queryData = { const queryData = {
query: ` query: `
@ -17,6 +17,7 @@ describe('connectedAccountsResolver (integration)', () => {
lastSyncHistoryId lastSyncHistoryId
authFailedAt authFailedAt
handleAliases handleAliases
scopes
id id
createdAt createdAt
updatedAt updatedAt
@ -56,6 +57,7 @@ describe('connectedAccountsResolver (integration)', () => {
expect(connectedAccounts).toHaveProperty('lastSyncHistoryId'); expect(connectedAccounts).toHaveProperty('lastSyncHistoryId');
expect(connectedAccounts).toHaveProperty('authFailedAt'); expect(connectedAccounts).toHaveProperty('authFailedAt');
expect(connectedAccounts).toHaveProperty('handleAliases'); expect(connectedAccounts).toHaveProperty('handleAliases');
expect(connectedAccounts).toHaveProperty('scopes');
expect(connectedAccounts).toHaveProperty('id'); expect(connectedAccounts).toHaveProperty('id');
expect(connectedAccounts).toHaveProperty('createdAt'); expect(connectedAccounts).toHaveProperty('createdAt');
expect(connectedAccounts).toHaveProperty('updatedAt'); expect(connectedAccounts).toHaveProperty('updatedAt');

View File

@ -2,7 +2,7 @@ import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`); const client = request(`http://localhost:${APP_PORT}`);
describe('favoritesResolver (integration)', () => { describe('favoritesResolver (e2e)', () => {
it('should find many favorites', () => { it('should find many favorites', () => {
const queryData = { const queryData = {
query: ` query: `
@ -19,9 +19,13 @@ describe('favoritesResolver (integration)', () => {
personId personId
companyId companyId
opportunityId opportunityId
workflowId
workflowVersionId
workflowRunId
taskId taskId
noteId noteId
viewId viewId
rocketId
} }
} }
} }
@ -58,9 +62,13 @@ describe('favoritesResolver (integration)', () => {
expect(favorites).toHaveProperty('personId'); expect(favorites).toHaveProperty('personId');
expect(favorites).toHaveProperty('companyId'); expect(favorites).toHaveProperty('companyId');
expect(favorites).toHaveProperty('opportunityId'); expect(favorites).toHaveProperty('opportunityId');
expect(favorites).toHaveProperty('workflowId');
expect(favorites).toHaveProperty('workflowVersionId');
expect(favorites).toHaveProperty('workflowRunId');
expect(favorites).toHaveProperty('taskId'); expect(favorites).toHaveProperty('taskId');
expect(favorites).toHaveProperty('noteId'); expect(favorites).toHaveProperty('noteId');
expect(favorites).toHaveProperty('viewId'); 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

@ -2,7 +2,7 @@ import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`); const client = request(`http://localhost:${APP_PORT}`);
describe('messageChannelMessageAssociationsResolver (integration)', () => { describe('messageChannelMessageAssociationsResolver (e2e)', () => {
it('should find many messageChannelMessageAssociations', () => { it('should find many messageChannelMessageAssociations', () => {
const queryData = { const queryData = {
query: ` query: `
@ -10,11 +10,11 @@ describe('messageChannelMessageAssociationsResolver (integration)', () => {
messageChannelMessageAssociations { messageChannelMessageAssociations {
edges { edges {
node { node {
createdAt
messageExternalId messageExternalId
messageThreadExternalId messageThreadExternalId
direction direction
id id
createdAt
updatedAt updatedAt
deletedAt deletedAt
messageChannelId messageChannelId
@ -46,7 +46,6 @@ describe('messageChannelMessageAssociationsResolver (integration)', () => {
if (edges.length > 0) { if (edges.length > 0) {
const messageChannelMessageAssociations = edges[0].node; const messageChannelMessageAssociations = edges[0].node;
expect(messageChannelMessageAssociations).toHaveProperty('createdAt');
expect(messageChannelMessageAssociations).toHaveProperty( expect(messageChannelMessageAssociations).toHaveProperty(
'messageExternalId', 'messageExternalId',
); );
@ -55,6 +54,7 @@ describe('messageChannelMessageAssociationsResolver (integration)', () => {
); );
expect(messageChannelMessageAssociations).toHaveProperty('direction'); expect(messageChannelMessageAssociations).toHaveProperty('direction');
expect(messageChannelMessageAssociations).toHaveProperty('id'); expect(messageChannelMessageAssociations).toHaveProperty('id');
expect(messageChannelMessageAssociations).toHaveProperty('createdAt');
expect(messageChannelMessageAssociations).toHaveProperty('updatedAt'); expect(messageChannelMessageAssociations).toHaveProperty('updatedAt');
expect(messageChannelMessageAssociations).toHaveProperty('deletedAt'); expect(messageChannelMessageAssociations).toHaveProperty('deletedAt');
expect(messageChannelMessageAssociations).toHaveProperty( expect(messageChannelMessageAssociations).toHaveProperty(

View File

@ -2,7 +2,7 @@ import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`); const client = request(`http://localhost:${APP_PORT}`);
describe('messageChannelsResolver (integration)', () => { describe('messageChannelsResolver (e2e)', () => {
it('should find many messageChannels', () => { it('should find many messageChannels', () => {
const queryData = { const queryData = {
query: ` query: `

View File

@ -2,7 +2,7 @@ import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`); const client = request(`http://localhost:${APP_PORT}`);
describe('messageParticipantsResolver (integration)', () => { describe('messageParticipantsResolver (e2e)', () => {
it('should find many messageParticipants', () => { it('should find many messageParticipants', () => {
const queryData = { const queryData = {
query: ` query: `

View File

@ -2,7 +2,7 @@ import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`); const client = request(`http://localhost:${APP_PORT}`);
describe('messageThreadsResolver (integration)', () => { describe('messageThreadsResolver (e2e)', () => {
it('should find many messageThreads', () => { it('should find many messageThreads', () => {
const queryData = { const queryData = {
query: ` query: `

View File

@ -2,7 +2,7 @@ import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`); const client = request(`http://localhost:${APP_PORT}`);
describe('noteTargetsResolver (integration)', () => { describe('noteTargetsResolver (e2e)', () => {
it('should find many noteTargets', () => { it('should find many noteTargets', () => {
const queryData = { const queryData = {
query: ` query: `
@ -18,6 +18,7 @@ describe('noteTargetsResolver (integration)', () => {
personId personId
companyId companyId
opportunityId opportunityId
rocketId
} }
} }
} }
@ -53,6 +54,7 @@ describe('noteTargetsResolver (integration)', () => {
expect(noteTargets).toHaveProperty('personId'); expect(noteTargets).toHaveProperty('personId');
expect(noteTargets).toHaveProperty('companyId'); expect(noteTargets).toHaveProperty('companyId');
expect(noteTargets).toHaveProperty('opportunityId'); expect(noteTargets).toHaveProperty('opportunityId');
expect(noteTargets).toHaveProperty('rocketId');
} }
}); });
}); });

View File

@ -2,7 +2,7 @@ import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`); const client = request(`http://localhost:${APP_PORT}`);
describe('notesResolver (integration)', () => { describe('notesResolver (e2e)', () => {
it('should find many notes', () => { it('should find many notes', () => {
const queryData = { const queryData = {
query: ` query: `

View File

@ -2,7 +2,7 @@ import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`); const client = request(`http://localhost:${APP_PORT}`);
describe('objectsResolver (integration)', () => { describe('objectsResolver (e2e)', () => {
it('should find many objects', () => { it('should find many objects', () => {
const queryData = { const queryData = {
query: ` query: `

View File

@ -2,7 +2,7 @@ import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`); const client = request(`http://localhost:${APP_PORT}`);
describe('opportunitiesResolver (integration)', () => { describe('opportunitiesResolver (e2e)', () => {
it('should find many opportunities', () => { it('should find many opportunities', () => {
const queryData = { const queryData = {
query: ` query: `
@ -14,6 +14,7 @@ describe('opportunitiesResolver (integration)', () => {
closeDate closeDate
stage stage
position position
searchVector
id id
createdAt createdAt
updatedAt updatedAt
@ -51,6 +52,7 @@ describe('opportunitiesResolver (integration)', () => {
expect(opportunities).toHaveProperty('closeDate'); expect(opportunities).toHaveProperty('closeDate');
expect(opportunities).toHaveProperty('stage'); expect(opportunities).toHaveProperty('stage');
expect(opportunities).toHaveProperty('position'); expect(opportunities).toHaveProperty('position');
expect(opportunities).toHaveProperty('searchVector');
expect(opportunities).toHaveProperty('id'); expect(opportunities).toHaveProperty('id');
expect(opportunities).toHaveProperty('createdAt'); expect(opportunities).toHaveProperty('createdAt');
expect(opportunities).toHaveProperty('updatedAt'); expect(opportunities).toHaveProperty('updatedAt');

View File

@ -2,7 +2,7 @@ import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`); const client = request(`http://localhost:${APP_PORT}`);
describe('peopleResolver (integration)', () => { describe('peopleResolver (e2e)', () => {
it('should find many people', () => { it('should find many people', () => {
const queryData = { const queryData = {
query: ` query: `
@ -11,22 +11,16 @@ describe('peopleResolver (integration)', () => {
edges { edges {
node { node {
jobTitle jobTitle
phones {
primaryPhoneNumber
primaryPhoneCountryCode
}
city city
avatarUrl avatarUrl
position position
searchVector
id id
createdAt createdAt
updatedAt updatedAt
deletedAt deletedAt
companyId companyId
intro intro
whatsapp {
primaryPhoneNumber
}
workPreference workPreference
performanceRating performanceRating
} }
@ -42,7 +36,6 @@ describe('peopleResolver (integration)', () => {
.send(queryData) .send(queryData)
.expect(200) .expect(200)
.expect((res) => { .expect((res) => {
console.log(res.body);
expect(res.body.data).toBeDefined(); expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined(); expect(res.body.errors).toBeUndefined();
}) })
@ -58,17 +51,16 @@ describe('peopleResolver (integration)', () => {
const people = edges[0].node; const people = edges[0].node;
expect(people).toHaveProperty('jobTitle'); expect(people).toHaveProperty('jobTitle');
expect(people).toHaveProperty('phones');
expect(people).toHaveProperty('city'); expect(people).toHaveProperty('city');
expect(people).toHaveProperty('avatarUrl'); expect(people).toHaveProperty('avatarUrl');
expect(people).toHaveProperty('position'); expect(people).toHaveProperty('position');
expect(people).toHaveProperty('searchVector');
expect(people).toHaveProperty('id'); expect(people).toHaveProperty('id');
expect(people).toHaveProperty('createdAt'); expect(people).toHaveProperty('createdAt');
expect(people).toHaveProperty('updatedAt'); expect(people).toHaveProperty('updatedAt');
expect(people).toHaveProperty('deletedAt'); expect(people).toHaveProperty('deletedAt');
expect(people).toHaveProperty('companyId'); expect(people).toHaveProperty('companyId');
expect(people).toHaveProperty('intro'); expect(people).toHaveProperty('intro');
expect(people).toHaveProperty('whatsapp');
expect(people).toHaveProperty('workPreference'); expect(people).toHaveProperty('workPreference');
expect(people).toHaveProperty('performanceRating'); 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

@ -2,7 +2,7 @@ import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`); const client = request(`http://localhost:${APP_PORT}`);
describe('taskTargetsResolver (integration)', () => { describe('taskTargetsResolver (e2e)', () => {
it('should find many taskTargets', () => { it('should find many taskTargets', () => {
const queryData = { const queryData = {
query: ` query: `
@ -18,6 +18,7 @@ describe('taskTargetsResolver (integration)', () => {
personId personId
companyId companyId
opportunityId opportunityId
rocketId
} }
} }
} }
@ -53,6 +54,7 @@ describe('taskTargetsResolver (integration)', () => {
expect(taskTargets).toHaveProperty('personId'); expect(taskTargets).toHaveProperty('personId');
expect(taskTargets).toHaveProperty('companyId'); expect(taskTargets).toHaveProperty('companyId');
expect(taskTargets).toHaveProperty('opportunityId'); expect(taskTargets).toHaveProperty('opportunityId');
expect(taskTargets).toHaveProperty('rocketId');
} }
}); });
}); });

View File

@ -2,7 +2,7 @@ import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`); const client = request(`http://localhost:${APP_PORT}`);
describe('tasksResolver (integration)', () => { describe('tasksResolver (e2e)', () => {
it('should find many tasks', () => { it('should find many tasks', () => {
const queryData = { const queryData = {
query: ` query: `

View File

@ -2,7 +2,7 @@ import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`); const client = request(`http://localhost:${APP_PORT}`);
describe('timelineActivitiesResolver (integration)', () => { describe('timelineActivitiesResolver (e2e)', () => {
it('should find many timelineActivities', () => { it('should find many timelineActivities', () => {
const queryData = { const queryData = {
query: ` query: `
@ -26,6 +26,10 @@ describe('timelineActivitiesResolver (integration)', () => {
opportunityId opportunityId
noteId noteId
taskId taskId
workflowId
workflowVersionId
workflowRunId
rocketId
} }
} }
} }
@ -69,6 +73,10 @@ describe('timelineActivitiesResolver (integration)', () => {
expect(timelineActivities).toHaveProperty('opportunityId'); expect(timelineActivities).toHaveProperty('opportunityId');
expect(timelineActivities).toHaveProperty('noteId'); expect(timelineActivities).toHaveProperty('noteId');
expect(timelineActivities).toHaveProperty('taskId'); expect(timelineActivities).toHaveProperty('taskId');
expect(timelineActivities).toHaveProperty('workflowId');
expect(timelineActivities).toHaveProperty('workflowVersionId');
expect(timelineActivities).toHaveProperty('workflowRunId');
expect(timelineActivities).toHaveProperty('rocketId');
} }
}); });
}); });

View File

@ -2,7 +2,7 @@ import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`); const client = request(`http://localhost:${APP_PORT}`);
describe('viewFieldsResolver (integration)', () => { describe('viewFieldsResolver (e2e)', () => {
it('should find many viewFields', () => { it('should find many viewFields', () => {
const queryData = { const queryData = {
query: ` query: `

View File

@ -2,7 +2,7 @@ import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`); const client = request(`http://localhost:${APP_PORT}`);
describe('viewFiltersResolver (integration)', () => { describe('viewFiltersResolver (e2e)', () => {
it('should find many viewFilters', () => { it('should find many viewFilters', () => {
const queryData = { const queryData = {
query: ` query: `

View File

@ -2,7 +2,7 @@ import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`); const client = request(`http://localhost:${APP_PORT}`);
describe('viewSortsResolver (integration)', () => { describe('viewSortsResolver (e2e)', () => {
it('should find many viewSorts', () => { it('should find many viewSorts', () => {
const queryData = { const queryData = {
query: ` query: `

View File

@ -2,7 +2,7 @@ import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`); const client = request(`http://localhost:${APP_PORT}`);
describe('viewsResolver (integration)', () => { describe('viewsResolver (e2e)', () => {
it('should find many views', () => { it('should find many views', () => {
const queryData = { const queryData = {
query: ` query: `
@ -10,13 +10,13 @@ describe('viewsResolver (integration)', () => {
views { views {
edges { edges {
node { node {
position
name name
objectMetadataId objectMetadataId
type type
key key
icon icon
kanbanFieldMetadataId kanbanFieldMetadataId
position
isCompact isCompact
id id
createdAt createdAt
@ -49,13 +49,13 @@ describe('viewsResolver (integration)', () => {
if (edges.length > 0) { if (edges.length > 0) {
const views = edges[0].node; const views = edges[0].node;
expect(views).toHaveProperty('position');
expect(views).toHaveProperty('name'); expect(views).toHaveProperty('name');
expect(views).toHaveProperty('objectMetadataId'); expect(views).toHaveProperty('objectMetadataId');
expect(views).toHaveProperty('type'); expect(views).toHaveProperty('type');
expect(views).toHaveProperty('key'); expect(views).toHaveProperty('key');
expect(views).toHaveProperty('icon'); expect(views).toHaveProperty('icon');
expect(views).toHaveProperty('kanbanFieldMetadataId'); expect(views).toHaveProperty('kanbanFieldMetadataId');
expect(views).toHaveProperty('position');
expect(views).toHaveProperty('isCompact'); expect(views).toHaveProperty('isCompact');
expect(views).toHaveProperty('id'); expect(views).toHaveProperty('id');
expect(views).toHaveProperty('createdAt'); expect(views).toHaveProperty('createdAt');

View File

@ -2,7 +2,7 @@ import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`); const client = request(`http://localhost:${APP_PORT}`);
describe('webhooksResolver (integration)', () => { describe('webhooksResolver (e2e)', () => {
it('should find many webhooks', () => { it('should find many webhooks', () => {
const queryData = { const queryData = {
query: ` query: `
@ -10,10 +10,10 @@ describe('webhooksResolver (integration)', () => {
webhooks { webhooks {
edges { edges {
node { node {
id
targetUrl targetUrl
operation operation
description description
id
createdAt createdAt
updatedAt updatedAt
deletedAt deletedAt
@ -44,10 +44,10 @@ describe('webhooksResolver (integration)', () => {
if (edges.length > 0) { if (edges.length > 0) {
const webhooks = edges[0].node; const webhooks = edges[0].node;
expect(webhooks).toHaveProperty('id');
expect(webhooks).toHaveProperty('targetUrl'); expect(webhooks).toHaveProperty('targetUrl');
expect(webhooks).toHaveProperty('operation'); expect(webhooks).toHaveProperty('operation');
expect(webhooks).toHaveProperty('description'); expect(webhooks).toHaveProperty('description');
expect(webhooks).toHaveProperty('id');
expect(webhooks).toHaveProperty('createdAt'); expect(webhooks).toHaveProperty('createdAt');
expect(webhooks).toHaveProperty('updatedAt'); expect(webhooks).toHaveProperty('updatedAt');
expect(webhooks).toHaveProperty('deletedAt'); 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

@ -2,7 +2,7 @@ import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`); const client = request(`http://localhost:${APP_PORT}`);
describe('workspaceMembersResolver (integration)', () => { describe('workspaceMembersResolver (e2e)', () => {
it('should find many workspaceMembers', () => { it('should find many workspaceMembers', () => {
const queryData = { const queryData = {
query: ` query: `

View File

@ -0,0 +1,28 @@
import gql from 'graphql-tag';
import { capitalize } from 'src/utils/capitalize';
type CreateManyOperationFactoryParams = {
objectMetadataSingularName: string;
objectMetadataPluralName: string;
gqlFields: string;
data?: object;
};
export const createManyOperationFactory = ({
objectMetadataSingularName,
objectMetadataPluralName,
gqlFields,
data = {},
}: CreateManyOperationFactoryParams) => ({
query: gql`
mutation Create${capitalize(objectMetadataSingularName)}($data: [${capitalize(objectMetadataSingularName)}CreateInput!]!) {
create${capitalize(objectMetadataPluralName)}(data: $data) {
${gqlFields}
}
}
`,
variables: {
data,
},
});

View File

@ -0,0 +1,26 @@
import gql from 'graphql-tag';
import { capitalize } from 'src/utils/capitalize';
type CreateOneOperationFactoryParams = {
objectMetadataSingularName: string;
gqlFields: string;
data?: object;
};
export const createOneOperationFactory = ({
objectMetadataSingularName,
gqlFields,
data = {},
}: CreateOneOperationFactoryParams) => ({
query: gql`
mutation Create${capitalize(objectMetadataSingularName)}($data: ${capitalize(objectMetadataSingularName)}CreateInput) {
create${capitalize(objectMetadataSingularName)}(data: $data) {
${gqlFields}
}
}
`,
variables: {
data,
},
});

View File

@ -0,0 +1,30 @@
import gql from 'graphql-tag';
import { capitalize } from 'src/utils/capitalize';
type DeleteManyOperationFactoryParams = {
objectMetadataSingularName: string;
objectMetadataPluralName: string;
gqlFields: string;
filter?: object;
};
export const deleteManyOperationFactory = ({
objectMetadataSingularName,
objectMetadataPluralName,
gqlFields,
filter = {},
}: DeleteManyOperationFactoryParams) => ({
query: gql`
mutation Delete${capitalize(objectMetadataPluralName)}(
$filter: ${capitalize(objectMetadataSingularName)}FilterInput
) {
delete${capitalize(objectMetadataPluralName)}(filter: $filter) {
${gqlFields}
}
}
`,
variables: {
filter,
},
});

View File

@ -0,0 +1,26 @@
import gql from 'graphql-tag';
import { capitalize } from 'src/utils/capitalize';
type DeleteOneOperationFactoryParams = {
objectMetadataSingularName: string;
gqlFields: string;
recordId: string;
};
export const deleteOneOperationFactory = ({
objectMetadataSingularName,
gqlFields,
recordId,
}: DeleteOneOperationFactoryParams) => ({
query: gql`
mutation Delete${capitalize(objectMetadataSingularName)}($${objectMetadataSingularName}Id: ID!) {
delete${capitalize(objectMetadataSingularName)}(id: $${objectMetadataSingularName}Id) {
${gqlFields}
}
}
`,
variables: {
[`${objectMetadataSingularName}Id`]: recordId,
},
});

View File

@ -0,0 +1,30 @@
import gql from 'graphql-tag';
import { capitalize } from 'src/utils/capitalize';
type DestroyManyOperationFactoryParams = {
objectMetadataSingularName: string;
objectMetadataPluralName: string;
gqlFields: string;
filter?: object;
};
export const destroyManyOperationFactory = ({
objectMetadataSingularName,
objectMetadataPluralName,
gqlFields,
filter = {},
}: DestroyManyOperationFactoryParams) => ({
query: gql`
mutation Destroy${capitalize(objectMetadataPluralName)}(
$filter: ${capitalize(objectMetadataSingularName)}FilterInput
) {
destroy${capitalize(objectMetadataPluralName)}(filter: $filter) {
${gqlFields}
}
}
`,
variables: {
filter,
},
});

View File

@ -0,0 +1,26 @@
import gql from 'graphql-tag';
import { capitalize } from 'src/utils/capitalize';
type DestroyOneOperationFactoryParams = {
objectMetadataSingularName: string;
gqlFields: string;
recordId: string;
};
export const destroyOneOperationFactory = ({
objectMetadataSingularName,
gqlFields,
recordId,
}: DestroyOneOperationFactoryParams) => ({
query: gql`
mutation Destroy${capitalize(objectMetadataSingularName)}($${objectMetadataSingularName}Id: ID!) {
destroy${capitalize(objectMetadataSingularName)}(id: $${objectMetadataSingularName}Id) {
${gqlFields}
}
}
`,
variables: {
[`${objectMetadataSingularName}Id`]: recordId,
},
});

View File

@ -0,0 +1,32 @@
import gql from 'graphql-tag';
import { capitalize } from 'src/utils/capitalize';
type FindManyOperationFactoryParams = {
objectMetadataSingularName: string;
objectMetadataPluralName: string;
gqlFields: string;
filter?: object;
};
export const findManyOperationFactory = ({
objectMetadataSingularName,
objectMetadataPluralName,
gqlFields,
filter = {},
}: FindManyOperationFactoryParams) => ({
query: gql`
query ${capitalize(objectMetadataPluralName)}($filter: ${capitalize(objectMetadataSingularName)}FilterInput) {
${objectMetadataPluralName}(filter: $filter) {
edges {
node {
${gqlFields}
}
}
}
}
`,
variables: {
filter,
},
});

View File

@ -0,0 +1,26 @@
import gql from 'graphql-tag';
import { capitalize } from 'src/utils/capitalize';
type FindOneOperationFactoryParams = {
objectMetadataSingularName: string;
gqlFields: string;
filter?: object;
};
export const findOneOperationFactory = ({
objectMetadataSingularName,
gqlFields,
filter = {},
}: FindOneOperationFactoryParams) => ({
query: gql`
query ${capitalize(objectMetadataSingularName)}($filter: ${capitalize(objectMetadataSingularName)}FilterInput) {
${objectMetadataSingularName}(filter: $filter) {
${gqlFields}
}
}
`,
variables: {
filter,
},
});

View File

@ -0,0 +1,19 @@
import { ASTNode, print } from 'graphql';
import request from 'supertest';
type GraphqlOperation = {
query: ASTNode;
variables?: Record<string, unknown>;
};
export const makeGraphqlAPIRequest = (graphqlOperation: GraphqlOperation) => {
const client = request(`http://localhost:${APP_PORT}`);
return client
.post('/graphql')
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
.send({
query: print(graphqlOperation.query),
variables: graphqlOperation.variables || {},
});
};

View File

@ -0,0 +1,34 @@
import gql from 'graphql-tag';
import { capitalize } from 'src/utils/capitalize';
type UpdateManyOperationFactoryParams = {
objectMetadataSingularName: string;
objectMetadataPluralName: string;
gqlFields: string;
data?: object;
filter?: object;
};
export const updateManyOperationFactory = ({
objectMetadataSingularName,
objectMetadataPluralName,
gqlFields,
data = {},
filter = {},
}: UpdateManyOperationFactoryParams) => ({
query: gql`
mutation Update${capitalize(objectMetadataPluralName)}(
$data: ${capitalize(objectMetadataSingularName)}UpdateInput
$filter: ${capitalize(objectMetadataSingularName)}FilterInput
) {
update${capitalize(objectMetadataPluralName)}(data: $data, filter: $filter) {
${gqlFields}
}
}
`,
variables: {
data,
filter,
},
});

View File

@ -0,0 +1,29 @@
import gql from 'graphql-tag';
import { capitalize } from 'src/utils/capitalize';
type UpdateOneOperationFactoryParams = {
objectMetadataSingularName: string;
gqlFields: string;
data?: object;
recordId: string;
};
export const updateOneOperationFactory = ({
objectMetadataSingularName,
gqlFields,
data = {},
recordId,
}: UpdateOneOperationFactoryParams) => ({
query: gql`
mutation Update${capitalize(objectMetadataSingularName)}($${objectMetadataSingularName}Id: ID, $data: ${capitalize(objectMetadataSingularName)}UpdateInput) {
update${capitalize(objectMetadataSingularName)}(id: $${objectMetadataSingularName}Id, data: $data) {
${gqlFields}
}
}
`,
variables: {
data,
[`${objectMetadataSingularName}Id`]: recordId,
},
});

View File

@ -0,0 +1,4 @@
export const TEST_NAME_PREFIX = 'test_record_';
export const generateRecordName = (uuid: string) =>
`${TEST_NAME_PREFIX}-${uuid}`;