Skip to content

Commit

Permalink
PBS bid adapter: revised outstream unit test for 7038 (#7208)
Browse files Browse the repository at this point in the history
* PBS Bid Adapter: outstream renderer bugfix

* Update modules/prebidServerBidAdapter/index.js

Co-authored-by: Nepomuk Seiler <muuki88@users.noreply.github.com>

* revert to &&

* remove parens

* PBS bid adapter: check on unit test for 7038

* Update prebidServerBidAdapter_spec.js

* Update prebidServerBidAdapter_spec.js

* Update prebidServerBidAdapter_spec.js

* Update prebidServerBidAdapter_spec.js

Co-authored-by: Chris Huie <phoenixtechnerd@gmail.com>
Co-authored-by: Nepomuk Seiler <muuki88@users.noreply.github.com>
  • Loading branch information
3 people authored Jul 23, 2021
1 parent 84a39c6 commit f53232d
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions test/spec/modules/prebidServerBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,16 @@ const OUTSTREAM_VIDEO_REQUEST = {
'video': {
playerSize: [[640, 480]],
context: 'outstream',
mimes: ['video/mp4']
mimes: ['video/mp4'],
renderer: {
url: 'https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js',
render: function (bid) {
ANOutstreamVideo.renderAd({
targetId: bid.adUnitCode,
adResponse: bid.adResponse,
});
}
}
},
banner: { sizes: [[300, 250]] }
},
Expand All @@ -143,7 +152,8 @@ const OUTSTREAM_VIDEO_REQUEST = {
video: {
playerSize: [640, 480],
context: 'outstream',
mimes: ['video/mp4']
mimes: ['video/mp4'],
skip: 1
}
},
bids: [
Expand All @@ -157,16 +167,7 @@ const OUTSTREAM_VIDEO_REQUEST = {
}
}
}
],
renderer: {
url: 'http://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js',
render: function (bid) {
ANOutstreamVideo.renderAd({
targetId: bid.adUnitCode,
adResponse: bid.adResponse,
});
}
}
]
}
],
};
Expand Down Expand Up @@ -560,14 +561,14 @@ describe('S2S Adapter', function () {
expect(server.requests.length).to.equal(0);
});

it('should not add outstrean without renderer', function () {
it('should add outstream bc renderer exists on mediatype', function () {
config.setConfig({ s2sConfig: CONFIG });

adapter.callBids(OUTSTREAM_VIDEO_REQUEST, BID_REQUESTS, addBidResponse, done, ajax);

const requestBid = JSON.parse(server.requests[0].requestBody);
expect(requestBid.imp[0].banner).to.exist;
expect(requestBid.imp[0].video).to.not.exist;
expect(requestBid.imp[0].video).to.exist;
});

it('should default video placement if not defined and instream', function () {
Expand Down

0 comments on commit f53232d

Please sign in to comment.