From b7385847cbc76e3a2b3b7e104667b86e8c3130a7 Mon Sep 17 00:00:00 2001 From: optimatic58 <33465594+optimatic58@users.noreply.github.com> Date: Tue, 19 Dec 2017 13:13:20 -0500 Subject: [PATCH] + fixed endpoint request data property names - width to w and height to h (#1955) + updated unit test for the adapter to comply with the property name changes --- modules/optimaticBidAdapter.js | 4 ++-- test/spec/modules/optimaticBidAdapter_spec.js | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/optimaticBidAdapter.js b/modules/optimaticBidAdapter.js index 3130977ea76..2408eb8cefe 100644 --- a/modules/optimaticBidAdapter.js +++ b/modules/optimaticBidAdapter.js @@ -75,8 +75,8 @@ function getData (bid) { bidfloor: bid.params.bidfloor, video: { mimes: ['video/mp4', 'video/ogg', 'video/webm', 'video/x-flv', 'application/javascript', 'application/x-shockwave-flash'], - width: size.width, - height: size.height + w: size.width, + h: size.height } }], site: { diff --git a/test/spec/modules/optimaticBidAdapter_spec.js b/test/spec/modules/optimaticBidAdapter_spec.js index cbea5598627..890c0b78613 100644 --- a/test/spec/modules/optimaticBidAdapter_spec.js +++ b/test/spec/modules/optimaticBidAdapter_spec.js @@ -66,8 +66,8 @@ describe('OptimaticBidAdapter', () => { const requests = spec.buildRequests([ bidRequest ]); const data = requests[0].data; const [ width, height ] = bidRequest.sizes; - expect(data.imp[0].video.width).to.equal(width); - expect(data.imp[0].video.height).to.equal(height); + expect(data.imp[0].video.w).to.equal(width); + expect(data.imp[0].video.h).to.equal(height); expect(data.imp[0].bidfloor).to.equal(bidRequest.params.bidfloor); }); @@ -77,8 +77,8 @@ describe('OptimaticBidAdapter', () => { bidRequest.sizes = [[ width, height ]]; const requests = spec.buildRequests([ bidRequest ]); const data = requests[0].data; - expect(data.imp[0].video.width).to.equal(width); - expect(data.imp[0].video.height).to.equal(height); + expect(data.imp[0].video.w).to.equal(width); + expect(data.imp[0].video.h).to.equal(height); }); it('must parse bid size from a string', () => { @@ -87,16 +87,16 @@ describe('OptimaticBidAdapter', () => { bidRequest.sizes = `${width}x${height}`; const requests = spec.buildRequests([ bidRequest ]); const data = requests[0].data; - expect(data.imp[0].video.width).to.equal(width); - expect(data.imp[0].video.height).to.equal(height); + expect(data.imp[0].video.w).to.equal(width); + expect(data.imp[0].video.h).to.equal(height); }); it('must handle an empty bid size', () => { bidRequest.sizes = []; const requests = spec.buildRequests([ bidRequest ]); const data = requests[0].data; - expect(data.imp[0].video.width).to.equal(undefined); - expect(data.imp[0].video.height).to.equal(undefined); + expect(data.imp[0].video.w).to.equal(undefined); + expect(data.imp[0].video.h).to.equal(undefined); }); });