diff --git a/modules/gumgumBidAdapter.js b/modules/gumgumBidAdapter.js index c9bf77494cf..2b0f7e03d22 100644 --- a/modules/gumgumBidAdapter.js +++ b/modules/gumgumBidAdapter.js @@ -273,6 +273,10 @@ function buildRequests (validBidRequests, bidderRequest) { data.iriscat = params.iriscat; } + if (params.irisid && typeof params.irisid === 'string') { + data.irisid = params.irisid; + } + if (params.zone || params.pubId) { params.zone ? (data.t = params.zone) : (data.pubId = params.pubId); diff --git a/test/spec/modules/gumgumBidAdapter_spec.js b/test/spec/modules/gumgumBidAdapter_spec.js index a2a1b733d3c..0d37c8b1d25 100644 --- a/test/spec/modules/gumgumBidAdapter_spec.js +++ b/test/spec/modules/gumgumBidAdapter_spec.js @@ -1,7 +1,8 @@ +import { BANNER, VIDEO } from 'src/mediaTypes.js'; + import { expect } from 'chai'; import { newBidder } from 'src/adapters/bidderFactory.js'; import { spec } from 'modules/gumgumBidAdapter.js'; -import { BANNER, VIDEO } from 'src/mediaTypes.js'; const ENDPOINT = 'https://g2.gumgum.com/hbid/imp'; const JCSI = { t: 0, rq: 8, pbv: '$prebid.version$' } @@ -158,6 +159,36 @@ describe('gumgumAdapter', function () { expect(bidRequest.data.t).to.equal(zoneParam.zone); }); + it('should set the iriscat param when found', function () { + const request = { ...bidRequests[0], params: { iriscat: 'abc123' } } + const bidRequest = spec.buildRequests([request])[0]; + expect(bidRequest.data).to.have.property('iriscat'); + }); + + it('should not set the iriscat param when not found', function () { + const request = { ...bidRequests[0] } + const bidRequest = spec.buildRequests([request])[0]; + expect(bidRequest.data).to.not.have.property('iriscat'); + }); + + it('should set the irisid param when found', function () { + const request = { ...bidRequests[0], params: { irisid: 'abc123' } } + const bidRequest = spec.buildRequests([request])[0]; + expect(bidRequest.data).to.have.property('irisid'); + }); + + it('should not set the irisid param when not found', function () { + const request = { ...bidRequests[0] } + const bidRequest = spec.buildRequests([request])[0]; + expect(bidRequest.data).to.not.have.property('irisid'); + }); + + it('should not set the irisid param when not of type string', function () { + const request = { ...bidRequests[0], params: { irisid: 123456 } } + const bidRequest = spec.buildRequests([request])[0]; + expect(bidRequest.data).to.not.have.property('irisid'); + }); + describe('product id', function () { it('should set the correct pi param if native param is found', function () { const request = { ...bidRequests[0], params: { ...zoneParam, native: 2 } };