From 04f8923a3af38699cf873efc479b3680575f89eb Mon Sep 17 00:00:00 2001 From: Eric Nolte Date: Tue, 30 Apr 2019 05:59:59 -0400 Subject: [PATCH] fix ref error on yieldmo adapter (#3776) * fix ref error on yieldmo adapter * Delete yarn.lock --- modules/yieldmoBidAdapter.js | 2 +- test/spec/modules/yieldmoBidAdapter_spec.js | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/yieldmoBidAdapter.js b/modules/yieldmoBidAdapter.js index d904791d29a..b2d13e88c80 100644 --- a/modules/yieldmoBidAdapter.js +++ b/modules/yieldmoBidAdapter.js @@ -47,7 +47,7 @@ export const spec = { if (userId) { const pubcid = userId.pubcid; serverRequest.pubcid = pubcid; - } else { + } else if (request.crumbs) { serverRequest.pubcid = request.crumbs.pubcid; } }); diff --git a/test/spec/modules/yieldmoBidAdapter_spec.js b/test/spec/modules/yieldmoBidAdapter_spec.js index 80a9265a5c2..12dd87e1517 100644 --- a/test/spec/modules/yieldmoBidAdapter_spec.js +++ b/test/spec/modules/yieldmoBidAdapter_spec.js @@ -1,6 +1,6 @@ import { expect } from 'chai'; import { spec } from 'modules/yieldmoBidAdapter'; -import {newBidder} from 'src/adapters/bidderFactory'; +import { newBidder } from 'src/adapters/bidderFactory'; import * as utils from 'src/utils'; describe('YieldmoAdapter', function () { @@ -50,6 +50,13 @@ describe('YieldmoAdapter', function () { expect(request.url).to.be.equal(ENDPOINT); }); + it('should not blow up if crumbs is undefined', function () { + let bidArray = [ + { ...bid, crumbs: undefined } + ] + expect(function () { spec.buildRequests(bidArray) }).not.to.throw() + }) + it('should place bid information into the p parameter of data', function () { let placementInfo = spec.buildRequests(bidArray).data.p; expect(placementInfo).to.equal('[{"placement_id":"adunit-code","callback_id":"30b31c1838de1e","sizes":[[300,250],[300,600]]}]');