Skip to content

Commit

Permalink
fix bug with privateSizes (#2141)
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Kendall authored Feb 13, 2018
1 parent 1899a2b commit dab30a3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/appnexusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ function bidToTag(bid) {
tag.traffic_source_code = bid.params.trafficSourceCode;
}
if (bid.params.privateSizes) {
tag.private_sizes = getSizes(bid.params.privateSizes);
tag.private_sizes = transformSizes(bid.params.privateSizes);
}
if (bid.params.supplyType) {
tag.supply_type = bid.params.supplyType;
Expand Down
18 changes: 18 additions & 0 deletions test/spec/modules/appnexusBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,24 @@ describe('AppNexusAdapter', () => {
}
];

it('should parse out private sizes', () => {
let bidRequest = Object.assign({},
bidRequests[0],
{
params: {
placementId: '10433394',
privateSizes: [300, 250]
}
}
);

const request = spec.buildRequests([bidRequest]);
const payload = JSON.parse(request.data);

expect(payload.tags[0].private_sizes).to.exist;
expect(payload.tags[0].private_sizes).to.deep.equal([{width: 300, height: 250}]);
});

it('should add source and verison to the tag', () => {
const request = spec.buildRequests(bidRequests);
const payload = JSON.parse(request.data);
Expand Down

0 comments on commit dab30a3

Please sign in to comment.