Add integration tests for /metadata + fix relation deletion (#8706)

In this PR

1. Add integration tests for /metadata (master issue:
https://github.com/twentyhq/twenty/issues/8719)
2. Fix relation deletion: index on "from" object was not deleted,
impeding creation of a new relation between the same two objects A and B
after relation between A and B was deleted
This commit is contained in:
Marie
2024-11-26 10:00:36 +01:00
committed by GitHub
parent 49526937fa
commit 7bde2006c5
11 changed files with 597 additions and 9 deletions

View File

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