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

PBS bid adapter: revised outstream unit test for 7038 #7208

Merged
merged 10 commits into from
Jul 23, 2021
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