Skip to content

Commit

Permalink
Merge pull request #3 from roshecode/master
Browse files Browse the repository at this point in the history
Aniview Bid Adapter: Added unit tests for the renderer
  • Loading branch information
itaynave authored Aug 25, 2020
2 parents 6959813 + e148052 commit d8b3e1a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
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

0 comments on commit d8b3e1a

Please sign in to comment.