forked from prebid/Prebid.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add trafficSourceCode + test (prebid#1184)
- Loading branch information
Matt Kendall
authored and
John Salis
committed
May 19, 2017
1 parent
3b0082b
commit 3c2027a
Showing
2 changed files
with
44 additions
and
0 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
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,43 @@ | ||
import {expect} from 'chai'; | ||
import Adapter from '../../../src/adapters/appnexus'; | ||
import bidManager from '../../../src/bidmanager'; | ||
import adLoader from '../../../src/adloader'; | ||
|
||
describe('AppNexus Adapter', () => { | ||
|
||
let adapter; | ||
|
||
const REQUEST = { | ||
'bidderCode': 'appnexus', | ||
'requestId': 'd3e07445-ab06-44c8-a9dd-5ef9af06d2a6', | ||
'bidderRequestId': '7101db09af0db2', | ||
'bids': [ | ||
{ | ||
'bidder': 'appnexus', | ||
'params': { | ||
'placementId': '4799418', | ||
'trafficSourceCode' : 'source' | ||
}, | ||
'placementCode': '/19968336/header-bid-tag1', | ||
'sizes': [ | ||
[728, 90], | ||
[970, 90] | ||
], | ||
'bidId': '84ab500420319d', | ||
'bidderRequestId': '7101db09af0db2', | ||
'requestId': 'd3e07445-ab06-44c8-a9dd-5ef9af06d2a6' | ||
} | ||
], | ||
'start': 1469479810130 | ||
}; | ||
|
||
sinon.stub(bidManager, 'addBidResponse'); | ||
const adLoaderStub = sinon.stub(adLoader, 'loadScript'); | ||
|
||
describe('callBids', () => { | ||
adapter = new Adapter(); | ||
adapter.callBids(REQUEST); | ||
expect(adLoaderStub.getCall(0).args[0]).to.contain('traffic_source_code=source'); | ||
}); | ||
|
||
}); |