Skip to content

Commit

Permalink
chore: added component test cases for desitnations part3 (#2927)
Browse files Browse the repository at this point in the history
* chore: added component test cases for desitnations

* chore: added component test cases for wootric
  • Loading branch information
ItsSudip authored Dec 20, 2023
1 parent d0e24d3 commit 99613a0
Show file tree
Hide file tree
Showing 30 changed files with 12,323 additions and 10,231 deletions.
34 changes: 13 additions & 21 deletions test/__mocks__/axios.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,8 @@ const gainsightRequestHandler = require("./gainsight.mock");
const mailchimpGetRequestHandler = require("./mailchimp.mock");
const yahooDspPostRequestHandler = require("./yahoo_dsp.mock");
const { gainsightPXGetRequestHandler } = require("./gainsight_px.mock");
const { hsGetRequestHandler, hsPostRequestHandler } = require("./hs.mock");
const profitwellGetRequestHandler = require("./profitwell.mock");
const cannyPostRequestHandler = require("./canny.mock");
const {
wootricGetRequestHandler,
wootricPostRequestHandler
} = require("./wootric.mock");
const { userGetRequestHandler, userPutRequestHandler } = require("./user.mock");
const { mixpanelPostRequestHandler } = require("./mixpanel.mock");
const { mondayPostRequestHandler } = require("./monday.mock");
Expand All @@ -29,7 +24,6 @@ const { sendinblueGetRequestHandler } = require("./sendinblue.mock");
const { courierGetRequestHandler } = require("./courier.mock");

const urlDirectoryMap = {
"api.hubapi.com": "hs",
"zendesk.com": "zendesk",
"salesforce.com": "salesforce",
"mktorest.com": "marketo",
Expand Down Expand Up @@ -94,16 +88,22 @@ function get(url, options) {
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.profitwell.com")) {
return profitwellGetRequestHandler(url, mockData);
}
if (url.includes("https://api.wootric.com")) {
return new Promise((resolve, reject) => {
resolve(wootricGetRequestHandler(url));
});
if (
url.includes(
"https://api.getdrip.com/v2/1809802/subscribers/[email protected]"
)
) {
return Promise.resolve({ status: 200 });
}
if (
url.includes(
"https://api.getdrip.com/v2/1809802/subscribers/[email protected]"
)
) {
return Promise.reject({ status: 404 });
}
if (url.includes("https://commander.user.com")) {
return new Promise((resolve, reject) => {
Expand Down Expand Up @@ -164,14 +164,6 @@ function post(url, payload) {
resolve(cannyPostRequestHandler(url));
});
}
if (url.includes("https://api.hubapi.com")) {
return hsPostRequestHandler(payload, mockData);
}
if (url.includes("https://api.wootric.com")) {
return new Promise((resolve, reject) => {
resolve(wootricPostRequestHandler(url, payload));
});
}
if (
url.includes("https://api.mixpanel.com/engage/") ||
url.includes("https://api-eu.mixpanel.com/engage/")
Expand Down
455 changes: 0 additions & 455 deletions test/__mocks__/data/hs/response.json

This file was deleted.

107 changes: 0 additions & 107 deletions test/__mocks__/data/wootric/response.json

This file was deleted.

123 changes: 0 additions & 123 deletions test/__mocks__/hs.mock.js

This file was deleted.

55 changes: 0 additions & 55 deletions test/__mocks__/wootric.mock.js

This file was deleted.

1 change: 0 additions & 1 deletion test/__tests__/data/hs.json

This file was deleted.

Loading

0 comments on commit 99613a0

Please sign in to comment.