Skip to content

Commit

Permalink
freewheel-ssp Bid Adapter: add schain in request params (prebid#7504)
Browse files Browse the repository at this point in the history
* freewheel add schain in the request

* Fix an error on test case

* Update freewheel-sspBidAdapter_spec.js

Update test case

* Update freewheel-sspBidAdapter_spec.js

fix the test

* Update freewheel-sspBidAdapter_spec.js

Fix the test error
  • Loading branch information
xwang202 authored and Chris Pabst committed Jan 10, 2022
1 parent df25508 commit b52cc0f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/freewheel-sspBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,12 @@ export const spec = {
requestParams._fw_us_privacy = bidderRequest.uspConsent;
}

// Add schain object
var schain = currentBidRequest.schain;
if (schain) {
requestParams.schain = schain;
}

var vastParams = currentBidRequest.params.vastUrlParams;
if (typeof vastParams === 'object') {
for (var key in vastParams) {
Expand Down
19 changes: 19 additions & 0 deletions test/spec/modules/freewheel-sspBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,19 @@ describe('freewheelSSP BidAdapter Test', () => {
'bidId': '30b31c1838de1e',
'bidderRequestId': '22edbae2733bf6',
'auctionId': '1d1a030790a475',
'schain': {
'ver': '1.0',
'complete': 1,
'nodes': [
{
'asi': 'example.com',
'sid': '0',
'hp': 1,
'rid': 'bidrequestid',
'domain': 'example.com'
}
]
}
}
];

Expand All @@ -112,6 +125,12 @@ describe('freewheelSSP BidAdapter Test', () => {
expect(payload.playerSize).to.equal('300x600');
});

it('should return a properly formatted request with schain defined', function () {
const request = spec.buildRequests(bidRequests);
const payload = request[0].data;
expect(payload.schain).to.deep.equal(bidRequests[0].schain)
});

it('sends bid request to ENDPOINT via GET', () => {
const request = spec.buildRequests(bidRequests);
expect(request[0].url).to.contain(ENDPOINT);
Expand Down

0 comments on commit b52cc0f

Please sign in to comment.