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

SpotX Adapter: Render immediately #8731

Merged
merged 2 commits into from
Jul 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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