Skip to content

Commit

Permalink
deal tier fix (prebid#5028)
Browse files Browse the repository at this point in the history
Co-authored-by: Jaimin Panchal <email@example.com>
  • Loading branch information
jaiminpanchal27 and Jaimin Panchal authored Mar 24, 2020
1 parent da6bb01 commit b24156c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/appnexusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ function newBid(serverBid, rtbBid, bidderRequest) {
case ADPOD:
const iabSubCatId = getIabSubCategory(bidRequest.bidder, rtbBid.brand_category_id);
bid.meta = Object.assign({}, bid.meta, { iabSubCatId });
const dealTier = rtbBid.rtb.dealPriority;
const dealTier = rtbBid.deal_priority;
bid.video = {
context: ADPOD,
durationSeconds: Math.floor(rtbBid.rtb.video.duration_ms / 1000),
Expand Down
16 changes: 14 additions & 2 deletions test/spec/modules/appnexusBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1069,17 +1069,29 @@ describe('AppNexusAdapter', function () {

it('should add deal_priority and deal_code', function() {
let responseWithDeal = deepClone(response);
responseWithDeal.tags[0].ads[0].deal_priority = 'high';
responseWithDeal.tags[0].ads[0].ad_type = 'video';
responseWithDeal.tags[0].ads[0].deal_priority = 5;
responseWithDeal.tags[0].ads[0].deal_code = '123';
responseWithDeal.tags[0].ads[0].rtb.video = {
duration_ms: 1500,
player_width: 640,
player_height: 340,
};

let bidderRequest = {
bids: [{
bidId: '3db3773286ee59',
adUnitCode: 'code'
adUnitCode: 'code',
mediaTypes: {
video: {
context: 'adpod'
}
}
}]
}
let result = spec.interpretResponse({ body: responseWithDeal }, {bidderRequest});
expect(Object.keys(result[0].appnexus)).to.include.members(['buyerMemberId', 'dealPriority', 'dealCode']);
expect(result[0].video.dealTier).to.equal(5);
});

it('should add advertiser id', function() {
Expand Down

0 comments on commit b24156c

Please sign in to comment.