Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: added component test cases for desitnations part3 #2927

Merged
merged 5 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading