Skip to content
Open
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/riseBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ function generateBidParameters(bid, bidderRequest) {
};

const pos = deepAccess(bid, `mediaTypes.${mediaType}.pos`);
if (pos) {
if (pos || pos === 0) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to add the same treatment to the other adapters like kueezBidAdapter.js, minutemediaBidAdapter.js, publirBidAdapter.js, shinezBidAdapter.js, stnBidAdapter.js?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all adapters that are similar to our will need to have this treatment, not sure which of them.
@OronW @innay

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I would advise to check also kueezBidAdapter, minutemediaBidAdapter, shinezBidAdapter and stnBidAdapter.

I'm not familiar with (and couldn't find) publirBidAdapter, but if there any other adapters we own they would need to be updated as well

bidObject.pos = pos;
}

Expand Down
13 changes: 12 additions & 1 deletion test/spec/modules/riseBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ describe('riseAdapter', function () {
'video': {
'playerSize': [[640, 480]],
'context': 'instream',
'plcmt': 1
'plcmt': 1,
'pos': 0
}
},
'vastXml': '"<VAST version=\\\"2.0\\\">...</VAST>"'
Expand Down Expand Up @@ -116,6 +117,7 @@ describe('riseAdapter', function () {
const api = [1, 2];
const mimes = ['application/javascript', 'video/mp4', 'video/quicktime'];
const protocols = [2, 3, 5, 6];
const pos = 4;

it('sends the placementId to ENDPOINT via POST', function () {
bidRequests[0].params.placementId = placementId;
Expand Down Expand Up @@ -444,6 +446,15 @@ describe('riseAdapter', function () {
expect(request.data.bids[0].sua).to.not.exist;
});

it('should send right position of the bid', function() {
const bid = utils.deepClone(bidRequests[1]);
bid.mediaTypes.banner.pos = pos;
const request = spec.buildRequests([bidRequests[0], bidRequests[1], bid], bidderRequest);
expect(request.data.bids[0].pos).to.equal(0);
expect(request.data.bids[1].pos).to.equal(undefined);
expect(request.data.bids[2].pos).to.equal(pos);
});

describe('COPPA Param', function() {
it('should set coppa equal 0 in bid request if coppa is set to false', function() {
const request = spec.buildRequests(bidRequests, bidderRequest);
Expand Down