-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: added component test cases for desitnations
- Loading branch information
Showing
53 changed files
with
12,023 additions
and
12,171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,19 +3,12 @@ | |
/// ///////////////////////////////////////////////////////////////////////////// | ||
const axios = jest.genMockFromModule("axios"); | ||
const acPostRequestHandler = require("./active_campaign.mock"); | ||
const { | ||
klaviyoPostRequestHandler, | ||
klaviyoGetRequestHandler | ||
} = require("./klaviyo.mock"); | ||
|
||
const kustomerGetRequestHandler = require("./kustomer.mock"); | ||
const trengoGetRequestHandler = require("./trengo.mock"); | ||
const mailchimpGetRequestHandler = require("./mailchimp.mock"); | ||
const yahooDspPostRequestHandler = require("./yahoo_dsp.mock"); | ||
const { hsGetRequestHandler, hsPostRequestHandler } = require("./hs.mock"); | ||
const { delightedGetRequestHandler } = require("./delighted.mock"); | ||
const { dripPostRequestHandler } = require("./drip.mock"); | ||
const profitwellGetRequestHandler = require("./profitwell.mock"); | ||
const cannyPostRequestHandler = require("./canny.mock"); | ||
const custifyPostRequestHandler = require("./custify.mock"); | ||
const { | ||
|
@@ -29,13 +22,11 @@ const { | |
freshmarketerPostRequestHandler, | ||
freshmarketerGetRequestHandler | ||
} = require("./freshmarketer.mock"); | ||
const { mondayPostRequestHandler } = require("./monday.mock"); | ||
const { | ||
freshsalesGetRequestHandler, | ||
freshsalesPostRequestHandler | ||
} = require("./freshsales.mock"); | ||
const { sendgridGetRequestHandler } = require("./sendgrid.mock"); | ||
const { sendinblueGetRequestHandler } = require("./sendinblue.mock"); | ||
const { courierGetRequestHandler } = require("./courier.mock"); | ||
const { brazePostRequestHandler } = require("./braze.mock"); | ||
|
||
|
@@ -45,10 +36,8 @@ const urlDirectoryMap = { | |
"salesforce.com": "salesforce", | ||
"mktorest.com": "marketo", | ||
"active.campaigns.rudder.com": "active_campaigns", | ||
"api.profitwell.com": "profitwell", | ||
"ruddertest2.mautic.net": "mautic", | ||
"api.sendgrid.com": "sendgrid", | ||
"api.sendinblue.com": "sendinblue", | ||
"api.criteo.com": "criteo_audience", | ||
"api.courier.com": "courier", | ||
}; | ||
|
@@ -83,33 +72,17 @@ function getData(url) { | |
|
||
function get(url, options) { | ||
const mockData = getData(url); | ||
if (url.includes("https://api.kustomerapp.com") || url.includes("https://api.prod2.kustomerapp.com")) { | ||
return new Promise((resolve, reject) => { | ||
resolve(kustomerGetRequestHandler(url)); | ||
}); | ||
} | ||
if (url.includes("https://app.trengo.com")) { | ||
return new Promise((resolve, reject) => { | ||
resolve(trengoGetRequestHandler(url)); | ||
}); | ||
} | ||
if (url.includes("api.mailchimp.com")) { | ||
return new Promise((resolve, reject) => { | ||
resolve(mailchimpGetRequestHandler(url)); | ||
}); | ||
} | ||
if (url.includes("https://a.klaviyo.com/api/v2/people/search")) { | ||
return klaviyoGetRequestHandler(getParamEncodedUrl(url, options)); | ||
} | ||
if (url.includes("https://api.hubapi.com")) { | ||
return hsGetRequestHandler(url, mockData); | ||
} | ||
if (url.includes("https://api.delighted.com/v1/people.json")) { | ||
return delightedGetRequestHandler(options); | ||
} | ||
if (url.includes("https://api.profitwell.com")) { | ||
return profitwellGetRequestHandler(url, mockData); | ||
} | ||
if ( | ||
url.includes( | ||
"https://api.getdrip.com/v2/1809802/subscribers/[email protected]" | ||
|
@@ -146,9 +119,6 @@ function get(url, options) { | |
if (url.includes("https://api.sendgrid.com/v3/marketing/field_definitions")) { | ||
return Promise.resolve(sendgridGetRequestHandler(url)); | ||
} | ||
if (url.includes("https://api.sendinblue.com/v3/contacts/")) { | ||
return Promise.resolve(sendinblueGetRequestHandler(url, mockData)); | ||
} | ||
if (url.includes("https://api.courier.com")) { | ||
return Promise.resolve(courierGetRequestHandler(url, mockData)); | ||
} | ||
|
@@ -177,11 +147,6 @@ function post(url, payload) { | |
resolve(brazePostRequestHandler(url, payload)); | ||
}); | ||
} | ||
if (url.includes("https://a.klaviyo.com")) { | ||
return new Promise((resolve, reject) => { | ||
resolve(klaviyoPostRequestHandler(url, payload)); | ||
}); | ||
} | ||
if (url.includes("https://api.aptrinsic.com")) { | ||
return new Promise(resolve => { | ||
resolve({ status: 201 }); | ||
|
@@ -226,14 +191,6 @@ function post(url, payload) { | |
resolve(freshsalesPostRequestHandler(url)); | ||
}); | ||
} | ||
if ( | ||
url.includes("https://api.monday.com") && | ||
payload.query.includes("query") | ||
) { | ||
return new Promise((resolve, reject) => { | ||
resolve(mondayPostRequestHandler(payload)); | ||
}); | ||
} | ||
if (url.includes("https://api.custify.com")) { | ||
return Promise.resolve(custifyPostRequestHandler(url)); | ||
} | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.