Moprh-integration-delete (#13165)

Intergartion test dedicated to the delete method
This commit is contained in:
Guillim
2025-07-15 11:16:19 +02:00
committed by GitHub
parent ff3f3d4661
commit 1a81e43286
5 changed files with 222 additions and 40 deletions

View File

@ -57,18 +57,12 @@ describe('createOne FieldMetadataService relation fields', () => {
});
type EachTestingContextArray = EachTestingContext<
| {
relationType: RelationType;
objectMetadataId: string;
targetObjectMetadataId: string;
type: FieldMetadataType.RELATION | FieldMetadataType.MORPH_RELATION;
}
| ((args: { objectMetadataId: string; targetObjectMetadataId: string }) => {
relationType: RelationType;
objectMetadataId: string;
targetObjectMetadataId: string;
type: FieldMetadataType.RELATION | FieldMetadataType.MORPH_RELATION;
})
(args: { objectMetadataId: string; targetObjectMetadataId: string }) => {
relationType: RelationType;
objectMetadataId: string;
targetObjectMetadataId: string;
type: FieldMetadataType.RELATION | FieldMetadataType.MORPH_RELATION;
}
>[];
const eachTestingContextArray: EachTestingContextArray = [
@ -93,15 +87,14 @@ describe('createOne FieldMetadataService relation fields', () => {
];
it.each(eachTestingContextArray)('$title', async ({ context }) => {
const contextPayload =
typeof context === 'function'
? context({
objectMetadataId: createdObjectMetadataOpportunityId,
targetObjectMetadataId: createdObjectMetadataPersonId,
})
: context;
const contextPayload = context({
objectMetadataId: createdObjectMetadataOpportunityId,
targetObjectMetadataId: createdObjectMetadataPersonId,
});
const createdField = await createRelationBetweenObjects({
const createdField = await createRelationBetweenObjects<
typeof contextPayload.type
>({
objectMetadataId: contextPayload.objectMetadataId,
targetObjectMetadataId: contextPayload.targetObjectMetadataId,
type: contextPayload.type,