Skip to content

Commit

Permalink
add tmax to sovrnBidAdapter (#10059)
Browse files Browse the repository at this point in the history
  • Loading branch information
ikagotso authored Jun 7, 2023
1 parent 88e09c7 commit ebd801c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/sovrnBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,14 @@ export const spec = {
site.page = bidderRequest.refererInfo.page
site.domain = bidderRequest.refererInfo.domain

const tmax = deepAccess(bidderRequest, 'timeout');

const sovrnBidReq = {
id: getUniqueIdentifierStr(),
imp: sovrnImps,
site: site,
user: fpd.user || {}
user: fpd.user || {},
tmax: tmax
}

if (schain) {
Expand Down
13 changes: 13 additions & 0 deletions test/spec/modules/sovrnBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,19 @@ describe('sovrnBidAdapter', function() {
expect(payload.site.domain).to.equal('example.com')
})

it('sets correct timeout', function() {
const bidderRequest = {
...baseBidderRequest,
bidderCode: 'sovrn',
auctionId: '1d1a030790a475',
bidderRequestId: '22edbae2733bf6',
timeout: 3000,
bids: [baseBidRequest]
}
const payload = JSON.parse(spec.buildRequests([baseBidRequest], bidderRequest).data)
expect(payload.tmax).to.equal(3000)
})

it('includes the ad unit code in the request', function() {
const impression = payload.imp[0]
expect(impression.adunitcode).to.equal('adunit-code')
Expand Down

0 comments on commit ebd801c

Please sign in to comment.