Skip to content

Commit

Permalink
admatic adapter video params update
Browse files Browse the repository at this point in the history
  • Loading branch information
fatihkaya84 committed Apr 26, 2023
1 parent dcfc9fe commit 31e69e8
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 17 deletions.
13 changes: 11 additions & 2 deletions modules/admaticBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,9 @@ export const spec = {
meta: {
advertiserDomains: bid && bid.adomain ? bid.adomain : []
},
ttl: 360,
bidder: bid.bidder
bidder: bid.bidder,
mediaType: bid.type,
ttl: 360
};

bidResponses.push(resbid);
Expand Down Expand Up @@ -168,6 +169,14 @@ function parseSize(size) {
function buildRequestObject(bid) {
const reqObj = {};
reqObj.size = getSizes(bid);
if (bid.mediaTypes?.banner) {
reqObj.type = 'banner';
reqObj.mediatype = {};
}
if (bid.mediaTypes?.video) {
reqObj.type = 'video';
reqObj.mediatype = bid.mediaTypes.video;
}
reqObj.id = getBidIdParameter('bidId', bid);

enrichSlotWithFloors(reqObj, bid);
Expand Down
18 changes: 11 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 11 additions & 8 deletions test/spec/modules/admaticBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ describe('admaticBidAdapter', () => {
'host': 'layer.serve.admatic.com.tr'
},
'adUnitCode': 'adunit-code',
'mediaType': 'banner',
'sizes': [[300, 250], [300, 600]],
'bidId': '30b31c1838de1e',
'bidderRequestId': '22edbae2733bf6',
Expand All @@ -34,15 +35,11 @@ describe('admaticBidAdapter', () => {
});

it('should return false when required params are not passed', function() {
let bid = Object.assign({}, bid);
delete bid.params;

bid.params = {
'networkId': 0,
'host': 'layer.serve.admatic.com.tr'
let bid2 = {};
bid2.params = {
'someIncorrectParam': 0
};

expect(spec.isBidRequestValid(bid)).to.equal(false);
expect(spec.isBidRequestValid(bid2)).to.equal(false);
});
});

Expand Down Expand Up @@ -98,6 +95,8 @@ describe('admaticBidAdapter', () => {
'h': 90
}
],
'mediatype': {},
'type': 'banner',
'id': '2205da7a81846b',
'floors': {
'banner': {
Expand Down Expand Up @@ -163,6 +162,8 @@ describe('admaticBidAdapter', () => {
}
],
'id': '2205da7a81846b',
'mediatype': {},
'type': 'banner',
'floors': {
'banner': {
'300x250': { 'currency': 'USD', 'floor': 1 },
Expand Down Expand Up @@ -249,6 +250,7 @@ describe('admaticBidAdapter', () => {
'width': 300,
'height': 250,
'price': 0.01,
'type': 'banner',
'bidder': 'admatic',
'adomain': ['admatic.com.tr'],
'party_tag': '<div></div>'
Expand All @@ -265,6 +267,7 @@ describe('admaticBidAdapter', () => {
width: 300,
height: 250,
currency: 'TRY',
mediaType: 'banner',
netRevenue: true,
ad: '<div></div>',
creativeId: '374',
Expand Down

0 comments on commit 31e69e8

Please sign in to comment.