Skip to content

Commit

Permalink
fix ref error on yieldmo adapter (prebid#3776)
Browse files Browse the repository at this point in the history
* fix ref error on yieldmo adapter

* Delete yarn.lock
  • Loading branch information
ETNOL authored and Alex committed Aug 1, 2019
1 parent eb008e8 commit 04f8923
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/yieldmoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
});
Expand Down
9 changes: 8 additions & 1 deletion test/spec/modules/yieldmoBidAdapter_spec.js
Original file line number Diff line number Diff line change
@@ -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 () {
Expand Down Expand Up @@ -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]]}]');
Expand Down

0 comments on commit 04f8923

Please sign in to comment.