Skip to content

Commit

Permalink
SpotX Adapter: Render immediately (#8731)
Browse files Browse the repository at this point in the history
* Render spotx ads immediately

* Formatting fix
  • Loading branch information
spotxslagle authored and ahmadlob committed Jul 27, 2022
1 parent a3a9d21 commit 45fddb9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/spotxBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ export const spec = {
const playersize = deepAccess(currentBidRequest, 'mediaTypes.video.playerSize');
const renderer = Renderer.install({
id: 0,
url: '/',
renderNow: true,
config: {
adText: 'SpotX Outstream Video Ad via Prebid.js',
player_width: playersize[0][0],
Expand Down
12 changes: 12 additions & 0 deletions test/spec/modules/spotxBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ describe('the spotx adapter', function () {
},
bidId: 123,
params: {
ad_unit: 'outstream',
player_width: 400,
player_height: 300,
content_page_url: 'prebid.js',
Expand Down Expand Up @@ -533,6 +534,17 @@ describe('the spotx adapter', function () {
expect(responses[1].videoCacheKey).to.equal('cache124');
expect(responses[1].width).to.equal(200);
});

it('should set the renderer attached to the bid to render immediately', function () {
var renderer = spec.interpretResponse(serverResponse, bidderRequestObj)[0].renderer,
hasRun = false;
expect(renderer._render).to.be.a('function');
renderer._render = () => {
hasRun = true;
}
renderer.render();
expect(hasRun).to.equal(true);
});
});

describe('outstreamRender', function() {
Expand Down

0 comments on commit 45fddb9

Please sign in to comment.