Skip to content

Commit

Permalink
SmartRTB Bid Adapter: add alias and update valid opts (#6365)
Browse files Browse the repository at this point in the history
* Add alias, update valid opts

* Update bidder tests
  • Loading branch information
evanmsmrtb authored Mar 10, 2021
1 parent b65ea73 commit cdfc9df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
6 changes: 2 additions & 4 deletions modules/smartrtbBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ function getDomain () {
export const spec = {
code: BIDDER_CODE,
supportedMediaTypes: [ 'banner', 'video' ],
aliases: ['smrtb'],
aliases: ['rdigital'],
isBidRequestValid: function(bid) {
return (bid.params.pubId !== null &&
bid.params.medId !== null &&
bid.params.zoneId !== null);
return (bid.params.pubId !== null || bid.params.zoneId !== null);
},
buildRequests: function(validBidRequests, bidderRequest) {
let stack = (bidderRequest.refererInfo &&
Expand Down
7 changes: 2 additions & 5 deletions test/spec/modules/smartrtbBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,15 @@ describe('SmartRTBBidAdapter', function () {
it('should return a bidder code of smartrtb', function () {
expect(spec.code).to.equal('smartrtb')
})
it('should alias smrtb', function () {
expect(spec.aliases.length > 0 && spec.aliases[0] === 'smrtb').to.be.true
})
})

describe('isBidRequestValid', function () {
it('should return true if all params present', function () {
expect(spec.isBidRequestValid(bannerRequest)).to.be.true
})

it('should return false if any zone id missing', function () {
expect(spec.isBidRequestValid(Object.assign(bannerRequest, { params: { zoneId: null } }))).to.be.false
it('should return false if any zone id and pub id missing', function () {
expect(spec.isBidRequestValid(Object.assign(bannerRequest, { params: { pubId: null, zoneId: null } }))).to.be.false
})
})

Expand Down

0 comments on commit cdfc9df

Please sign in to comment.