Files
twenty/packages/twenty-server/test/integration/graphql/suites/object-generated/logic-functions.integration-spec.ts
T
Charles Bochet da6f1bbef3 Rename serverlessFunction to logicFunction (#17494)
## Summary

Rename "Serverless Function" to "Logic Function" across the codebase for
clearer naming.

### Environment Variable Changes

| Old | New |
|-----|-----|
| `SERVERLESS_TYPE` | `LOGIC_FUNCTION_TYPE` |
| `SERVERLESS_LAMBDA_REGION` | `LOGIC_FUNCTION_LAMBDA_REGION` |
| `SERVERLESS_LAMBDA_ROLE` | `LOGIC_FUNCTION_LAMBDA_ROLE` |
| `SERVERLESS_LAMBDA_SUBHOSTING_URL` |
`LOGIC_FUNCTION_LAMBDA_SUBHOSTING_URL` |
| `SERVERLESS_LAMBDA_ACCESS_KEY_ID` |
`LOGIC_FUNCTION_LAMBDA_ACCESS_KEY_ID` |
| `SERVERLESS_LAMBDA_SECRET_ACCESS_KEY` |
`LOGIC_FUNCTION_LAMBDA_SECRET_ACCESS_KEY` |

### Breaking Changes

- Environment variables must be updated in production deployments
- Database migration renames `serverlessFunction` → `logicFunction`
tables
2026-01-28 01:42:19 +01:00

54 lines
1.6 KiB
TypeScript

import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('logicFunctionsResolver (e2e)', () => {
it('should find many logicFunctions', () => {
const queryData = {
query: `
query GetManyLogicFunctions {
findManyLogicFunctions {
id
name
description
runtime
latestVersion
publishedVersions
createdAt
updatedAt
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${APPLE_JANE_ADMIN_ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const logicFunctions = res.body.data.findManyLogicFunctions;
expect(logicFunctions).toBeDefined();
expect(Array.isArray(logicFunctions)).toBe(true);
if (logicFunctions.length > 0) {
const logicFunction = logicFunctions[0];
expect(logicFunction).toHaveProperty('id');
expect(logicFunction).toHaveProperty('name');
expect(logicFunction).toHaveProperty('description');
expect(logicFunction).toHaveProperty('runtime');
expect(logicFunction).toHaveProperty('latestVersion');
expect(logicFunction).toHaveProperty('publishedVersions');
expect(logicFunction).toHaveProperty('createdAt');
expect(logicFunction).toHaveProperty('updatedAt');
}
});
});
});