From 92998bf66c1fc9c1c13f58511da228041a2a7ea5 Mon Sep 17 00:00:00 2001 From: Nicolas Lopez Date: Fri, 16 Feb 2018 15:32:19 +0100 Subject: [PATCH 1/8] New adapter madvertise --- modules/madvertiseBidAdapter.js | 131 +++++++++++++++ modules/madvertiseBidAdapter.md | 39 +++++ .../spec/modules/madvertiseBidAdapter_spec.js | 158 ++++++++++++++++++ 3 files changed, 328 insertions(+) create mode 100644 modules/madvertiseBidAdapter.js create mode 100644 modules/madvertiseBidAdapter.md create mode 100644 test/spec/modules/madvertiseBidAdapter_spec.js diff --git a/modules/madvertiseBidAdapter.js b/modules/madvertiseBidAdapter.js new file mode 100644 index 00000000000..5712153b7b2 --- /dev/null +++ b/modules/madvertiseBidAdapter.js @@ -0,0 +1,131 @@ +import * as utils from 'src/utils'; +import {registerBidder} from 'src/adapters/bidderFactory'; + +// use protocol relative urls for http or https +const MADVERTISE_ENDPOINT = 'https://mobile.mng-ads.com/'; + +export const spec = { + code: 'madvertise', + aliases: ['madvertise'], + /** + * @param {object} bid + * @return boolean + */ + isBidRequestValid: function (bid) { + if (typeof bid.params !== 'object') { + return false; + } + if (!Array.isArray(bid.sizes) || bid.sizes.length == 0) { + return false; + } else { + var sizes = []; + for (var i = 0; i < bid.sizes.length; i++) { + if (Array.isArray(bid.sizes[i]) && bid.sizes[i].length == 2) { + sizes.push(bid.sizes[i]); + } + } + if (sizes.length == 0) { + return false; + } + } + + if (typeof bid.params.floor == 'undefined' || parseFloat(bid.params.floor) < 0.01) { + bid.params.floor = 0.01; + } + + return typeof bid.params.s != 'undefined'; + }, + /** + * @param {BidRequest[]} bidRequests + * @return ServerRequest[] + */ + buildRequests: function (bidRequests) { + return bidRequests.map(bidRequest => { + bidRequest.startTime = new Date().getTime(); + + // non-video request builder + var src = '?rt=bid_request&v=1.0'; + + for (var i = 0; i < bidRequest.sizes.length; i++) { + if (Array.isArray(bidRequest.sizes[i]) && bidRequest.sizes[i].length == 2) { + src = src + '&sizes[' + i + ']=' + bidRequest.sizes[i][0] + 'x' + bidRequest.sizes[i][1]; + } + } + + utils._each(bidRequest.params, (item, key) => src = src + '&' + key + '=' + item); + + if (typeof bidRequest.params.u == 'undefined') { + src = src + '&u=' + navigator.userAgent; + } + + src = src + _getSeenAd(); + + return { + method: 'GET', + url: MADVERTISE_ENDPOINT + src, + options: {withCredentials: false}, + bidId: bidRequest.bidId + }; + }); + }, + /** + * @param {*} responseObj + * @param {BidRequest} bidRequest + * @return {Bid[]} An array of bids which + */ + interpretResponse: function (responseObj, bidRequest) { + responseObj = responseObj.body; + // check overall response + if (responseObj == null || typeof responseObj !== 'object' || !responseObj.hasOwnProperty('ad')) { + return []; + } + + _setSeenAd(responseObj.creativeId); + + let bid = { + requestId: bidRequest.bidId, + cpm: responseObj.cpm, + width: responseObj.Width, + height: responseObj.height, + ad: responseObj.ad, + ttl: responseObj.ttl, + creativeId: responseObj.creativeId, + netRevenue: responseObj.netRevenue, + currency: responseObj.currency, + dealId: responseObj.dealId + }; + return [bid]; + }, + getUserSyncs: function (syncOptions) { + } +}; + +function _getSeenAd() { + var cookies = document.cookie.split(';'); + var src = ''; + for (var i = 0; i < cookies.length; i++) { + var cookie = cookies[i].trim(); + if (cookie.match(/seenad\[\d+\]=\d+/)) { + src += '&' + cookie; + } + } + return src; +} + +function _setSeenAd(adid) { + var dateNow = new Date(); + dateNow.setTime(dateNow.getTime() + (2 * 24 * 60 * 60 * 1000)); + var expires = 'expires=' + dateNow.toUTCString(); + var valuecookie = 'seenad[' + adid + ']=' + (Date.now() / 1000 | 0) + ';'; + var domain, domainParts, host; + host = location.host; + if (host.split('.').length === 1) { + document.cookie = valuecookie + expires + '; path=/'; + } else { + domainParts = host.split('.'); + domainParts.shift(); + domain = '.' + domainParts.join('.'); + document.cookie = valuecookie + expires + '; path=/; domain=' + domain; + } +} +registerBidder(spec); diff --git a/modules/madvertiseBidAdapter.md b/modules/madvertiseBidAdapter.md new file mode 100644 index 00000000000..4576e955cbd --- /dev/null +++ b/modules/madvertiseBidAdapter.md @@ -0,0 +1,39 @@ +# Overview + +``` +Module Name: Madvertise Bid Adapter +Module Type: Bidder Adapter +Maintainer: support@madvertise.com +``` + +# Description + +Connect to Madvertise's exchange for bids. + +The Madvertise adapter requires setup and approval from the +Madvertise team. Please reach out to your account team or +support@madvertise.com for more information. + +# Test Parameters +``` + var adUnits = [ + { + code: 'test-div', + mediaTypes: { + banner: { + sizes: [ + [320, 50] + ] + } + }, + bids: [ + { + bidder: "madvertise", + params: { + s: "/4543756/prebidadaptor/madvertiseHB" + } + } + ] + } + ]; +``` diff --git a/test/spec/modules/madvertiseBidAdapter_spec.js b/test/spec/modules/madvertiseBidAdapter_spec.js new file mode 100644 index 00000000000..81a62ab81ef --- /dev/null +++ b/test/spec/modules/madvertiseBidAdapter_spec.js @@ -0,0 +1,158 @@ +import {expect} from 'chai'; +import {spec} from 'modules/madvertiseBidAdapter'; + +describe('madvertise adapater', () => { + describe('Test validate req', () => { + it('should accept minimum valid bid', () => { + let bid = { + bidder: 'madvertise', + sizes: [[728, 90]], + params: { + s: 'test' + } + }; + const isValid = spec.isBidRequestValid(bid); + + expect(isValid).to.equal(true); + }); + it('should reject no sizes', () => { + let bid = { + bidder: 'madvertise', + params: { + s: 'test' + } + }; + const isValid = spec.isBidRequestValid(bid); + + expect(isValid).to.equal(false); + }); + it('should reject empty sizes', () => { + let bid = { + bidder: 'madvertise', + sizes: [], + params: { + s: 'test' + } + }; + const isValid = spec.isBidRequestValid(bid); + + expect(isValid).to.equal(false); + }); + it('should reject wrong format sizes', () => { + let bid = { + bidder: 'madvertise', + sizes: [['728x90']], + params: { + s: 'test' + } + }; + const isValid = spec.isBidRequestValid(bid); + + expect(isValid).to.equal(false); + }); + it('should reject no params', () => { + let bid = { + bidder: 'madvertise', + sizes: [[728, 90]] + }; + const isValid = spec.isBidRequestValid(bid); + + expect(isValid).to.equal(false); + }); + it('should reject missing s', () => { + let bid = { + bidder: 'madvertise', + params: {} + }; + const isValid = spec.isBidRequestValid(bid); + + expect(isValid).to.equal(false); + }); + }); + + describe('Test build request', () => { + it('minimum request', () => { + let bid = [{ + bidder: 'madvertise', + sizes: [[728, 90]], + bidId: '51ef8751f9aead', + adUnitCode: 'div-gpt-ad-1460505748561-0', + transactionId: 'd7b773de-ceaa-484d-89ca-d9f51b8d61ec', + auctionId: '18fd8b8b0bd757', + bidderRequestId: '418b37f85e772c', + params: { + s: 'test', + } + }]; + const req = spec.buildRequests(bid); + + expect(req).to.exist.and.to.be.a('array'); + expect(req[0]).to.have.property('method'); + expect(req[0].method).to.equal('GET'); + expect(req[0]).to.have.property('url'); + expect(req[0].url).to.contain('//mobile.mng-ads.com/?rt=bid_request&v=1.0').and.to.contain(`&s=test`).and.to.contain(`&sizes[0]=728x90`) + }); + }); + + describe('Test interpret response', () => { + it('General banner response', () => { + let bid = { + bidder: 'madvertise', + sizes: [[728, 90]], + bidId: '51ef8751f9aead', + adUnitCode: 'div-gpt-ad-1460505748561-0', + transactionId: 'd7b773de-ceaa-484d-89ca-d9f51b8d61ec', + auctionId: '18fd8b8b0bd757', + bidderRequestId: '418b37f85e772c', + params: { + s: 'test', + connection_type: 'WIFI', + age: 25, + } + }; + let resp = spec.interpretResponse({body: { + requestId: 'REQUEST_ID', + cpm: 1, + ad: '

