diff --git a/test/integrations/destinations/custify/deleteUsers/data.ts b/test/integrations/destinations/custify/deleteUsers/data.ts new file mode 100644 index 0000000000..3c18811628 --- /dev/null +++ b/test/integrations/destinations/custify/deleteUsers/data.ts @@ -0,0 +1,71 @@ +const destType = 'custify'; + +export const data = [ + { + name: destType, + description: 'Test 0: should fail when config is not being sent', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: destType.toUpperCase(), + userAttributes: [ + { + userId: 'rudder1', + }, + ], + }, + ], + }, + }, + output: { + response: { + status: 400, + body: [ + { + statusCode: 400, + error: 'Config for deletion not present', + }, + ], + }, + }, + }, + { + name: destType, + description: 'Test 1: should fail when apiKey is not present in config', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destType: destType.toUpperCase(), + userAttributes: [ + { + userId: 'rudder2', + }, + ], + config: { + apiToken: 'dummyApiKey', + }, + }, + ], + }, + }, + output: { + response: { + status: 400, + body: [ + { + statusCode: 400, + error: 'api key for deletion not present', + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/custify/network.ts b/test/integrations/destinations/custify/network.ts index 146fcfef30..66f9ab4fa6 100644 --- a/test/integrations/destinations/custify/network.ts +++ b/test/integrations/destinations/custify/network.ts @@ -33,4 +33,37 @@ export const networkCallsData = [ status: 200, }, }, + + { + httpReq: { + method: 'delete', + url: 'https://api.custify.com/people?user_id=rudder1', + headers: { + Authorization: 'Bearer dummyApiKey', + }, + }, + httpRes: { + data: { + msg: 'All users associated with rudder1 were successfully deleted', + code: 'Success', + params: null, + }, + status: 200, + }, + }, + { + httpReq: { + method: 'delete', + url: 'https://api.custify.com/people?user_id=rudder2', + headers: { + Authorization: 'Bearer dummyApiKey', + }, + }, + httpRes: { + data: { + error: 'User: rudder2 not found', + }, + status: 404, + }, + }, ];