From f90be539365ad0e44229ab52032d6c4ef366a57c Mon Sep 17 00:00:00 2001 From: Mikhail Dykun Date: Wed, 3 Feb 2021 15:58:24 +0200 Subject: [PATCH 01/14] Support floorCPM parameter, fix some minor bugs --- modules/adWMGBidAdapter.js | 4 ++-- modules/adWMGBidAdapter.md | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/adWMGBidAdapter.js b/modules/adWMGBidAdapter.js index 3a0a8a22274..955505ead85 100644 --- a/modules/adWMGBidAdapter.js +++ b/modules/adWMGBidAdapter.js @@ -113,11 +113,11 @@ export const spec = { return bidResponses; }, getUserSyncs: (syncOptions, serverResponses, gdprConsent, uspConsent) => { - if (gdprConsent) { + if (gdprConsent && !SYNC_ENDPOINT.includes('gdpr')) { SYNC_ENDPOINT = utils.tryAppendQueryString(SYNC_ENDPOINT, 'gdpr', (gdprConsent.gdprApplies ? 1 : 0)); } - if (gdprConsent && typeof gdprConsent.consentString === 'string') { + if (gdprConsent && typeof gdprConsent.consentString === 'string' && !SYNC_ENDPOINT.includes('gdpr_consent') ) { SYNC_ENDPOINT = utils.tryAppendQueryString(SYNC_ENDPOINT, 'gdpr_consent', gdprConsent.consentString); } diff --git a/modules/adWMGBidAdapter.md b/modules/adWMGBidAdapter.md index 8c277b803db..1b242a25b1d 100644 --- a/modules/adWMGBidAdapter.md +++ b/modules/adWMGBidAdapter.md @@ -12,10 +12,11 @@ Module that connects to adWMG demand sources to fetch bids. Supports 'banner' ad # Bid Parameters -| Key | Required | Example | Description | -| --- | -------- | ------- | ----------- | -| `publisherId` | yes | `'5cebea3c9eea646c7b623d5e'` | publisher ID from WMG Dashboard | -| `IABCategories` | no | `['IAB1', 'IAB5']` | IAB ad categories for adUnit | +| Key | Required | Example | Description | +| --------------- | -------- | -----------------------------| ------------------------------- | +| `publisherId` | yes | `'5cebea3c9eea646c7b623d5e'` | publisher ID from WMG Dashboard | +| `IABCategories` | no | `['IAB1', 'IAB5']` | IAB ad categories for adUnit | +| `floorCPM` | no | 0.5 | Floor price for adUnit | # Test Parameters From ccb1aabe9ef0433bd28e669570bcd1074fe9561c Mon Sep 17 00:00:00 2001 From: Mikhail Dykun Date: Wed, 3 Feb 2021 16:19:49 +0200 Subject: [PATCH 02/14] fix space-in-parens circleci error --- modules/adWMGBidAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/adWMGBidAdapter.js b/modules/adWMGBidAdapter.js index 955505ead85..8af1d5c62e4 100644 --- a/modules/adWMGBidAdapter.js +++ b/modules/adWMGBidAdapter.js @@ -117,7 +117,7 @@ export const spec = { SYNC_ENDPOINT = utils.tryAppendQueryString(SYNC_ENDPOINT, 'gdpr', (gdprConsent.gdprApplies ? 1 : 0)); } - if (gdprConsent && typeof gdprConsent.consentString === 'string' && !SYNC_ENDPOINT.includes('gdpr_consent') ) { + if (gdprConsent && typeof gdprConsent.consentString === 'string' && !SYNC_ENDPOINT.includes('gdpr_consent')) { SYNC_ENDPOINT = utils.tryAppendQueryString(SYNC_ENDPOINT, 'gdpr_consent', gdprConsent.consentString); } From 7239a4a0a2348d403ed67cefd062e1b194421706 Mon Sep 17 00:00:00 2001 From: Mikhail Dykun Date: Wed, 3 Feb 2021 16:29:08 +0200 Subject: [PATCH 03/14] example fix --- modules/adWMGBidAdapter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/adWMGBidAdapter.md b/modules/adWMGBidAdapter.md index 1b242a25b1d..c9a2461ef29 100644 --- a/modules/adWMGBidAdapter.md +++ b/modules/adWMGBidAdapter.md @@ -16,7 +16,7 @@ Module that connects to adWMG demand sources to fetch bids. Supports 'banner' ad | --------------- | -------- | -----------------------------| ------------------------------- | | `publisherId` | yes | `'5cebea3c9eea646c7b623d5e'` | publisher ID from WMG Dashboard | | `IABCategories` | no | `['IAB1', 'IAB5']` | IAB ad categories for adUnit | -| `floorCPM` | no | 0.5 | Floor price for adUnit | +| `floorCPM` | no | `0.5` | Floor price for adUnit | # Test Parameters From 3865b2aa538ff00623f386b36af511be8b58def8 Mon Sep 17 00:00:00 2001 From: Mikhail Dykun Date: Wed, 3 Feb 2021 17:21:39 +0200 Subject: [PATCH 04/14] clean usersync URL --- modules/adWMGBidAdapter.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/adWMGBidAdapter.js b/modules/adWMGBidAdapter.js index 8af1d5c62e4..8278ab0c40a 100644 --- a/modules/adWMGBidAdapter.js +++ b/modules/adWMGBidAdapter.js @@ -121,6 +121,10 @@ export const spec = { SYNC_ENDPOINT = utils.tryAppendQueryString(SYNC_ENDPOINT, 'gdpr_consent', gdprConsent.consentString); } + if (SYNC_ENDPOINT.slice(-1) === '&') { + SYNC_ENDPOINT = SYNC_ENDPOINT.slice(0, -1); + } + /* if (uspConsent) { SYNC_ENDPOINT = utils.tryAppendQueryString(SYNC_ENDPOINT, 'us_privacy', uspConsent); } */ From fbcf047cbf4c1269c513a4a84a39ef0cde2e323b Mon Sep 17 00:00:00 2001 From: Mikhail Dykun Date: Wed, 3 Feb 2021 17:23:21 +0200 Subject: [PATCH 05/14] spaces --- modules/adWMGBidAdapter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/adWMGBidAdapter.md b/modules/adWMGBidAdapter.md index c9a2461ef29..ec5541e6168 100644 --- a/modules/adWMGBidAdapter.md +++ b/modules/adWMGBidAdapter.md @@ -16,7 +16,7 @@ Module that connects to adWMG demand sources to fetch bids. Supports 'banner' ad | --------------- | -------- | -----------------------------| ------------------------------- | | `publisherId` | yes | `'5cebea3c9eea646c7b623d5e'` | publisher ID from WMG Dashboard | | `IABCategories` | no | `['IAB1', 'IAB5']` | IAB ad categories for adUnit | -| `floorCPM` | no | `0.5` | Floor price for adUnit | +| `floorCPM` | no | `0.5` | Floor price for adUnit | # Test Parameters From 1fafc823047ad1df25d8f21b05c5d9d4d73f77f3 Mon Sep 17 00:00:00 2001 From: Mikhail Dykun Date: Wed, 3 Feb 2021 17:26:19 +0200 Subject: [PATCH 06/14] spaces --- modules/adWMGBidAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/adWMGBidAdapter.js b/modules/adWMGBidAdapter.js index 8278ab0c40a..801752cf0f7 100644 --- a/modules/adWMGBidAdapter.js +++ b/modules/adWMGBidAdapter.js @@ -123,7 +123,7 @@ export const spec = { if (SYNC_ENDPOINT.slice(-1) === '&') { SYNC_ENDPOINT = SYNC_ENDPOINT.slice(0, -1); - } + } /* if (uspConsent) { SYNC_ENDPOINT = utils.tryAppendQueryString(SYNC_ENDPOINT, 'us_privacy', uspConsent); From 7dd4585d34ca36fce0eab7d12ecf66714d11e2d2 Mon Sep 17 00:00:00 2001 From: Mikhail Dykun Date: Thu, 4 Feb 2021 11:44:41 +0200 Subject: [PATCH 07/14] add new unit tests, compatibility with IE11 --- modules/adWMGBidAdapter.js | 4 +-- test/spec/modules/adWMGBidAdapter_spec.js | 42 +++++++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/modules/adWMGBidAdapter.js b/modules/adWMGBidAdapter.js index 801752cf0f7..87c40db51e6 100644 --- a/modules/adWMGBidAdapter.js +++ b/modules/adWMGBidAdapter.js @@ -113,11 +113,11 @@ export const spec = { return bidResponses; }, getUserSyncs: (syncOptions, serverResponses, gdprConsent, uspConsent) => { - if (gdprConsent && !SYNC_ENDPOINT.includes('gdpr')) { + if (gdprConsent && SYNC_ENDPOINT.indexOf('gdpr') === -1) { SYNC_ENDPOINT = utils.tryAppendQueryString(SYNC_ENDPOINT, 'gdpr', (gdprConsent.gdprApplies ? 1 : 0)); } - if (gdprConsent && typeof gdprConsent.consentString === 'string' && !SYNC_ENDPOINT.includes('gdpr_consent')) { + if (gdprConsent && typeof gdprConsent.consentString === 'string' && SYNC_ENDPOINT.indexOf('gdpr_consent') === -1) { SYNC_ENDPOINT = utils.tryAppendQueryString(SYNC_ENDPOINT, 'gdpr_consent', gdprConsent.consentString); } diff --git a/test/spec/modules/adWMGBidAdapter_spec.js b/test/spec/modules/adWMGBidAdapter_spec.js index 5c2364d454c..706a767f221 100644 --- a/test/spec/modules/adWMGBidAdapter_spec.js +++ b/test/spec/modules/adWMGBidAdapter_spec.js @@ -1,6 +1,7 @@ import { expect } from 'chai'; import { spec } from 'modules/adWMGBidAdapter.js'; import { config } from 'src/config.js'; +import * as utils from 'src/utils.js'; describe('adWMGBidAdapter', function () { describe('isBidRequestValid', function () { @@ -288,5 +289,46 @@ describe('adWMGBidAdapter', function () { expect(syncs[0].url).includes('gdpr=1'); expect(syncs[0].url).includes(`gdpr_consent=${gdprConsent.consentString}`); }); + + it('should not add GDPR consent params twice', function() { + const syncOptions = { + 'iframeEnabled': true, + 'pixelEnabled': true + }; + const gdprConsent = { + consentString: 'CO9rhBTO9rhBTAcABBENBCCsAP_AAH_AACiQHItf_X_fb3_j-_59_9t0eY1f9_7_v20zjgeds-8Nyd_X_L8X42M7vB36pq4KuR4Eu3LBIQdlHOHcTUmw6IkVqTPsbk2Mr7NKJ7PEinMbe2dYGH9_n9XTuZKY79_s___z__-__v__7_f_r-3_3_vp9V---3YHIgEmGpfARZiWOBJNGlUKIEIVxIdACACihGFomsICVwU7K4CP0EDABAagIwIgQYgoxZBAAAAAElEQEgB4IBEARAIAAQAqQEIACNAEFgBIGAQACgGhYARQBCBIQZHBUcpgQESLRQTyVgCUXexhhCGUUANAg4AA.YAAAAAAAAAAA', + vendorData: {}, + gdprApplies: true, + apiVersion: 2 + }; + const gdprConsent2 = { + consentString: 'CO9rhBTO9rhBTAcABBENBCCsAP_AAH_AACiQHItf_7_fb3_j-_59_9t0eY1f9_7_v20zjgeds-8Nyd_X_L8X42M7vB36pq4KuR4Eu3LBIQdlHOHcTUmw6IkVqTPsbk2Mr7NKJ7PEinMbe2dYGH9_n9XTuZKY79_s___z__-__v__7_f_r-3_3_vp9V---3YHIgEmGpfARZiWOBJNGlUKIEIVxIdACACihGFomsICVwU7K4CP0EDABAagIwIgQYgoxZBAAAAAElEQEgB4IBEARAIAAQAqQEIACNAEFgBIGAQACgGhYARQBCBIQZHBUcpgQESLRQTyVgCUXexhhCGUUANAg4AA.YAAAAAAAAAAA', + vendorData: {}, + gdprApplies: true, + apiVersion: 2 + }; + const serverResponse = {}; + let syncs = spec.getUserSyncs(syncOptions, serverResponse, gdprConsent); + syncs = spec.getUserSyncs(syncOptions, serverResponse, gdprConsent2); + utils.logInfo(syncs); + expect(syncs[0].url.match(/gdpr/g).length).to.equal(2); // gdpr + gdpr_consent + expect(syncs[0].url.match(/gdpr_consent/g).length).to.equal(1); + }); + + it('should delete \'&\' symbol at the end of usersync URL', function() { + const syncOptions = { + 'iframeEnabled': true, + 'pixelEnabled': true + }; + const gdprConsent = { + consentString: 'CO9rhBTO9rhBTAcABBENBCCsAP_AAH_AACiQHItf_X_fb3_j-_59_9t0eY1f9_7_v20zjgeds-8Nyd_X_L8X42M7vB36pq4KuR4Eu3LBIQdlHOHcTUmw6IkVqTPsbk2Mr7NKJ7PEinMbe2dYGH9_n9XTuZKY79_s___z__-__v__7_f_r-3_3_vp9V---3YHIgEmGpfARZiWOBJNGlUKIEIVxIdACACihGFomsICVwU7K4CP0EDABAagIwIgQYgoxZBAAAAAElEQEgB4IBEARAIAAQAqQEIACNAEFgBIGAQACgGhYARQBCBIQZHBUcpgQESLRQTyVgCUXexhhCGUUANAg4AA.YAAAAAAAAAAA', + vendorData: {}, + gdprApplies: true, + apiVersion: 2 + }; + const serverResponse = {}; + let syncs = spec.getUserSyncs(syncOptions, serverResponse, gdprConsent); + expect(syncs[0].url.slice(-1)).to.not.equal('&'); + }); }); }); From 5b2c84fe1ae088d115b34c28c61f3015800c1d67 Mon Sep 17 00:00:00 2001 From: Mikhail Dykun Date: Thu, 4 Feb 2021 11:54:32 +0200 Subject: [PATCH 08/14] remove logInfo --- test/spec/modules/adWMGBidAdapter_spec.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/spec/modules/adWMGBidAdapter_spec.js b/test/spec/modules/adWMGBidAdapter_spec.js index 706a767f221..1f881897fd8 100644 --- a/test/spec/modules/adWMGBidAdapter_spec.js +++ b/test/spec/modules/adWMGBidAdapter_spec.js @@ -1,7 +1,6 @@ import { expect } from 'chai'; import { spec } from 'modules/adWMGBidAdapter.js'; import { config } from 'src/config.js'; -import * as utils from 'src/utils.js'; describe('adWMGBidAdapter', function () { describe('isBidRequestValid', function () { @@ -310,7 +309,6 @@ describe('adWMGBidAdapter', function () { const serverResponse = {}; let syncs = spec.getUserSyncs(syncOptions, serverResponse, gdprConsent); syncs = spec.getUserSyncs(syncOptions, serverResponse, gdprConsent2); - utils.logInfo(syncs); expect(syncs[0].url.match(/gdpr/g).length).to.equal(2); // gdpr + gdpr_consent expect(syncs[0].url.match(/gdpr_consent/g).length).to.equal(1); }); From 06f286802ee6c692415925634464f3c33394c508 Mon Sep 17 00:00:00 2001 From: Mikhail Dykun Date: Tue, 9 Feb 2021 15:09:41 +0200 Subject: [PATCH 09/14] Check for floorCPM value --- modules/adWMGBidAdapter.js | 137 +++++++++++++++++++++---------------- 1 file changed, 79 insertions(+), 58 deletions(-) diff --git a/modules/adWMGBidAdapter.js b/modules/adWMGBidAdapter.js index 87c40db51e6..3adf8eb89ba 100644 --- a/modules/adWMGBidAdapter.js +++ b/modules/adWMGBidAdapter.js @@ -1,9 +1,15 @@ 'use strict'; import * as utils from '../src/utils.js'; -import { registerBidder } from '../src/adapters/bidderFactory.js'; -import { config } from '../src/config.js'; -import { BANNER } from '../src/mediaTypes.js'; +import { + registerBidder +} from '../src/adapters/bidderFactory.js'; +import { + config +} from '../src/config.js'; +import { + BANNER +} from '../src/mediaTypes.js'; const BIDDER_CODE = 'adWMG'; const ENDPOINT = 'https://rtb.adwmg.com/prebid'; @@ -34,6 +40,13 @@ export const spec = { const additional = spec.parseUserAgent(ua); return validBidRequests.map(bidRequest => { + + const checkFloorValue = (value) => { + if (isNaN(parseFloat(value))) { + return 0; + } else return parseFloat(value); + } + const adUnit = { code: bidRequest.adUnitCode, bids: { @@ -43,6 +56,10 @@ export const spec = { mediaTypes: bidRequest.mediaTypes }; + if (adUnit.bids.params.floorCPM) { + adUnit.bids.params.floorCPM = checkFloorValue(adUnit.bids.params.floorCPM); + } + if (bidRequest.hasOwnProperty('sizes') && bidRequest.sizes.length > 0) { adUnit.sizes = bidRequest.sizes; } @@ -159,60 +176,60 @@ export const spec = { options: [], header: [navigator.platform, ua, navigator.appVersion, navigator.vendor, window.opera], dataos: [{ - name: 'Windows Phone', - value: 'Windows Phone', - version: 'OS' - }, - { - name: 'Windows', - value: 'Win', - version: 'NT' - }, - { - name: 'iOS', - value: 'iPhone', - version: 'OS' - }, - { - name: 'iOS', - value: 'iPad', - version: 'OS' - }, - { - name: 'Kindle', - value: 'Silk', - version: 'Silk' - }, - { - name: 'Android', - value: 'Android', - version: 'Android' - }, - { - name: 'PlayBook', - value: 'PlayBook', - version: 'OS' - }, - { - name: 'BlackBerry', - value: 'BlackBerry', - version: '/' - }, - { - name: 'Macintosh', - value: 'Mac', - version: 'OS X' - }, - { - name: 'Linux', - value: 'Linux', - version: 'rv' - }, - { - name: 'Palm', - value: 'Palm', - version: 'PalmOS' - } + name: 'Windows Phone', + value: 'Windows Phone', + version: 'OS' + }, + { + name: 'Windows', + value: 'Win', + version: 'NT' + }, + { + name: 'iOS', + value: 'iPhone', + version: 'OS' + }, + { + name: 'iOS', + value: 'iPad', + version: 'OS' + }, + { + name: 'Kindle', + value: 'Silk', + version: 'Silk' + }, + { + name: 'Android', + value: 'Android', + version: 'Android' + }, + { + name: 'PlayBook', + value: 'PlayBook', + version: 'OS' + }, + { + name: 'BlackBerry', + value: 'BlackBerry', + version: '/' + }, + { + name: 'Macintosh', + value: 'Mac', + version: 'OS X' + }, + { + name: 'Linux', + value: 'Linux', + version: 'rv' + }, + { + name: 'Palm', + value: 'Palm', + version: 'PalmOS' + } ], init: function () { var agent = this.header.join(' '); @@ -295,7 +312,11 @@ export const spec = { } } - return {devicetype: detectDevice(), os: detectOs().os, osv: detectOs().osv} + return { + devicetype: detectDevice(), + os: detectOs().os, + osv: detectOs().osv + } } } registerBidder(spec); From 2212ed339901fe5e610a0cd47a6f63ea70b823f9 Mon Sep 17 00:00:00 2001 From: Mikhail Dykun Date: Tue, 9 Feb 2021 16:10:08 +0200 Subject: [PATCH 10/14] Check params before sending --- modules/adWMGBidAdapter.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/adWMGBidAdapter.js b/modules/adWMGBidAdapter.js index 3adf8eb89ba..adcd3e5702d 100644 --- a/modules/adWMGBidAdapter.js +++ b/modules/adWMGBidAdapter.js @@ -51,15 +51,15 @@ export const spec = { code: bidRequest.adUnitCode, bids: { bidder: bidRequest.bidder, - params: bidRequest.params + params: { + publisherId: bidRequest.params.publisherId, + IABCategories: bidRequest.params.IABCategories || [], + floorCPM: bidRequest.params.floorCPM ? checkFloorValue(bidRequest.params.floorCPM) : 0 + } }, mediaTypes: bidRequest.mediaTypes }; - if (adUnit.bids.params.floorCPM) { - adUnit.bids.params.floorCPM = checkFloorValue(adUnit.bids.params.floorCPM); - } - if (bidRequest.hasOwnProperty('sizes') && bidRequest.sizes.length > 0) { adUnit.sizes = bidRequest.sizes; } From 693a319e3db9093e2585e196ee11b858605ae467 Mon Sep 17 00:00:00 2001 From: Mikhail Dykun Date: Fri, 26 Mar 2021 12:41:43 +0200 Subject: [PATCH 11/14] New endpoints --- modules/adWMGBidAdapter.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/adWMGBidAdapter.js b/modules/adWMGBidAdapter.js index adcd3e5702d..a06ff6966a4 100644 --- a/modules/adWMGBidAdapter.js +++ b/modules/adWMGBidAdapter.js @@ -12,8 +12,8 @@ import { } from '../src/mediaTypes.js'; const BIDDER_CODE = 'adWMG'; -const ENDPOINT = 'https://rtb.adwmg.com/prebid'; -let SYNC_ENDPOINT = 'https://rtb.adwmg.com/cphb.html?'; +const ENDPOINT = 'https://hb.adwmg.com/hb'; +let SYNC_ENDPOINT = 'https://hb.adwmg.com/chcp.html?'; export const spec = { code: BIDDER_CODE, @@ -318,5 +318,5 @@ export const spec = { osv: detectOs().osv } } -} +}; registerBidder(spec); From f8543d7536386d681d81ab42eb6d8227cfa16595 Mon Sep 17 00:00:00 2001 From: Mikhail Dykun Date: Fri, 26 Mar 2021 12:51:07 +0200 Subject: [PATCH 12/14] code format --- modules/adWMGBidAdapter.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/modules/adWMGBidAdapter.js b/modules/adWMGBidAdapter.js index a06ff6966a4..6611e56bf2d 100644 --- a/modules/adWMGBidAdapter.js +++ b/modules/adWMGBidAdapter.js @@ -1,15 +1,9 @@ 'use strict'; import * as utils from '../src/utils.js'; -import { - registerBidder -} from '../src/adapters/bidderFactory.js'; -import { - config -} from '../src/config.js'; -import { - BANNER -} from '../src/mediaTypes.js'; +import { registerBidder } from '../src/adapters/bidderFactory.js'; +import { config } from '../src/config.js'; +import { BANNER } from '../src/mediaTypes.js'; const BIDDER_CODE = 'adWMG'; const ENDPOINT = 'https://hb.adwmg.com/hb'; From 01767dc0749b199202d46d43fa1eb7a9c3008e2d Mon Sep 17 00:00:00 2001 From: Mikhail Dykun Date: Fri, 26 Mar 2021 17:23:42 +0200 Subject: [PATCH 13/14] new endpoint for cookie sync --- modules/adWMGBidAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/adWMGBidAdapter.js b/modules/adWMGBidAdapter.js index 6611e56bf2d..d549a039e1f 100644 --- a/modules/adWMGBidAdapter.js +++ b/modules/adWMGBidAdapter.js @@ -7,7 +7,7 @@ import { BANNER } from '../src/mediaTypes.js'; const BIDDER_CODE = 'adWMG'; const ENDPOINT = 'https://hb.adwmg.com/hb'; -let SYNC_ENDPOINT = 'https://hb.adwmg.com/chcp.html?'; +let SYNC_ENDPOINT = 'https://hb.adwmg.com/cphb.html?'; export const spec = { code: BIDDER_CODE, From 1dd39628c711854317da37b4f8368c49f2113c7b Mon Sep 17 00:00:00 2001 From: Mikhail Dykun Date: Wed, 7 Apr 2021 22:26:40 +0300 Subject: [PATCH 14/14] update tests --- modules/adWMGBidAdapter.js | 109 +++++++++++----------- test/spec/modules/adWMGBidAdapter_spec.js | 8 +- 2 files changed, 58 insertions(+), 59 deletions(-) diff --git a/modules/adWMGBidAdapter.js b/modules/adWMGBidAdapter.js index d549a039e1f..689e7d02124 100644 --- a/modules/adWMGBidAdapter.js +++ b/modules/adWMGBidAdapter.js @@ -34,7 +34,6 @@ export const spec = { const additional = spec.parseUserAgent(ua); return validBidRequests.map(bidRequest => { - const checkFloorValue = (value) => { if (isNaN(parseFloat(value))) { return 0; @@ -170,60 +169,60 @@ export const spec = { options: [], header: [navigator.platform, ua, navigator.appVersion, navigator.vendor, window.opera], dataos: [{ - name: 'Windows Phone', - value: 'Windows Phone', - version: 'OS' - }, - { - name: 'Windows', - value: 'Win', - version: 'NT' - }, - { - name: 'iOS', - value: 'iPhone', - version: 'OS' - }, - { - name: 'iOS', - value: 'iPad', - version: 'OS' - }, - { - name: 'Kindle', - value: 'Silk', - version: 'Silk' - }, - { - name: 'Android', - value: 'Android', - version: 'Android' - }, - { - name: 'PlayBook', - value: 'PlayBook', - version: 'OS' - }, - { - name: 'BlackBerry', - value: 'BlackBerry', - version: '/' - }, - { - name: 'Macintosh', - value: 'Mac', - version: 'OS X' - }, - { - name: 'Linux', - value: 'Linux', - version: 'rv' - }, - { - name: 'Palm', - value: 'Palm', - version: 'PalmOS' - } + name: 'Windows Phone', + value: 'Windows Phone', + version: 'OS' + }, + { + name: 'Windows', + value: 'Win', + version: 'NT' + }, + { + name: 'iOS', + value: 'iPhone', + version: 'OS' + }, + { + name: 'iOS', + value: 'iPad', + version: 'OS' + }, + { + name: 'Kindle', + value: 'Silk', + version: 'Silk' + }, + { + name: 'Android', + value: 'Android', + version: 'Android' + }, + { + name: 'PlayBook', + value: 'PlayBook', + version: 'OS' + }, + { + name: 'BlackBerry', + value: 'BlackBerry', + version: '/' + }, + { + name: 'Macintosh', + value: 'Mac', + version: 'OS X' + }, + { + name: 'Linux', + value: 'Linux', + version: 'rv' + }, + { + name: 'Palm', + value: 'Palm', + version: 'PalmOS' + } ], init: function () { var agent = this.header.join(' '); diff --git a/test/spec/modules/adWMGBidAdapter_spec.js b/test/spec/modules/adWMGBidAdapter_spec.js index 1f881897fd8..8b927ace84c 100644 --- a/test/spec/modules/adWMGBidAdapter_spec.js +++ b/test/spec/modules/adWMGBidAdapter_spec.js @@ -168,8 +168,8 @@ describe('adWMGBidAdapter', function () { it('should have an url that match the default endpoint', function() { let requests = spec.buildRequests(bidRequests, bidderRequest); - expect(requests[0].url).to.equal('https://rtb.adwmg.com/prebid'); - expect(requests[1].url).to.equal('https://rtb.adwmg.com/prebid'); + expect(requests[0].url).to.equal('https://hb.adwmg.com/hb'); + expect(requests[1].url).to.equal('https://hb.adwmg.com/hb'); }); it('should contain GDPR consent data if GDPR set', function() { @@ -258,7 +258,7 @@ describe('adWMGBidAdapter', function () { let syncs = spec.getUserSyncs(syncOptions); expect(syncs[0].type).to.equal('iframe'); - expect(syncs[0].url).includes('https://rtb.adwmg.com/cphb.html?'); + expect(syncs[0].url).includes('https://hb.adwmg.com/cphb.html?'); }); it('should register iframe sync when iframe and image are enabled', function () { @@ -269,7 +269,7 @@ describe('adWMGBidAdapter', function () { let syncs = spec.getUserSyncs(syncOptions); expect(syncs[0].type).to.equal('iframe'); - expect(syncs[0].url).includes('https://rtb.adwmg.com/cphb.html?'); + expect(syncs[0].url).includes('https://hb.adwmg.com/cphb.html?'); }); it('should send GDPR consent if enabled', function() {