Skip to content

Commit

Permalink
Qwarry Bid Adapter: add sizes (#6787)
Browse files Browse the repository at this point in the history
* qwarry bid adapter

* formatting fixes

* fix tests for qwarry

* qwarry bid adapter

* add header for qwarry bid adapter

* bid requests fix

* fix tests

* response fix

* fix tests for Qwarry bid adapter

* add pos parameter to qwarry bid adapter

* qwarryBidAdapter onBidWon hotfix

* Change bidder endpoint url for Qwarry adapter

* add referer JS detection

* use bidderRequest.refererInfo

* fix tests

* GDPR consent string support

* NPE fix

* gdpr value added

* merge master

* gdpr value added

* qwarry bid adapter: add tests

* Qwarry bid adapter: remove gdpr field from request

* qwarry bid adapter: add sizes

* qwarry bid adapter: add sizes

Co-authored-by: Artem Kostritsa <akostritsa@akostritsa.com>
Co-authored-by: Alexander Kascheev <akascheev@asteriosoft.com>
  • Loading branch information
3 people authored and idettman committed May 21, 2021
1 parent 856ebc1 commit 1097025
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion modules/qwarryBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export const spec = {
bids.push({
bidId: bidRequest.bidId,
zoneToken: bidRequest.params.zoneToken,
pos: bidRequest.params.pos
pos: bidRequest.params.pos,
sizes: prepareSizes(bidRequest.sizes)
})
})

Expand Down Expand Up @@ -90,4 +91,8 @@ export const spec = {
}
}

function prepareSizes(sizes) {
return sizes && sizes.map(size => ({ width: size[0], height: size[1] }));
}

registerBidder(spec);
3 changes: 2 additions & 1 deletion test/spec/modules/qwarryBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { newBidder } from 'src/adapters/bidderFactory.js'
const REQUEST = {
'bidId': '456',
'bidder': 'qwarry',
'sizes': [[100, 200], [300, 400]],
'params': {
zoneToken: 'e64782a4-8e68-4c38-965b-80ccf115d46f',
pos: 7
Expand Down Expand Up @@ -85,7 +86,7 @@ describe('qwarryBidAdapter', function () {
expect(bidderRequest.method).to.equal('POST')
expect(bidderRequest.data.requestId).to.equal('123')
expect(bidderRequest.data.referer).to.equal('http://test.com/path.html')
expect(bidderRequest.data.bids).to.deep.contains({ bidId: '456', zoneToken: 'e64782a4-8e68-4c38-965b-80ccf115d46f', pos: 7 })
expect(bidderRequest.data.bids).to.deep.contains({ bidId: '456', zoneToken: 'e64782a4-8e68-4c38-965b-80ccf115d46f', pos: 7, sizes: [{ width: 100, height: 200 }, { width: 300, height: 400 }] })
expect(bidderRequest.data.gdprConsent).to.deep.contains({ consentRequired: true, consentString: 'BOJ8RZsOJ8RZsABAB8AAAAAZ+A==' })
expect(bidderRequest.options.customHeaders).to.deep.equal({ 'Rtb-Direct': true })
expect(bidderRequest.options.contentType).to.equal('application/json')
Expand Down

0 comments on commit 1097025

Please sign in to comment.