diff --git a/modules/dacIdSystem.md b/modules/dacIdSystem.md index b422d0a536d..0239b4557e9 100644 --- a/modules/dacIdSystem.md +++ b/modules/dacIdSystem.md @@ -1,11 +1,11 @@ -## DAC User ID Submodule +## AudienceOne User ID Submodule -DAC ID, provided by [D.A.Consortium Inc.](https://www.dac.co.jp/), is ID for ad targeting by using 1st party cookie. +AudienceOne ID, provided by [D.A.Consortium Inc.](https://www.dac.co.jp/), is ID for ad targeting by using 1st party cookie. Please contact D.A.Consortium Inc. before using this ID. -## Building Prebid with DAC ID Support +## Building Prebid with AudienceOne ID Support -First, make sure to add the DAC ID submodule to your Prebid.js package with: +First, make sure to add the AudienceOne ID submodule to your Prebid.js package with: ``` gulp build --modules=dacIdSystem diff --git a/modules/zeta_global_sspBidAdapter.js b/modules/zeta_global_sspBidAdapter.js index e5868e4dbce..7f280010e4e 100644 --- a/modules/zeta_global_sspBidAdapter.js +++ b/modules/zeta_global_sspBidAdapter.js @@ -99,7 +99,7 @@ export const spec = { user: params.user ? params.user : {}, app: params.app ? params.app : {}, ext: { - tags: params.tags ? params.tags : {}, + tags: {...params.tags, shortname: params.shortname}, sid: params.sid ? params.sid : undefined } }; diff --git a/package-lock.json b/package-lock.json index cc4eb489851..ce56a7d2e84 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "prebid.js", - "version": "6.26.0-pre", + "version": "6.27.0-pre", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index 1dd7e1bc914..27c874c039a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prebid.js", - "version": "6.26.0-pre", + "version": "6.27.0-pre", "description": "Header Bidding Management Library", "main": "src/prebid.js", "scripts": { diff --git a/test/spec/modules/fintezaAnalyticsAdapter_spec.js b/test/spec/modules/fintezaAnalyticsAdapter_spec.js index 407ceb305a2..76f77505105 100644 --- a/test/spec/modules/fintezaAnalyticsAdapter_spec.js +++ b/test/spec/modules/fintezaAnalyticsAdapter_spec.js @@ -51,7 +51,7 @@ describe('finteza analytics adapter', function () { describe('track', () => { describe('bid request', () => { - it('builds and sends data', function () { + it('builds and sends request data', function () { const bidderCode = 'Bidder789'; const pauctionId = '5018eb39-f900-4370-b71e-3bb5b48d324f'; @@ -95,7 +95,7 @@ describe('finteza analytics adapter', function () { }); describe('bid response', () => { - it('builds and sends data', function () { + it('builds and sends response data', function () { const bidderCode = 'Bidder789'; const pauctionId = '5018eb39-f900-4370-b71e-3bb5b48d324f'; @@ -154,7 +154,7 @@ describe('finteza analytics adapter', function () { }); describe('bid won', () => { - it('builds and sends data', function () { + it('builds and sends bid won data', function () { const bidderCode = 'Bidder789'; const pauctionId = '5018eb39-f900-4370-b71e-3bb5b48d324f'; @@ -194,7 +194,7 @@ describe('finteza analytics adapter', function () { }); describe('bid timeout', () => { - it('builds and sends data', function () { + it('builds and sends timeout data', function () { const bidderCode = 'biDDer789'; const pauctionId = '5018eb39-f900-4370-b71e-3bb5b48d324f'; diff --git a/test/spec/modules/medianetRtdProvider_spec.js b/test/spec/modules/medianetRtdProvider_spec.js deleted file mode 100644 index 7d73ecd5d44..00000000000 --- a/test/spec/modules/medianetRtdProvider_spec.js +++ /dev/null @@ -1,146 +0,0 @@ -import * as medianetRTD from '../../../modules/medianetRtdProvider.js'; -import * as sinon from 'sinon'; -import { assert } from 'chai'; - -let sandbox; -let setDataSpy; -let getTargetingDataSpy; -let onPrebidRequestBidSpy; - -const conf = { - dataProviders: [{ - 'name': 'medianet', - 'params': { - 'cid': 'customer_id', - } - }] -}; - -describe('medianet realtime module', function () { - beforeEach(function () { - sandbox = sinon.sandbox.create(); - window.mnjs = window.mnjs || {}; - window.mnjs.que = window.mnjs.que || []; - window.mnjs.setData = setDataSpy = sandbox.spy(); - window.mnjs.getTargetingData = getTargetingDataSpy = sandbox.spy(); - window.mnjs.onPrebidRequestBid = onPrebidRequestBidSpy = sandbox.spy(); - }); - - afterEach(function () { - sandbox.restore(); - window.mnjs = {}; - }); - - it('init should return false when customer id is passed', function () { - assert.equal(medianetRTD.medianetRtdModule.init({}), false); - }); - - it('init should return true when customer id is passed', function () { - assert.equal(medianetRTD.medianetRtdModule.init(conf.dataProviders[0]), true); - }); - - it('init should pass config to js when loaded', function () { - medianetRTD.medianetRtdModule.init(conf.dataProviders[0]); - - const command = window.mnjs.que.pop(); - assert.isFunction(command); - command(); - - assert.equal(setDataSpy.called, true); - assert.equal(setDataSpy.args[0][0].name, 'initIRefresh'); - }); - - it('auctionInit should pass information to js when loaded', function () { - const auctionObject = {adUnits: []}; - medianetRTD.medianetRtdModule.onAuctionInitEvent(auctionObject); - - const command = window.mnjs.que.pop(); - assert.isFunction(command); - command(); - - assert.equal(setDataSpy.called, true); - assert.equal(setDataSpy.args[0][0].name, 'auctionInit'); - assert.deepEqual(setDataSpy.args[0][0].data, {auction: auctionObject}); - }); - - describe('getTargeting should work correctly', function () { - it('should return empty if not loaded', function () { - window.mnjs.loaded = false; - assert.deepEqual(medianetRTD.medianetRtdModule.getTargetingData([]), {}); - }); - - it('should return ad unit codes when ad units are present', function () { - const adUnitCodes = ['code1', 'code2']; - assert.deepEqual(medianetRTD.medianetRtdModule.getTargetingData(adUnitCodes), { - code1: {'mnadc': 'code1'}, - code2: {'mnadc': 'code2'}, - }); - }); - - it('should call mnjs.getTargetingData if loaded', function () { - window.mnjs.loaded = true; - medianetRTD.medianetRtdModule.getTargetingData([]); - assert.equal(getTargetingDataSpy.called, true); - }); - }); - - describe('getBidRequestData should work correctly', function () { - it('callback should be called when we are not interested in request', function () { - const requestBidsProps = { - adUnits: [{ - code: 'code1', bids: [], - }], - adUnitCodes: ['code1'], - }; - const callbackSpy = sandbox.spy(); - medianetRTD.medianetRtdModule.getBidRequestData(requestBidsProps, callbackSpy, conf.dataProviders[0], {}); - - const command = window.mnjs.que.pop(); - assert.isFunction(command); - command(); - - assert.equal(onPrebidRequestBidSpy.called, true, 'onPrebidRequest should always be called'); - assert.equal(callbackSpy.called, true, 'when onPrebidRequest returns nothing callback should be called immediately'); - }); - - it('we should wait for callback till onComplete', function () { - const requestBidsProps = { - adUnits: [{ - code: 'code1', bids: [], - }], - adUnitCodes: ['code1'], - }; - - const refreshInformation = { - mnrf: '1', - mnrfc: 2, - }; - - const callbackSpy = sandbox.spy(); - const onCompleteSpy = sandbox.spy(); - window.mnjs.onPrebidRequestBid = onPrebidRequestBidSpy = () => { - onPrebidRequestBidSpy.called = true; - return {onComplete: onCompleteSpy}; - }; - medianetRTD.medianetRtdModule.getBidRequestData(requestBidsProps, callbackSpy, conf.dataProviders[0], {}); - - const command = window.mnjs.que.pop(); - assert.isFunction(command); - command(); - - assert.equal(callbackSpy.called, false, 'callback should not be called, as we are returning a request from onPrebidRequestBid'); - assert.equal(onPrebidRequestBidSpy.called, true, 'onPrebidRequestBid should be called once'); - assert.equal(onCompleteSpy.called, true, 'onComplete should be passed callback'); - assert.isFunction(onCompleteSpy.args[0][0], 'onCompleteSpy first argument error callback should be a function'); - assert.isFunction(onCompleteSpy.args[0][1], 'onCompleteSpy second argument success callback should be a function'); - onCompleteSpy.args[0][0](); - assert.equal(callbackSpy.callCount, 1, 'callback should be called when error callback is triggered'); - onCompleteSpy.args[0][1]({}, { - 'code1': {ext: {refresh: refreshInformation}} - }); - assert.equal(callbackSpy.callCount, 2, 'callback should be called when success callback is triggered'); - assert.isObject(requestBidsProps.adUnits[0].ortb2Imp, 'ORTB object should be set'); - assert.deepEqual(requestBidsProps.adUnits[0].ortb2Imp.ext.refresh, refreshInformation, 'ORTB should have refresh information should be set'); - }); - }); -}); diff --git a/test/spec/modules/zeta_global_sspBidAdapter_spec.js b/test/spec/modules/zeta_global_sspBidAdapter_spec.js index 20113a63994..f6faa67f6b8 100644 --- a/test/spec/modules/zeta_global_sspBidAdapter_spec.js +++ b/test/spec/modules/zeta_global_sspBidAdapter_spec.js @@ -25,6 +25,25 @@ describe('Zeta Ssp Bid Adapter', function () { } ]; + const params = { + user: { + uid: 222, + buyeruid: 333 + }, + tags: { + someTag: 444, + }, + sid: 'publisherId', + shortname: 'test_shortname', + site: { + page: 'testPage' + }, + app: { + bundle: 'testBundle' + }, + test: 1 + }; + const bannerRequest = [{ bidId: 12345, auctionId: 67890, @@ -41,18 +60,7 @@ describe('Zeta Ssp Bid Adapter', function () { consentString: 'consentString' }, uspConsent: 'someCCPAString', - params: { - placement: 111, - user: { - uid: 222, - buyeruid: 333 - }, - tags: { - someTag: 444, - sid: 'publisherId' - }, - test: 1 - }, + params: params, userIdAsEids: eids }]; @@ -72,18 +80,7 @@ describe('Zeta Ssp Bid Adapter', function () { refererInfo: { referer: 'http://www.zetaglobal.com/page?param=video' }, - params: { - placement: 111, - user: { - uid: 222, - buyeruid: 333 - }, - tags: { - someTag: 444, - sid: 'publisherId' - }, - test: 1 - }, + params: params }]; it('Test the bid validation function', function () { @@ -269,4 +266,20 @@ describe('Zeta Ssp Bid Adapter', function () { expect(payload.imp[0].banner).to.be.undefined; }); + + it('Test required params in banner request', function () { + const request = spec.buildRequests(bannerRequest, bannerRequest[0]); + const payload = JSON.parse(request.data); + expect(payload.ext.sid).to.eql('publisherId'); + expect(payload.ext.tags.someTag).to.eql(444); + expect(payload.ext.tags.shortname).to.eql('test_shortname'); + }); + + it('Test required params in video request', function () { + const request = spec.buildRequests(videoRequest, videoRequest[0]); + const payload = JSON.parse(request.data); + expect(payload.ext.sid).to.eql('publisherId'); + expect(payload.ext.tags.someTag).to.eql(444); + expect(payload.ext.tags.shortname).to.eql('test_shortname'); + }); });