[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  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:
committed by
GitHub
parent
f08b8fda16
commit
58fd34071c
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
213
packages/twenty-server/test/integration/graphql/codegen/index.ts
Normal file
213
packages/twenty-server/test/integration/graphql/codegen/index.ts
Normal file
@ -0,0 +1,213 @@
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as process from 'process';
|
||||
|
||||
import { INTROSPECTION_QUERY } from './introspection-query';
|
||||
import {
|
||||
Field,
|
||||
InputValue,
|
||||
IntrospectionResponse,
|
||||
TypeRef,
|
||||
} from './introspection.interface';
|
||||
|
||||
const GRAPHQL_URL = 'http://localhost:3000/graphql';
|
||||
const BEARER_TOKEN =
|
||||
'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyMDIwMjAyMC05ZTNiLTQ2ZDQtYTU1Ni04OGI5ZGRjMmIwMzQiLCJ3b3Jrc3BhY2VJZCI6IjIwMjAyMDIwLTFjMjUtNGQwMi1iZjI1LTZhZWNjZjdlYTQxOSIsIndvcmtzcGFjZU1lbWJlcklkIjoiMjAyMDIwMjAtMDY4Ny00YzQxLWI3MDctZWQxYmZjYTk3MmE3IiwiaWF0IjoxNzI2NDkyNTAyLCJleHAiOjEzMjQ1MDE2NTAyfQ.zM6TbfeOqYVH5Sgryc2zf02hd9uqUOSL1-iJlMgwzsI';
|
||||
const TEST_OUTPUT_DIR = './test/integration/graphql/suites/object-generated';
|
||||
|
||||
const fetchGraphQLSchema = async (): Promise<IntrospectionResponse> => {
|
||||
const headers = {
|
||||
Authorization: BEARER_TOKEN,
|
||||
'Content-Type': 'application/json',
|
||||
};
|
||||
const response = await fetch(GRAPHQL_URL, {
|
||||
method: 'POST',
|
||||
headers,
|
||||
body: JSON.stringify({ query: INTROSPECTION_QUERY }),
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(`Failed to fetch schema: ${response.statusText}`);
|
||||
}
|
||||
|
||||
return response.json();
|
||||
};
|
||||
|
||||
const toKebabCase = (name: string): string => {
|
||||
return name.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
||||
};
|
||||
|
||||
const unwrapType = (typeInfo: TypeRef): any => {
|
||||
while (typeInfo.ofType) {
|
||||
typeInfo = typeInfo.ofType;
|
||||
}
|
||||
|
||||
return typeInfo;
|
||||
};
|
||||
|
||||
const hasRequiredArgs = (args: InputValue[]): boolean => {
|
||||
return args.some((arg) => unwrapType(arg.type).kind === 'NON_NULL');
|
||||
};
|
||||
|
||||
const generateTestContent = (
|
||||
queryName: string,
|
||||
fields: Field[],
|
||||
): string | null => {
|
||||
const fieldNames = fields
|
||||
.filter((f) => ['SCALAR', 'ENUM'].includes(unwrapType(f.type).kind))
|
||||
.map((f) => f.name);
|
||||
|
||||
if (fieldNames.length === 0) {
|
||||
console.log(`Skipping ${queryName}: No usable fields found.`);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
const fieldSelection = fieldNames.join('\n ');
|
||||
const expectSelection = fieldNames
|
||||
.map((f) => `expect(${queryName}).toHaveProperty('${f}');`)
|
||||
.join('\n ');
|
||||
|
||||
return `import request from 'supertest';
|
||||
|
||||
const client = request(\`http://localhost:\${APP_PORT}\`);
|
||||
|
||||
describe('${queryName}Resolver (e2e)', () => {
|
||||
it('should find many ${queryName}', () => {
|
||||
const queryData = {
|
||||
query: \`
|
||||
query ${queryName} {
|
||||
${queryName} {
|
||||
edges {
|
||||
node {
|
||||
${fieldSelection}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
\`,
|
||||
};
|
||||
|
||||
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.${queryName};
|
||||
|
||||
expect(data).toBeDefined();
|
||||
expect(Array.isArray(data.edges)).toBe(true);
|
||||
|
||||
const edges = data.edges;
|
||||
|
||||
if (edges.length > 0) {
|
||||
const ${queryName} = edges[0].node;
|
||||
|
||||
${expectSelection}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
`;
|
||||
};
|
||||
|
||||
const writeTestFile = (
|
||||
queryName: string,
|
||||
content: string | null,
|
||||
force = false,
|
||||
): string => {
|
||||
if (!content) return 'skipped';
|
||||
|
||||
const fileName = `${toKebabCase(queryName)}.integration-spec.ts`;
|
||||
const filePath = path.join(TEST_OUTPUT_DIR, fileName);
|
||||
|
||||
if (fs.existsSync(filePath) && !force) {
|
||||
return 'skipped';
|
||||
}
|
||||
|
||||
fs.writeFileSync(filePath, content);
|
||||
|
||||
return force ? 'updated' : 'created';
|
||||
};
|
||||
|
||||
const generateTests = async (force = false) => {
|
||||
fs.mkdirSync(TEST_OUTPUT_DIR, { recursive: true });
|
||||
const schemaData = await fetchGraphQLSchema();
|
||||
const types = schemaData.data.__schema.types;
|
||||
|
||||
const queryTypeName = schemaData.data.__schema.queryType.name;
|
||||
const queryType = types.find((t: any) => t.name === queryTypeName);
|
||||
|
||||
let createdCount = 0;
|
||||
let updatedCount = 0;
|
||||
let totalCount = 0;
|
||||
|
||||
if (!queryType?.fields) {
|
||||
console.log('No query fields found.');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
for (const query of queryType.fields) {
|
||||
const queryName = query.name;
|
||||
|
||||
if (hasRequiredArgs(query.args)) continue;
|
||||
if (queryName.includes('Duplicates')) continue;
|
||||
|
||||
const queryReturnType = unwrapType(query.type);
|
||||
|
||||
if (
|
||||
queryReturnType.kind === 'OBJECT' &&
|
||||
queryReturnType.name.includes('Connection')
|
||||
) {
|
||||
totalCount++;
|
||||
const connectionTypeInfo = types.find(
|
||||
(f: any) => f.name === queryReturnType.name,
|
||||
);
|
||||
const edgeTypeInfo = connectionTypeInfo?.fields?.find(
|
||||
(f: any) => f.name === 'edges',
|
||||
);
|
||||
|
||||
if (edgeTypeInfo) {
|
||||
const returnType = unwrapType(edgeTypeInfo.type);
|
||||
const returnTypeInfo = types.find(
|
||||
(t: any) => t.name === returnType.name,
|
||||
);
|
||||
const returnNodeTypeInfo = returnTypeInfo?.fields?.find(
|
||||
(f: any) => f.name === 'node',
|
||||
);
|
||||
|
||||
if (returnNodeTypeInfo) {
|
||||
const nodeType = unwrapType(returnNodeTypeInfo.type);
|
||||
const nodeTypeInfo = types.find((t: any) => t.name === nodeType.name);
|
||||
|
||||
if (!nodeTypeInfo?.fields) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const content = generateTestContent(queryName, nodeTypeInfo?.fields);
|
||||
const result = writeTestFile(queryName, content, force);
|
||||
|
||||
if (result === 'created') createdCount++;
|
||||
if (result === 'updated') updatedCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`Number of tests created: ${createdCount}/${totalCount}`);
|
||||
if (force) {
|
||||
console.log(`Number of tests updated: ${updatedCount}/${totalCount}`);
|
||||
}
|
||||
};
|
||||
|
||||
// Basic command-line argument parsing
|
||||
const forceArg = process.argv.includes('--force');
|
||||
|
||||
// Call the function with the parsed argument
|
||||
generateTests(forceArg);
|
||||
@ -0,0 +1,89 @@
|
||||
export const INTROSPECTION_QUERY = `
|
||||
query IntrospectionQuery {
|
||||
__schema {
|
||||
queryType { name }
|
||||
mutationType { name }
|
||||
subscriptionType { name }
|
||||
types {
|
||||
...FullType
|
||||
}
|
||||
directives {
|
||||
name
|
||||
description
|
||||
locations
|
||||
args {
|
||||
...InputValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fragment FullType on __Type {
|
||||
kind
|
||||
name
|
||||
description
|
||||
fields(includeDeprecated: true) {
|
||||
name
|
||||
description
|
||||
args {
|
||||
...InputValue
|
||||
}
|
||||
type {
|
||||
...TypeRef
|
||||
}
|
||||
isDeprecated
|
||||
deprecationReason
|
||||
}
|
||||
inputFields {
|
||||
...InputValue
|
||||
}
|
||||
interfaces {
|
||||
...TypeRef
|
||||
}
|
||||
enumValues(includeDeprecated: true) {
|
||||
name
|
||||
description
|
||||
isDeprecated
|
||||
deprecationReason
|
||||
}
|
||||
possibleTypes {
|
||||
...TypeRef
|
||||
}
|
||||
}
|
||||
|
||||
fragment InputValue on __InputValue {
|
||||
name
|
||||
description
|
||||
type { ...TypeRef }
|
||||
defaultValue
|
||||
}
|
||||
|
||||
fragment TypeRef on __Type {
|
||||
kind
|
||||
name
|
||||
ofType {
|
||||
kind
|
||||
name
|
||||
ofType {
|
||||
kind
|
||||
name
|
||||
ofType {
|
||||
kind
|
||||
name
|
||||
ofType {
|
||||
kind
|
||||
name
|
||||
ofType {
|
||||
kind
|
||||
name
|
||||
ofType {
|
||||
kind
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -0,0 +1,60 @@
|
||||
export interface IntrospectionResponse {
|
||||
data: {
|
||||
__schema: Schema;
|
||||
};
|
||||
}
|
||||
|
||||
export interface Schema {
|
||||
queryType: { name: string };
|
||||
mutationType: { name: string | null };
|
||||
subscriptionType: { name: string | null };
|
||||
types: GraphQLType[];
|
||||
directives: Directive[];
|
||||
}
|
||||
|
||||
export interface Directive {
|
||||
name: string;
|
||||
description: string | null;
|
||||
locations: string[];
|
||||
args: InputValue[];
|
||||
}
|
||||
|
||||
export interface GraphQLType {
|
||||
kind: string;
|
||||
name: string;
|
||||
description: string | null;
|
||||
fields?: Field[];
|
||||
inputFields?: InputValue[];
|
||||
interfaces?: TypeRef[];
|
||||
enumValues?: EnumValue[];
|
||||
possibleTypes?: TypeRef[];
|
||||
}
|
||||
|
||||
export interface Field {
|
||||
name: string;
|
||||
description: string | null;
|
||||
args: InputValue[];
|
||||
type: TypeRef;
|
||||
isDeprecated: boolean;
|
||||
deprecationReason: string | null;
|
||||
}
|
||||
|
||||
export interface InputValue {
|
||||
name: string;
|
||||
description: string | null;
|
||||
type: TypeRef;
|
||||
defaultValue: string | null;
|
||||
}
|
||||
|
||||
export interface TypeRef {
|
||||
kind: string;
|
||||
name: string | null;
|
||||
ofType: TypeRef | null;
|
||||
}
|
||||
|
||||
export interface EnumValue {
|
||||
name: string;
|
||||
description: string | null;
|
||||
isDeprecated: boolean;
|
||||
deprecationReason: string | null;
|
||||
}
|
||||
@ -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();
|
||||
});
|
||||
});
|
||||
@ -2,7 +2,7 @@ import request from 'supertest';
|
||||
|
||||
const client = request(`http://localhost:${APP_PORT}`);
|
||||
|
||||
describe('activitiesResolver (integration)', () => {
|
||||
describe('activitiesResolver (e2e)', () => {
|
||||
it('should find many activities', () => {
|
||||
const queryData = {
|
||||
query: `
|
||||
@ -2,7 +2,7 @@ import request from 'supertest';
|
||||
|
||||
const client = request(`http://localhost:${APP_PORT}`);
|
||||
|
||||
describe('activityTargetsResolver (integration)', () => {
|
||||
describe('activityTargetsResolver (e2e)', () => {
|
||||
it('should find many activityTargets', () => {
|
||||
const queryData = {
|
||||
query: `
|
||||
@ -18,6 +18,7 @@ describe('activityTargetsResolver (integration)', () => {
|
||||
personId
|
||||
companyId
|
||||
opportunityId
|
||||
rocketId
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -53,6 +54,7 @@ describe('activityTargetsResolver (integration)', () => {
|
||||
expect(activityTargets).toHaveProperty('personId');
|
||||
expect(activityTargets).toHaveProperty('companyId');
|
||||
expect(activityTargets).toHaveProperty('opportunityId');
|
||||
expect(activityTargets).toHaveProperty('rocketId');
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -2,7 +2,7 @@ import request from 'supertest';
|
||||
|
||||
const client = request(`http://localhost:${APP_PORT}`);
|
||||
|
||||
describe('apiKeysResolver (integration)', () => {
|
||||
describe('apiKeysResolver (e2e)', () => {
|
||||
it('should find many apiKeys', () => {
|
||||
const queryData = {
|
||||
query: `
|
||||
@ -2,7 +2,7 @@ import request from 'supertest';
|
||||
|
||||
const client = request(`http://localhost:${APP_PORT}`);
|
||||
|
||||
describe('attachmentsResolver (integration)', () => {
|
||||
describe('attachmentsResolver (e2e)', () => {
|
||||
it('should find many attachments', () => {
|
||||
const queryData = {
|
||||
query: `
|
||||
@ -24,6 +24,7 @@ describe('attachmentsResolver (integration)', () => {
|
||||
personId
|
||||
companyId
|
||||
opportunityId
|
||||
rocketId
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -65,6 +66,7 @@ describe('attachmentsResolver (integration)', () => {
|
||||
expect(attachments).toHaveProperty('personId');
|
||||
expect(attachments).toHaveProperty('companyId');
|
||||
expect(attachments).toHaveProperty('opportunityId');
|
||||
expect(attachments).toHaveProperty('rocketId');
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -2,7 +2,7 @@ import request from 'supertest';
|
||||
|
||||
const client = request(`http://localhost:${APP_PORT}`);
|
||||
|
||||
describe('auditLogsResolver (integration)', () => {
|
||||
describe('auditLogsResolver (e2e)', () => {
|
||||
it('should find many auditLogs', () => {
|
||||
const queryData = {
|
||||
query: `
|
||||
@ -2,7 +2,7 @@ import request from 'supertest';
|
||||
|
||||
const client = request(`http://localhost:${APP_PORT}`);
|
||||
|
||||
describe('blocklistsResolver (integration)', () => {
|
||||
describe('blocklistsResolver (e2e)', () => {
|
||||
it('should find many blocklists', () => {
|
||||
const queryData = {
|
||||
query: `
|
||||
@ -2,7 +2,7 @@ import request from 'supertest';
|
||||
|
||||
const client = request(`http://localhost:${APP_PORT}`);
|
||||
|
||||
describe('calendarChannelEventAssociationsResolver (integration)', () => {
|
||||
describe('calendarChannelEventAssociationsResolver (e2e)', () => {
|
||||
it('should find many calendarChannelEventAssociations', () => {
|
||||
const queryData = {
|
||||
query: `
|
||||
@ -11,6 +11,7 @@ describe('calendarChannelEventAssociationsResolver (integration)', () => {
|
||||
edges {
|
||||
node {
|
||||
eventExternalId
|
||||
recurringEventExternalId
|
||||
id
|
||||
createdAt
|
||||
updatedAt
|
||||
@ -47,6 +48,9 @@ describe('calendarChannelEventAssociationsResolver (integration)', () => {
|
||||
expect(calendarChannelEventAssociations).toHaveProperty(
|
||||
'eventExternalId',
|
||||
);
|
||||
expect(calendarChannelEventAssociations).toHaveProperty(
|
||||
'recurringEventExternalId',
|
||||
);
|
||||
expect(calendarChannelEventAssociations).toHaveProperty('id');
|
||||
expect(calendarChannelEventAssociations).toHaveProperty('createdAt');
|
||||
expect(calendarChannelEventAssociations).toHaveProperty('updatedAt');
|
||||
@ -2,7 +2,7 @@ import request from 'supertest';
|
||||
|
||||
const client = request(`http://localhost:${APP_PORT}`);
|
||||
|
||||
describe('calendarChannelsResolver (integration)', () => {
|
||||
describe('calendarChannelsResolver (e2e)', () => {
|
||||
it('should find many calendarChannels', () => {
|
||||
const queryData = {
|
||||
query: `
|
||||
@ -18,6 +18,7 @@ describe('calendarChannelsResolver (integration)', () => {
|
||||
contactAutoCreationPolicy
|
||||
isSyncEnabled
|
||||
syncCursor
|
||||
syncedAt
|
||||
syncStageStartedAt
|
||||
throttleFailureCount
|
||||
id
|
||||
@ -62,6 +63,7 @@ describe('calendarChannelsResolver (integration)', () => {
|
||||
expect(calendarChannels).toHaveProperty('contactAutoCreationPolicy');
|
||||
expect(calendarChannels).toHaveProperty('isSyncEnabled');
|
||||
expect(calendarChannels).toHaveProperty('syncCursor');
|
||||
expect(calendarChannels).toHaveProperty('syncedAt');
|
||||
expect(calendarChannels).toHaveProperty('syncStageStartedAt');
|
||||
expect(calendarChannels).toHaveProperty('throttleFailureCount');
|
||||
expect(calendarChannels).toHaveProperty('id');
|
||||
@ -2,7 +2,7 @@ import request from 'supertest';
|
||||
|
||||
const client = request(`http://localhost:${APP_PORT}`);
|
||||
|
||||
describe('calendarEventParticipantsResolver (integration)', () => {
|
||||
describe('calendarEventParticipantsResolver (e2e)', () => {
|
||||
it('should find many calendarEventParticipants', () => {
|
||||
const queryData = {
|
||||
query: `
|
||||
@ -2,7 +2,7 @@ import request from 'supertest';
|
||||
|
||||
const client = request(`http://localhost:${APP_PORT}`);
|
||||
|
||||
describe('commentsResolver (integration)', () => {
|
||||
describe('commentsResolver (e2e)', () => {
|
||||
it('should find many comments', () => {
|
||||
const queryData = {
|
||||
query: `
|
||||
@ -2,7 +2,7 @@ import request from 'supertest';
|
||||
|
||||
const client = request(`http://localhost:${APP_PORT}`);
|
||||
|
||||
describe('companiesResolver (integration)', () => {
|
||||
describe('companiesResolver (e2e)', () => {
|
||||
it('should find many companies', () => {
|
||||
const queryData = {
|
||||
query: `
|
||||
@ -14,6 +14,7 @@ describe('companiesResolver (integration)', () => {
|
||||
employees
|
||||
idealCustomerProfile
|
||||
position
|
||||
searchVector
|
||||
id
|
||||
createdAt
|
||||
updatedAt
|
||||
@ -53,6 +54,7 @@ describe('companiesResolver (integration)', () => {
|
||||
expect(companies).toHaveProperty('employees');
|
||||
expect(companies).toHaveProperty('idealCustomerProfile');
|
||||
expect(companies).toHaveProperty('position');
|
||||
expect(companies).toHaveProperty('searchVector');
|
||||
expect(companies).toHaveProperty('id');
|
||||
expect(companies).toHaveProperty('createdAt');
|
||||
expect(companies).toHaveProperty('updatedAt');
|
||||
@ -2,7 +2,7 @@ import request from 'supertest';
|
||||
|
||||
const client = request(`http://localhost:${APP_PORT}`);
|
||||
|
||||
describe('connectedAccountsResolver (integration)', () => {
|
||||
describe('connectedAccountsResolver (e2e)', () => {
|
||||
it('should find many connectedAccounts', () => {
|
||||
const queryData = {
|
||||
query: `
|
||||
@ -17,6 +17,7 @@ describe('connectedAccountsResolver (integration)', () => {
|
||||
lastSyncHistoryId
|
||||
authFailedAt
|
||||
handleAliases
|
||||
scopes
|
||||
id
|
||||
createdAt
|
||||
updatedAt
|
||||
@ -56,6 +57,7 @@ describe('connectedAccountsResolver (integration)', () => {
|
||||
expect(connectedAccounts).toHaveProperty('lastSyncHistoryId');
|
||||
expect(connectedAccounts).toHaveProperty('authFailedAt');
|
||||
expect(connectedAccounts).toHaveProperty('handleAliases');
|
||||
expect(connectedAccounts).toHaveProperty('scopes');
|
||||
expect(connectedAccounts).toHaveProperty('id');
|
||||
expect(connectedAccounts).toHaveProperty('createdAt');
|
||||
expect(connectedAccounts).toHaveProperty('updatedAt');
|
||||
@ -2,7 +2,7 @@ import request from 'supertest';
|
||||
|
||||
const client = request(`http://localhost:${APP_PORT}`);
|
||||
|
||||
describe('favoritesResolver (integration)', () => {
|
||||
describe('favoritesResolver (e2e)', () => {
|
||||
it('should find many favorites', () => {
|
||||
const queryData = {
|
||||
query: `
|
||||
@ -19,9 +19,13 @@ describe('favoritesResolver (integration)', () => {
|
||||
personId
|
||||
companyId
|
||||
opportunityId
|
||||
workflowId
|
||||
workflowVersionId
|
||||
workflowRunId
|
||||
taskId
|
||||
noteId
|
||||
viewId
|
||||
rocketId
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -58,9 +62,13 @@ describe('favoritesResolver (integration)', () => {
|
||||
expect(favorites).toHaveProperty('personId');
|
||||
expect(favorites).toHaveProperty('companyId');
|
||||
expect(favorites).toHaveProperty('opportunityId');
|
||||
expect(favorites).toHaveProperty('workflowId');
|
||||
expect(favorites).toHaveProperty('workflowVersionId');
|
||||
expect(favorites).toHaveProperty('workflowRunId');
|
||||
expect(favorites).toHaveProperty('taskId');
|
||||
expect(favorites).toHaveProperty('noteId');
|
||||
expect(favorites).toHaveProperty('viewId');
|
||||
expect(favorites).toHaveProperty('rocketId');
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -2,7 +2,7 @@ import request from 'supertest';
|
||||
|
||||
const client = request(`http://localhost:${APP_PORT}`);
|
||||
|
||||
describe('messageChannelMessageAssociationsResolver (integration)', () => {
|
||||
describe('messageChannelMessageAssociationsResolver (e2e)', () => {
|
||||
it('should find many messageChannelMessageAssociations', () => {
|
||||
const queryData = {
|
||||
query: `
|
||||
@ -10,11 +10,11 @@ describe('messageChannelMessageAssociationsResolver (integration)', () => {
|
||||
messageChannelMessageAssociations {
|
||||
edges {
|
||||
node {
|
||||
createdAt
|
||||
messageExternalId
|
||||
messageThreadExternalId
|
||||
direction
|
||||
id
|
||||
createdAt
|
||||
updatedAt
|
||||
deletedAt
|
||||
messageChannelId
|
||||
@ -46,7 +46,6 @@ describe('messageChannelMessageAssociationsResolver (integration)', () => {
|
||||
if (edges.length > 0) {
|
||||
const messageChannelMessageAssociations = edges[0].node;
|
||||
|
||||
expect(messageChannelMessageAssociations).toHaveProperty('createdAt');
|
||||
expect(messageChannelMessageAssociations).toHaveProperty(
|
||||
'messageExternalId',
|
||||
);
|
||||
@ -55,6 +54,7 @@ describe('messageChannelMessageAssociationsResolver (integration)', () => {
|
||||
);
|
||||
expect(messageChannelMessageAssociations).toHaveProperty('direction');
|
||||
expect(messageChannelMessageAssociations).toHaveProperty('id');
|
||||
expect(messageChannelMessageAssociations).toHaveProperty('createdAt');
|
||||
expect(messageChannelMessageAssociations).toHaveProperty('updatedAt');
|
||||
expect(messageChannelMessageAssociations).toHaveProperty('deletedAt');
|
||||
expect(messageChannelMessageAssociations).toHaveProperty(
|
||||
@ -2,7 +2,7 @@ import request from 'supertest';
|
||||
|
||||
const client = request(`http://localhost:${APP_PORT}`);
|
||||
|
||||
describe('messageChannelsResolver (integration)', () => {
|
||||
describe('messageChannelsResolver (e2e)', () => {
|
||||
it('should find many messageChannels', () => {
|
||||
const queryData = {
|
||||
query: `
|
||||
@ -2,7 +2,7 @@ import request from 'supertest';
|
||||
|
||||
const client = request(`http://localhost:${APP_PORT}`);
|
||||
|
||||
describe('messageParticipantsResolver (integration)', () => {
|
||||
describe('messageParticipantsResolver (e2e)', () => {
|
||||
it('should find many messageParticipants', () => {
|
||||
const queryData = {
|
||||
query: `
|
||||
@ -2,7 +2,7 @@ import request from 'supertest';
|
||||
|
||||
const client = request(`http://localhost:${APP_PORT}`);
|
||||
|
||||
describe('messageThreadsResolver (integration)', () => {
|
||||
describe('messageThreadsResolver (e2e)', () => {
|
||||
it('should find many messageThreads', () => {
|
||||
const queryData = {
|
||||
query: `
|
||||
@ -2,7 +2,7 @@ import request from 'supertest';
|
||||
|
||||
const client = request(`http://localhost:${APP_PORT}`);
|
||||
|
||||
describe('noteTargetsResolver (integration)', () => {
|
||||
describe('noteTargetsResolver (e2e)', () => {
|
||||
it('should find many noteTargets', () => {
|
||||
const queryData = {
|
||||
query: `
|
||||
@ -18,6 +18,7 @@ describe('noteTargetsResolver (integration)', () => {
|
||||
personId
|
||||
companyId
|
||||
opportunityId
|
||||
rocketId
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -53,6 +54,7 @@ describe('noteTargetsResolver (integration)', () => {
|
||||
expect(noteTargets).toHaveProperty('personId');
|
||||
expect(noteTargets).toHaveProperty('companyId');
|
||||
expect(noteTargets).toHaveProperty('opportunityId');
|
||||
expect(noteTargets).toHaveProperty('rocketId');
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -2,7 +2,7 @@ import request from 'supertest';
|
||||
|
||||
const client = request(`http://localhost:${APP_PORT}`);
|
||||
|
||||
describe('notesResolver (integration)', () => {
|
||||
describe('notesResolver (e2e)', () => {
|
||||
it('should find many notes', () => {
|
||||
const queryData = {
|
||||
query: `
|
||||
@ -2,7 +2,7 @@ import request from 'supertest';
|
||||
|
||||
const client = request(`http://localhost:${APP_PORT}`);
|
||||
|
||||
describe('objectsResolver (integration)', () => {
|
||||
describe('objectsResolver (e2e)', () => {
|
||||
it('should find many objects', () => {
|
||||
const queryData = {
|
||||
query: `
|
||||
@ -2,7 +2,7 @@ import request from 'supertest';
|
||||
|
||||
const client = request(`http://localhost:${APP_PORT}`);
|
||||
|
||||
describe('opportunitiesResolver (integration)', () => {
|
||||
describe('opportunitiesResolver (e2e)', () => {
|
||||
it('should find many opportunities', () => {
|
||||
const queryData = {
|
||||
query: `
|
||||
@ -14,6 +14,7 @@ describe('opportunitiesResolver (integration)', () => {
|
||||
closeDate
|
||||
stage
|
||||
position
|
||||
searchVector
|
||||
id
|
||||
createdAt
|
||||
updatedAt
|
||||
@ -51,6 +52,7 @@ describe('opportunitiesResolver (integration)', () => {
|
||||
expect(opportunities).toHaveProperty('closeDate');
|
||||
expect(opportunities).toHaveProperty('stage');
|
||||
expect(opportunities).toHaveProperty('position');
|
||||
expect(opportunities).toHaveProperty('searchVector');
|
||||
expect(opportunities).toHaveProperty('id');
|
||||
expect(opportunities).toHaveProperty('createdAt');
|
||||
expect(opportunities).toHaveProperty('updatedAt');
|
||||
@ -2,7 +2,7 @@ import request from 'supertest';
|
||||
|
||||
const client = request(`http://localhost:${APP_PORT}`);
|
||||
|
||||
describe('peopleResolver (integration)', () => {
|
||||
describe('peopleResolver (e2e)', () => {
|
||||
it('should find many people', () => {
|
||||
const queryData = {
|
||||
query: `
|
||||
@ -11,22 +11,16 @@ describe('peopleResolver (integration)', () => {
|
||||
edges {
|
||||
node {
|
||||
jobTitle
|
||||
phones {
|
||||
primaryPhoneNumber
|
||||
primaryPhoneCountryCode
|
||||
}
|
||||
city
|
||||
avatarUrl
|
||||
position
|
||||
searchVector
|
||||
id
|
||||
createdAt
|
||||
updatedAt
|
||||
deletedAt
|
||||
companyId
|
||||
intro
|
||||
whatsapp {
|
||||
primaryPhoneNumber
|
||||
}
|
||||
workPreference
|
||||
performanceRating
|
||||
}
|
||||
@ -42,7 +36,6 @@ describe('peopleResolver (integration)', () => {
|
||||
.send(queryData)
|
||||
.expect(200)
|
||||
.expect((res) => {
|
||||
console.log(res.body);
|
||||
expect(res.body.data).toBeDefined();
|
||||
expect(res.body.errors).toBeUndefined();
|
||||
})
|
||||
@ -58,17 +51,16 @@ describe('peopleResolver (integration)', () => {
|
||||
const people = edges[0].node;
|
||||
|
||||
expect(people).toHaveProperty('jobTitle');
|
||||
expect(people).toHaveProperty('phones');
|
||||
expect(people).toHaveProperty('city');
|
||||
expect(people).toHaveProperty('avatarUrl');
|
||||
expect(people).toHaveProperty('position');
|
||||
expect(people).toHaveProperty('searchVector');
|
||||
expect(people).toHaveProperty('id');
|
||||
expect(people).toHaveProperty('createdAt');
|
||||
expect(people).toHaveProperty('updatedAt');
|
||||
expect(people).toHaveProperty('deletedAt');
|
||||
expect(people).toHaveProperty('companyId');
|
||||
expect(people).toHaveProperty('intro');
|
||||
expect(people).toHaveProperty('whatsapp');
|
||||
expect(people).toHaveProperty('workPreference');
|
||||
expect(people).toHaveProperty('performanceRating');
|
||||
}
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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',
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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',
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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',
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -2,7 +2,7 @@ import request from 'supertest';
|
||||
|
||||
const client = request(`http://localhost:${APP_PORT}`);
|
||||
|
||||
describe('taskTargetsResolver (integration)', () => {
|
||||
describe('taskTargetsResolver (e2e)', () => {
|
||||
it('should find many taskTargets', () => {
|
||||
const queryData = {
|
||||
query: `
|
||||
@ -18,6 +18,7 @@ describe('taskTargetsResolver (integration)', () => {
|
||||
personId
|
||||
companyId
|
||||
opportunityId
|
||||
rocketId
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -53,6 +54,7 @@ describe('taskTargetsResolver (integration)', () => {
|
||||
expect(taskTargets).toHaveProperty('personId');
|
||||
expect(taskTargets).toHaveProperty('companyId');
|
||||
expect(taskTargets).toHaveProperty('opportunityId');
|
||||
expect(taskTargets).toHaveProperty('rocketId');
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -2,7 +2,7 @@ import request from 'supertest';
|
||||
|
||||
const client = request(`http://localhost:${APP_PORT}`);
|
||||
|
||||
describe('tasksResolver (integration)', () => {
|
||||
describe('tasksResolver (e2e)', () => {
|
||||
it('should find many tasks', () => {
|
||||
const queryData = {
|
||||
query: `
|
||||
@ -2,7 +2,7 @@ import request from 'supertest';
|
||||
|
||||
const client = request(`http://localhost:${APP_PORT}`);
|
||||
|
||||
describe('timelineActivitiesResolver (integration)', () => {
|
||||
describe('timelineActivitiesResolver (e2e)', () => {
|
||||
it('should find many timelineActivities', () => {
|
||||
const queryData = {
|
||||
query: `
|
||||
@ -26,6 +26,10 @@ describe('timelineActivitiesResolver (integration)', () => {
|
||||
opportunityId
|
||||
noteId
|
||||
taskId
|
||||
workflowId
|
||||
workflowVersionId
|
||||
workflowRunId
|
||||
rocketId
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -69,6 +73,10 @@ describe('timelineActivitiesResolver (integration)', () => {
|
||||
expect(timelineActivities).toHaveProperty('opportunityId');
|
||||
expect(timelineActivities).toHaveProperty('noteId');
|
||||
expect(timelineActivities).toHaveProperty('taskId');
|
||||
expect(timelineActivities).toHaveProperty('workflowId');
|
||||
expect(timelineActivities).toHaveProperty('workflowVersionId');
|
||||
expect(timelineActivities).toHaveProperty('workflowRunId');
|
||||
expect(timelineActivities).toHaveProperty('rocketId');
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -2,7 +2,7 @@ import request from 'supertest';
|
||||
|
||||
const client = request(`http://localhost:${APP_PORT}`);
|
||||
|
||||
describe('viewFieldsResolver (integration)', () => {
|
||||
describe('viewFieldsResolver (e2e)', () => {
|
||||
it('should find many viewFields', () => {
|
||||
const queryData = {
|
||||
query: `
|
||||
@ -2,7 +2,7 @@ import request from 'supertest';
|
||||
|
||||
const client = request(`http://localhost:${APP_PORT}`);
|
||||
|
||||
describe('viewFiltersResolver (integration)', () => {
|
||||
describe('viewFiltersResolver (e2e)', () => {
|
||||
it('should find many viewFilters', () => {
|
||||
const queryData = {
|
||||
query: `
|
||||
@ -2,7 +2,7 @@ import request from 'supertest';
|
||||
|
||||
const client = request(`http://localhost:${APP_PORT}`);
|
||||
|
||||
describe('viewSortsResolver (integration)', () => {
|
||||
describe('viewSortsResolver (e2e)', () => {
|
||||
it('should find many viewSorts', () => {
|
||||
const queryData = {
|
||||
query: `
|
||||
@ -2,7 +2,7 @@ import request from 'supertest';
|
||||
|
||||
const client = request(`http://localhost:${APP_PORT}`);
|
||||
|
||||
describe('viewsResolver (integration)', () => {
|
||||
describe('viewsResolver (e2e)', () => {
|
||||
it('should find many views', () => {
|
||||
const queryData = {
|
||||
query: `
|
||||
@ -10,13 +10,13 @@ describe('viewsResolver (integration)', () => {
|
||||
views {
|
||||
edges {
|
||||
node {
|
||||
position
|
||||
name
|
||||
objectMetadataId
|
||||
type
|
||||
key
|
||||
icon
|
||||
kanbanFieldMetadataId
|
||||
position
|
||||
isCompact
|
||||
id
|
||||
createdAt
|
||||
@ -49,13 +49,13 @@ describe('viewsResolver (integration)', () => {
|
||||
if (edges.length > 0) {
|
||||
const views = edges[0].node;
|
||||
|
||||
expect(views).toHaveProperty('position');
|
||||
expect(views).toHaveProperty('name');
|
||||
expect(views).toHaveProperty('objectMetadataId');
|
||||
expect(views).toHaveProperty('type');
|
||||
expect(views).toHaveProperty('key');
|
||||
expect(views).toHaveProperty('icon');
|
||||
expect(views).toHaveProperty('kanbanFieldMetadataId');
|
||||
expect(views).toHaveProperty('position');
|
||||
expect(views).toHaveProperty('isCompact');
|
||||
expect(views).toHaveProperty('id');
|
||||
expect(views).toHaveProperty('createdAt');
|
||||
@ -2,7 +2,7 @@ import request from 'supertest';
|
||||
|
||||
const client = request(`http://localhost:${APP_PORT}`);
|
||||
|
||||
describe('webhooksResolver (integration)', () => {
|
||||
describe('webhooksResolver (e2e)', () => {
|
||||
it('should find many webhooks', () => {
|
||||
const queryData = {
|
||||
query: `
|
||||
@ -10,10 +10,10 @@ describe('webhooksResolver (integration)', () => {
|
||||
webhooks {
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
targetUrl
|
||||
operation
|
||||
description
|
||||
id
|
||||
createdAt
|
||||
updatedAt
|
||||
deletedAt
|
||||
@ -44,10 +44,10 @@ describe('webhooksResolver (integration)', () => {
|
||||
if (edges.length > 0) {
|
||||
const webhooks = edges[0].node;
|
||||
|
||||
expect(webhooks).toHaveProperty('id');
|
||||
expect(webhooks).toHaveProperty('targetUrl');
|
||||
expect(webhooks).toHaveProperty('operation');
|
||||
expect(webhooks).toHaveProperty('description');
|
||||
expect(webhooks).toHaveProperty('id');
|
||||
expect(webhooks).toHaveProperty('createdAt');
|
||||
expect(webhooks).toHaveProperty('updatedAt');
|
||||
expect(webhooks).toHaveProperty('deletedAt');
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -2,7 +2,7 @@ import request from 'supertest';
|
||||
|
||||
const client = request(`http://localhost:${APP_PORT}`);
|
||||
|
||||
describe('workspaceMembersResolver (integration)', () => {
|
||||
describe('workspaceMembersResolver (e2e)', () => {
|
||||
it('should find many workspaceMembers', () => {
|
||||
const queryData = {
|
||||
query: `
|
||||
@ -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,
|
||||
},
|
||||
});
|
||||
@ -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,
|
||||
},
|
||||
});
|
||||
@ -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,
|
||||
},
|
||||
});
|
||||
@ -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,
|
||||
},
|
||||
});
|
||||
@ -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,
|
||||
},
|
||||
});
|
||||
@ -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,
|
||||
},
|
||||
});
|
||||
@ -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,
|
||||
},
|
||||
});
|
||||
@ -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,
|
||||
},
|
||||
});
|
||||
@ -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 || {},
|
||||
});
|
||||
};
|
||||
@ -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,
|
||||
},
|
||||
});
|
||||
@ -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,
|
||||
},
|
||||
});
|
||||
@ -0,0 +1,4 @@
|
||||
export const TEST_NAME_PREFIX = 'test_record_';
|
||||
|
||||
export const generateRecordName = (uuid: string) =>
|
||||
`${TEST_NAME_PREFIX}-${uuid}`;
|
||||
Reference in New Issue
Block a user