I am an ad

', + Width: 320, + height: 50, + creativeId: 'CREATIVE_ID', + dealId: 'DEAL_ID', + ttl: 180, + currency: 'EUR', + netRevenue: true + }}, {bidId: bid.bidId}); + + expect(resp).to.exist.and.to.be.a('array'); + expect(resp[0]).to.have.property('requestId', bid.bidId); + expect(resp[0]).to.have.property('cpm', 1); + expect(resp[0]).to.have.property('width', 320); + expect(resp[0]).to.have.property('height', 50); + expect(resp[0]).to.have.property('ad', '

I am an ad

'); + expect(resp[0]).to.have.property('ttl', 180); + expect(resp[0]).to.have.property('creativeId', 'CREATIVE_ID'); + expect(resp[0]).to.have.property('netRevenue', true); + expect(resp[0]).to.have.property('currency', 'EUR'); + expect(resp[0]).to.have.property('dealId', 'DEAL_ID'); + }); + it('No response', () => { + let bid = { + bidder: 'madvertise', + sizes: [[728, 90]], + bidId: '51ef8751f9aead', + adUnitCode: 'div-gpt-ad-1460505748561-0', + transactionId: 'd7b773de-ceaa-484d-89ca-d9f51b8d61ec', + auctionId: '18fd8b8b0bd757', + bidderRequestId: '418b37f85e772c', + params: { + s: 'test', + connection_type: 'WIFI', + age: 25, + } + }; + let resp = spec.interpretResponse({body: null}, {bidId: bid.bidId}); + + expect(resp).to.exist.and.to.be.a('array').that.is.empty; + }); + }); +}); From cd88efa9a369ae108fd738e8e45e49c47e5d8cf4 Mon Sep 17 00:00:00 2001 From: NLopezMad <22349934+NLopezMad@users.noreply.github.com> Date: Mon, 2 Apr 2018 20:44:54 +0200 Subject: [PATCH 2/8] Update madvertiseBidAdapter.js remove aliases --- modules/madvertiseBidAdapter.js | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/madvertiseBidAdapter.js b/modules/madvertiseBidAdapter.js index 5712153b7b2..ef6d6514e33 100644 --- a/modules/madvertiseBidAdapter.js +++ b/modules/madvertiseBidAdapter.js @@ -6,7 +6,6 @@ const MADVERTISE_ENDPOINT = 'https://mobile.mng-ads.com/'; export const spec = { code: 'madvertise', - aliases: ['madvertise'], /** * @param {object} bid * @return boolean From e074a92d9af836c1082301b4c22eab0beef58d8a Mon Sep 17 00:00:00 2001 From: NLopezMad <22349934+NLopezMad@users.noreply.github.com> Date: Mon, 2 Apr 2018 20:58:16 +0200 Subject: [PATCH 3/8] Update madvertiseBidAdapter.js use parseSizesInput method --- modules/madvertiseBidAdapter.js | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/modules/madvertiseBidAdapter.js b/modules/madvertiseBidAdapter.js index ef6d6514e33..ae3e2b09374 100644 --- a/modules/madvertiseBidAdapter.js +++ b/modules/madvertiseBidAdapter.js @@ -14,20 +14,10 @@ export const spec = { if (typeof bid.params !== 'object') { return false; } - if (!Array.isArray(bid.sizes) || bid.sizes.length == 0) { - return false; - } else { - var sizes = []; - for (var i = 0; i < bid.sizes.length; i++) { - if (Array.isArray(bid.sizes[i]) && bid.sizes[i].length == 2) { - sizes.push(bid.sizes[i]); - } - } - if (sizes.length == 0) { + var sizes = utils.parseSizesInput(bid.sizes); + if (sizes.length == 0) { return false; - } } - if (typeof bid.params.floor == 'undefined' || parseFloat(bid.params.floor) < 0.01) { bid.params.floor = 0.01; } From 6a1dc1f2709ed1f8fcf9ab7ee976fe8dcf684141 Mon Sep 17 00:00:00 2001 From: Nicolas Otmani Date: Tue, 3 Apr 2018 10:53:57 +0200 Subject: [PATCH 4/8] fix test parseSizesInput --- modules/madvertiseBidAdapter.js | 10 +++++++--- test/spec/modules/madvertiseBidAdapter_spec.js | 3 +-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/madvertiseBidAdapter.js b/modules/madvertiseBidAdapter.js index ae3e2b09374..20908cb6ebd 100644 --- a/modules/madvertiseBidAdapter.js +++ b/modules/madvertiseBidAdapter.js @@ -14,9 +14,13 @@ export const spec = { if (typeof bid.params !== 'object') { return false; } - var sizes = utils.parseSizesInput(bid.sizes); - if (sizes.length == 0) { - return false; + let sizes = utils.parseSizesInput(bid.sizes); + if (!sizes || sizes.length === 0) { + return false; + } + console.log(sizes[0]); + if(sizes.length > 0 && sizes[0] === undefined ) { + return false; } if (typeof bid.params.floor == 'undefined' || parseFloat(bid.params.floor) < 0.01) { bid.params.floor = 0.01; diff --git a/test/spec/modules/madvertiseBidAdapter_spec.js b/test/spec/modules/madvertiseBidAdapter_spec.js index 81a62ab81ef..6e628214969 100644 --- a/test/spec/modules/madvertiseBidAdapter_spec.js +++ b/test/spec/modules/madvertiseBidAdapter_spec.js @@ -47,7 +47,6 @@ describe('madvertise adapater', () => { } }; const isValid = spec.isBidRequestValid(bid); - expect(isValid).to.equal(false); }); it('should reject no params', () => { @@ -74,7 +73,7 @@ describe('madvertise adapater', () => { it('minimum request', () => { let bid = [{ bidder: 'madvertise', - sizes: [[728, 90]], + sizes: [[728, 90],[300,100]], bidId: '51ef8751f9aead', adUnitCode: 'div-gpt-ad-1460505748561-0', transactionId: 'd7b773de-ceaa-484d-89ca-d9f51b8d61ec', From d692b31e7636969bb9fef982e4dde22611557ba4 Mon Sep 17 00:00:00 2001 From: Nicolas Otmani Date: Tue, 3 Apr 2018 11:13:56 +0200 Subject: [PATCH 5/8] fix lint parseSizesInput --- modules/madvertiseBidAdapter.js | 2 +- test/spec/modules/madvertiseBidAdapter_spec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/madvertiseBidAdapter.js b/modules/madvertiseBidAdapter.js index 20908cb6ebd..edb2758a032 100644 --- a/modules/madvertiseBidAdapter.js +++ b/modules/madvertiseBidAdapter.js @@ -19,7 +19,7 @@ export const spec = { return false; } console.log(sizes[0]); - if(sizes.length > 0 && sizes[0] === undefined ) { + if (sizes.length > 0 && sizes[0] === undefined) { return false; } if (typeof bid.params.floor == 'undefined' || parseFloat(bid.params.floor) < 0.01) { diff --git a/test/spec/modules/madvertiseBidAdapter_spec.js b/test/spec/modules/madvertiseBidAdapter_spec.js index 6e628214969..64ecf556aa5 100644 --- a/test/spec/modules/madvertiseBidAdapter_spec.js +++ b/test/spec/modules/madvertiseBidAdapter_spec.js @@ -73,7 +73,7 @@ describe('madvertise adapater', () => { it('minimum request', () => { let bid = [{ bidder: 'madvertise', - sizes: [[728, 90],[300,100]], + sizes: [[728, 90], [300, 100]], bidId: '51ef8751f9aead', adUnitCode: 'div-gpt-ad-1460505748561-0', transactionId: 'd7b773de-ceaa-484d-89ca-d9f51b8d61ec', From 8076c2c0fbe89db402619e4668ad555cdbc6acc4 Mon Sep 17 00:00:00 2001 From: Nicolas Otmani Date: Tue, 3 Apr 2018 13:33:31 +0200 Subject: [PATCH 6/8] remove seeanAd feature --- modules/madvertiseBidAdapter.js | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/modules/madvertiseBidAdapter.js b/modules/madvertiseBidAdapter.js index edb2758a032..74f33738fb1 100644 --- a/modules/madvertiseBidAdapter.js +++ b/modules/madvertiseBidAdapter.js @@ -51,8 +51,6 @@ export const spec = { src = src + '&u=' + navigator.userAgent; } - src = src + _getSeenAd(); - return { method: 'GET', url: MADVERTISE_ENDPOINT + src, @@ -73,8 +71,6 @@ export const spec = { return []; } - _setSeenAd(responseObj.creativeId); - let bid = { requestId: bidRequest.bidId, cpm: responseObj.cpm, @@ -92,33 +88,4 @@ export const spec = { getUserSyncs: function (syncOptions) { } }; - -function _getSeenAd() { - var cookies = document.cookie.split(';'); - var src = ''; - for (var i = 0; i < cookies.length; i++) { - var cookie = cookies[i].trim(); - if (cookie.match(/seenad\[\d+\]=\d+/)) { - src += '&' + cookie; - } - } - return src; -} - -function _setSeenAd(adid) { - var dateNow = new Date(); - dateNow.setTime(dateNow.getTime() + (2 * 24 * 60 * 60 * 1000)); - var expires = 'expires=' + dateNow.toUTCString(); - var valuecookie = 'seenad[' + adid + ']=' + (Date.now() / 1000 | 0) + ';'; - var domain, domainParts, host; - host = location.host; - if (host.split('.').length === 1) { - document.cookie = valuecookie + expires + '; path=/'; - } else { - domainParts = host.split('.'); - domainParts.shift(); - domain = '.' + domainParts.join('.'); - document.cookie = valuecookie + expires + '; path=/; domain=' + domain; - } -} registerBidder(spec); From cfedd6ddf7558b04ce01290a3f03600fcb9fb9b7 Mon Sep 17 00:00:00 2001 From: Nicolas Otmani Date: Wed, 4 Apr 2018 00:24:23 +0200 Subject: [PATCH 7/8] remove console.log --- modules/madvertiseBidAdapter.js | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/madvertiseBidAdapter.js b/modules/madvertiseBidAdapter.js index 74f33738fb1..620ab3b7396 100644 --- a/modules/madvertiseBidAdapter.js +++ b/modules/madvertiseBidAdapter.js @@ -18,7 +18,6 @@ export const spec = { if (!sizes || sizes.length === 0) { return false; } - console.log(sizes[0]); if (sizes.length > 0 && sizes[0] === undefined) { return false; } From bf7261671ba7ef215b133ae2d6b5c0cc9706d4ac Mon Sep 17 00:00:00 2001 From: Nicolas Lopez Date: Wed, 30 May 2018 21:07:15 +0200 Subject: [PATCH 8/8] Add gdpr consent management to madvertise module --- modules/madvertiseBidAdapter.js | 8 +- .../spec/modules/madvertiseBidAdapter_spec.js | 74 +++++++++++++++---- 2 files changed, 67 insertions(+), 15 deletions(-) diff --git a/modules/madvertiseBidAdapter.js b/modules/madvertiseBidAdapter.js index 620ab3b7396..c9f4c302e7a 100644 --- a/modules/madvertiseBidAdapter.js +++ b/modules/madvertiseBidAdapter.js @@ -1,3 +1,4 @@ +import {config} from 'src/config'; import * as utils from 'src/utils'; import {registerBidder} from 'src/adapters/bidderFactory'; @@ -29,9 +30,10 @@ export const spec = { }, /** * @param {BidRequest[]} bidRequests + * @param bidderRequest * @return ServerRequest[] */ - buildRequests: function (bidRequests) { + buildRequests: function (bidRequests, bidderRequest) { return bidRequests.map(bidRequest => { bidRequest.startTime = new Date().getTime(); @@ -50,6 +52,10 @@ export const spec = { src = src + '&u=' + navigator.userAgent; } + if (bidderRequest && bidderRequest.gdprConsent) { + src = src + '&gdpr=' + (bidderRequest.gdprConsent.gdprApplies ? '1' : '0') + '&consent[0][format]=' + config.getConfig('consentManagement.cmpApi') + '&consent[0][value]=' + bidderRequest.gdprConsent.consentString; + } + return { method: 'GET', url: MADVERTISE_ENDPOINT + src, diff --git a/test/spec/modules/madvertiseBidAdapter_spec.js b/test/spec/modules/madvertiseBidAdapter_spec.js index 64ecf556aa5..c391ca1d39f 100644 --- a/test/spec/modules/madvertiseBidAdapter_spec.js +++ b/test/spec/modules/madvertiseBidAdapter_spec.js @@ -1,4 +1,6 @@ import {expect} from 'chai'; +import {config} from 'src/config'; +import * as utils from 'src/utils'; import {spec} from 'modules/madvertiseBidAdapter'; describe('madvertise adapater', () => { @@ -70,26 +72,70 @@ describe('madvertise adapater', () => { }); describe('Test build request', () => { - it('minimum request', () => { - let bid = [{ - bidder: 'madvertise', - sizes: [[728, 90], [300, 100]], - bidId: '51ef8751f9aead', - adUnitCode: 'div-gpt-ad-1460505748561-0', - transactionId: 'd7b773de-ceaa-484d-89ca-d9f51b8d61ec', - auctionId: '18fd8b8b0bd757', - bidderRequestId: '418b37f85e772c', - params: { - s: 'test', + beforeEach(function () { + let mockConfig = { + consentManagement: { + cmpApi: 'IAB', + timeout: 1111, + allowAuctionWithoutConsent: 'cancel' } - }]; - const req = spec.buildRequests(bid); + }; + + sinon.stub(config, 'getConfig').callsFake((key) => { + return utils.deepAccess(mockConfig, key); + }); + }); + afterEach(function () { + config.getConfig.restore(); + }); + let bid = [{ + bidder: 'madvertise', + sizes: [[728, 90], [300, 100]], + bidId: '51ef8751f9aead', + adUnitCode: 'div-gpt-ad-1460505748561-0', + transactionId: 'd7b773de-ceaa-484d-89ca-d9f51b8d61ec', + auctionId: '18fd8b8b0bd757', + bidderRequestId: '418b37f85e772c', + params: { + s: 'test', + } + }]; + it('minimum request with gdpr consent', () => { + let bidderRequest = { + gdprConsent: { + consentString: 'BOJ/P2HOJ/P2HABABMAAAAAZ+A==', + vendorData: {}, + gdprApplies: true + } + }; + const req = spec.buildRequests(bid, bidderRequest); + + expect(req).to.exist.and.to.be.a('array'); + expect(req[0]).to.have.property('method'); + expect(req[0].method).to.equal('GET'); + expect(req[0]).to.have.property('url'); + expect(req[0].url).to.contain('//mobile.mng-ads.com/?rt=bid_request&v=1.0'); + expect(req[0].url).to.contain(`&s=test`); + expect(req[0].url).to.contain(`&sizes[0]=728x90`); + expect(req[0].url).to.contain(`&gdpr=1`); + expect(req[0].url).to.contain(`&consent[0][format]=IAB`); + expect(req[0].url).to.contain(`&consent[0][value]=BOJ/P2HOJ/P2HABABMAAAAAZ+A==`) + }); + + it('minimum request without gdpr consent', () => { + let bidderRequest = {}; + const req = spec.buildRequests(bid, bidderRequest); expect(req).to.exist.and.to.be.a('array'); expect(req[0]).to.have.property('method'); expect(req[0].method).to.equal('GET'); expect(req[0]).to.have.property('url'); - expect(req[0].url).to.contain('//mobile.mng-ads.com/?rt=bid_request&v=1.0').and.to.contain(`&s=test`).and.to.contain(`&sizes[0]=728x90`) + expect(req[0].url).to.contain('//mobile.mng-ads.com/?rt=bid_request&v=1.0'); + expect(req[0].url).to.contain(`&s=test`); + expect(req[0].url).to.contain(`&sizes[0]=728x90`); + expect(req[0].url).not.to.contain(`&gdpr=1`); + expect(req[0].url).not.to.contain(`&consent[0][format]=`); + expect(req[0].url).not.to.contain(`&consent[0][value]=`) }); });