Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
fatihkaya84 committed Apr 27, 2023
1 parent f381a45 commit 689ce9d
Show file tree
Hide file tree
Showing 2 changed files with 154 additions and 5 deletions.
5 changes: 3 additions & 2 deletions modules/admaticBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ export const spec = {
ext: {
cur: currency,
bidder: bidderName
}
},
tmax: bidderRequest.timeout
};

if (!isEmpty(blacklist.badv)) {
Expand Down Expand Up @@ -132,7 +133,7 @@ export const spec = {

function isUrl(str) {
try {
new URL(str);
URL(str);
return true;
} catch (error) {
return false;
Expand Down
154 changes: 151 additions & 3 deletions test/spec/modules/admaticBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ describe('admaticBidAdapter', () => {
'bidId': '30b31c1838de1e',
'bidderRequestId': '22edbae2733bf6',
'auctionId': '1d1a030790a475',
'creativeId': 'er2ee'
'creativeId': 'er2ee',
'ortb2': { 'badv': ['admatic.com.tr'] }
};

it('should return true when required params found', function() {
Expand All @@ -51,6 +52,7 @@ describe('admaticBidAdapter', () => {
'networkId': 10433394,
'host': 'layer.serve.admatic.com.tr'
},
'ortb2': { 'badv': ['admatic.com.tr'] },
'mediaTypes': {
'banner': {
'sizes': [[300, 250], [728, 90]]
Expand Down Expand Up @@ -104,6 +106,49 @@ describe('admaticBidAdapter', () => {
'728x90': { 'currency': 'USD', 'floor': 2 }
}
}
},
{
"size": [
{
"w": 338,
"h": 280
}
],
"type": "video",
"mediatype": {
"context": "instream",
"mimes": [
"video/mp4"
],
"maxduration": 240,
"api": [
1,
2
],
"playerSize": [
[
338,
280
]
],
"protocols": [
1,
2,
3,
4,
5,
6,
7,
8
],
"skip": 1,
"playbackmethod": [
2
],
"linearity": 1,
"placement": 2
},
"id": "45e86fc7ce7fc93"
}
],
'ext': {
Expand All @@ -117,6 +162,7 @@ describe('admaticBidAdapter', () => {
'networkId': 10433394,
'host': 'layer.serve.admatic.com.tr'
},
'ortb2': { 'badv': ['admatic.com.tr'] },
'mediaTypes': {
'banner': {
'sizes': [[300, 250], [728, 90]]
Expand Down Expand Up @@ -170,6 +216,49 @@ describe('admaticBidAdapter', () => {
'728x90': { 'currency': 'USD', 'floor': 2 }
}
}
},
{
"size": [
{
"w": 338,
"h": 280
}
],
"type": "video",
"mediatype": {
"context": "instream",
"mimes": [
"video/mp4"
],
"maxduration": 240,
"api": [
1,
2
],
"playerSize": [
[
338,
280
]
],
"protocols": [
1,
2,
3,
4,
5,
6,
7,
8
],
"skip": 1,
"playbackmethod": [
2
],
"linearity": 1,
"placement": 2
},
"id": "45e86fc7ce7fc93"
}
],
'ext': {
Expand All @@ -195,6 +284,7 @@ describe('admaticBidAdapter', () => {
'sizes': [[300, 250], [728, 90]]
}
},
'ortb2': { 'badv': ['admatic.com.tr'] },
getFloor: inputParams => {
if (inputParams.mediaType === BANNER && inputParams.size[0] === 300 && inputParams.size[1] === 250) {
return {
Expand All @@ -218,6 +308,7 @@ describe('admaticBidAdapter', () => {
'networkId': 10433394,
'host': 'layer.serve.admatic.com.tr'
},
'ortb2': { 'badv': ['admatic.com.tr'] },
'adUnitCode': 'adunit-code',
'sizes': [[300, 250], [728, 90]],
'bidId': '30b31c1838de1e',
Expand Down Expand Up @@ -254,8 +345,31 @@ describe('admaticBidAdapter', () => {
'bidder': 'admatic',
'adomain': ['admatic.com.tr'],
'party_tag': '<div></div>',
'iurl': 'https://www.admatic.com.tr',
'type': 'banner'
'iurl': 'https://www.admatic.com.tr'
},
{
'id': 2,
'creative_id': '3741',
'width': 300,
'height': 250,
'price': 0.01,
'type': 'video',
'bidder': 'admatic',
'adomain': ['admatic.com.tr'],
'party_tag': '<VAST></VAST>',
'iurl': 'https://www.admatic.com.tr'
},
{
'id': 3,
'creative_id': '3741',
'width': 300,
'height': 250,
'price': 0.01,
'type': 'video',
'bidder': 'admatic',
'adomain': ['admatic.com.tr'],
'party_tag': 'https://www.admatic.com.tr',
'iurl': 'https://www.admatic.com.tr'
}
],
'queryId': 'cdnbh24rlv0hhkpfpln0',
Expand All @@ -278,6 +392,40 @@ describe('admaticBidAdapter', () => {
},
ttl: 60,
bidder: 'admatic'
},
{
requestId: 2,
cpm: 0.01,
width: 300,
height: 250,
currency: 'TRY',
mediaType: 'video',
netRevenue: true,
vastImpUrl: 'https://www.admatic.com.tr',
vastXml: '<VAST></VAST>',
creativeId: '3741',
meta: {
advertiserDomains: ['admatic.com.tr']
},
ttl: 60,
bidder: 'admatic'
},
{
requestId: 3,
cpm: 0.01,
width: 300,
height: 250,
currency: 'TRY',
mediaType: 'video',
netRevenue: true,
vastImpUrl: 'https://www.admatic.com.tr',
vastXml: 'https://www.admatic.com.tr',
creativeId: '3741',
meta: {
advertiserDomains: ['admatic.com.tr']
},
ttl: 60,
bidder: 'admatic'
}
];
const request = {
Expand Down

0 comments on commit 689ce9d

Please sign in to comment.