Skip to content

Commit

Permalink
fix: addition of custify user-deletion tests
Browse files Browse the repository at this point in the history
Signed-off-by: Sai Sankeerth <[email protected]>
  • Loading branch information
Sai Sankeerth committed Feb 7, 2024
1 parent 3bfdb3d commit 7275b5d
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 0 deletions.
71 changes: 71 additions & 0 deletions test/integrations/destinations/custify/deleteUsers/data.ts
Original file line number Diff line number Diff line change
@@ -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',
},
],
},
},
},
];
33 changes: 33 additions & 0 deletions test/integrations/destinations/custify/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
];

0 comments on commit 7275b5d

Please sign in to comment.