Skip to content

Commit

Permalink
Admatic adapter: host param control changed
Browse files Browse the repository at this point in the history
  • Loading branch information
fatihkaya84 committed Nov 4, 2022
1 parent 7a2e0e2 commit de7ac85
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 5 additions & 1 deletion modules/admaticBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const spec = {
let isValid = false;
if (typeof bid.params !== 'undefined') {
let isValidNetworkId = _validateId(getValue(bid.params, 'networkId'));
let isValidHost = getValue(bid.params, 'host');
let isValidHost = _validateString(getValue(bid.params, 'host'));
isValid = isValidNetworkId && isValidHost;
}

Expand Down Expand Up @@ -198,4 +198,8 @@ function _validateId(id) {
return (parseInt(id) > 0);
}

function _validateString(str) {
return (typeof str == 'string');
}

registerBidder(spec);
8 changes: 5 additions & 3 deletions test/spec/modules/admaticBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {spec, storage} from 'modules/admaticBidAdapter.js';
import {newBidder} from 'src/adapters/bidderFactory.js';
import {getStorageManager} from 'src/storageManager';

const ENDPOINT = 'https://layer.serve.admatic.com.tr/v1';
const ENDPOINT = 'https://layer.serve.admatic.com.tr/pb';

describe('admaticBidAdapter', () => {
const adapter = newBidder(spec);
Expand All @@ -18,7 +18,8 @@ describe('admaticBidAdapter', () => {
let bid = {
'bidder': 'admatic',
'params': {
'networkId': 10433394
'networkId': 10433394,
'host': 'layer.serve.admatic.com.tr'
},
'adUnitCode': 'adunit-code',
'sizes': [[300, 250], [300, 600]],
Expand All @@ -37,7 +38,8 @@ describe('admaticBidAdapter', () => {
delete bid.params;

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

expect(spec.isBidRequestValid(bid)).to.equal(false);
Expand Down

0 comments on commit de7ac85

Please sign in to comment.