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

Aniview Bid Adapter: Added unit tests for the renderer #3

Merged
merged 2 commits into from
Aug 25, 2020
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: 2 additions & 0 deletions modules/aniviewBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { registerBidder } from '../src/adapters/bidderFactory.js';
import { Renderer } from '../src/Renderer.js';

const BIDDER_CODE = 'aniview';
const GVLID = 780;
const TTL = 600;

function avRenderer(bid) {
Expand Down Expand Up @@ -270,6 +271,7 @@ function getUserSyncs(syncOptions, serverResponses) {

export const spec = {
code: BIDDER_CODE,
gvlid: GVLID,
aliases: ['avantisvideo', 'selectmediavideo'],
supportedMediaTypes: [VIDEO],
isBidRequestValid,
Expand Down
27 changes: 27 additions & 0 deletions test/spec/modules/aniviewBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,33 @@ describe('ANIVIEW Bid Adapter Test', function () {
let result = spec.interpretResponse(nobidResponse, bidRequest);
expect(result.length).to.equal(0);
});

it('should add renderer if outstream context', function () {
const bidRequest = spec.buildRequests([
{
bidId: '253dcb69fb2577',
params: {
playerDomain: 'example.com',
AV_PUBLISHERID: '55b78633181f4603178b4568',
AV_CHANNELID: '55b7904d181f46410f8b4568'
},
mediaTypes: {
video: {
playerSize: [[640, 480]],
context: 'outstream'
}
}
}
])[0]
const bidResponse = spec.interpretResponse(serverResponse, bidRequest)[0]

expect(bidResponse.renderer.url).to.equal('https://example.com/script/6.1/prebidRenderer.js')
expect(bidResponse.renderer.config.AV_PUBLISHERID).to.equal('55b78633181f4603178b4568')
expect(bidResponse.renderer.config.AV_CHANNELID).to.equal('55b7904d181f46410f8b4568')
expect(bidResponse.renderer.loaded).to.equal(false)
expect(bidResponse.width).to.equal(640)
expect(bidResponse.height).to.equal(480)
})
});

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