Skip to content

Commit

Permalink
Seedtag adapter: Fixing bug preventing to receive the right params on…
Browse files Browse the repository at this point in the history
…Timeout. (prebid#6525)
  • Loading branch information
lauramorillo authored and marc_tappx committed Apr 13, 2021
1 parent 25ba111 commit 8aed380
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/seedtagBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ export const spec = {
* @param {data} Containing timeout specific data
*/
onTimeout(data) {
getTimeoutUrl(data);
utils.triggerPixel(SEEDTAG_SSP_ONTIMEOUT_ENDPOINT);
const url = getTimeoutUrl(data);
utils.triggerPixel(url);
},

/**
Expand Down
18 changes: 18 additions & 0 deletions test/spec/modules/seedtagBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,14 @@ describe('Seedtag Adapter', function() {
})

describe('onTimeout', function () {
beforeEach(function() {
sinon.stub(utils, 'triggerPixel')
})

afterEach(function() {
utils.triggerPixel.restore()
})

it('should return the correct endpoint', function () {
const params = { publisherId: '0000', adUnitId: '11111' }
const timeoutData = [{ params: [ params ] }];
Expand All @@ -420,6 +428,16 @@ describe('Seedtag Adapter', function() {
params.adUnitId
)
})

it('should set the timeout pixel', function() {
const params = { publisherId: '0000', adUnitId: '11111' }
const timeoutData = [{ params: [ params ] }];
spec.onTimeout(timeoutData)
expect(utils.triggerPixel.calledWith('https://s.seedtag.com/se/hb/timeout?publisherToken=' +
params.publisherId +
'&adUnitId=' +
params.adUnitId)).to.equal(true);
})
})

describe('onBidWon', function () {
Expand Down

0 comments on commit 8aed380

Please sign in to comment.