-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1 parent
0e06e78
commit abe40e5
Showing
2 changed files
with
40 additions
and
16 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const { getNetworkHandler } = require('./networkHandlerFactory'); | ||
const { networkHandler: GenericNetworkHandler } = require('./networkhandler/genericNetworkHandler'); | ||
|
||
describe(`Network Handler Tests`, () => { | ||
it('Should return v0 networkhandler', () => { | ||
let proxyHandler = getNetworkHandler('campaign_manager', `v0`); | ||
const cmProxy = require(`../v0/destinations/campaign_manager/networkHandler`).networkHandler; | ||
expect(proxyHandler).toEqual(new cmProxy()); | ||
|
||
proxyHandler = getNetworkHandler('braze', `v0`); | ||
const brazeProxy = require(`../v0/destinations/braze/networkHandler`).networkHandler; | ||
expect(proxyHandler).toEqual(new brazeProxy()); | ||
}); | ||
|
||
it('Should return v1 networkhandler', () => { | ||
let proxyHandler = getNetworkHandler('campaign_manager', `v1`); | ||
const cmProxy = require(`../v1/destinations/campaign_manager/networkHandler`).networkHandler; | ||
expect(proxyHandler).toEqual(new cmProxy()); | ||
}); | ||
|
||
it('Should return genericHandler if v1 proxy and handler is not present for destination', () => { | ||
let proxyHandler = getNetworkHandler('braze', `v1`); | ||
expect(proxyHandler).toEqual(new GenericNetworkHandler()); | ||
}); | ||
}); |
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