Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Size Bugfix #2414

Merged
merged 21 commits into from
Apr 24, 2018
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion modules/quantumBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ export const spec = {
bid.sync = serverBody.sync;
if (bidRequest.renderMode && bidRequest.renderMode === 'banner') {
bid.width = 300;
bid.height = 225;
bid.height = 250;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure you want these height/width values to be hard-coded like this? Wouldn't it be more ideal to read from the bid response object? I thought I saw some height/width params in the response from the server, so I wanted to confirm on this point.

bid.mediaType = 'banner';
if (serverBody.native) {
const adAssetsUrl = '//cdn.elasticad.net/native/serve/js/quantx/quantumAd/';
let assets = serverBody.native.assets;
Expand Down Expand Up @@ -216,6 +217,7 @@ export const spec = {
}
} else {
// native
bid.mediaType = 'native';
if (bidRequest.mediaType === 'native') {
if (serverBody.native) {
let assets = serverBody.native.assets;
Expand Down
7 changes: 4 additions & 3 deletions test/spec/modules/quantumBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { newBidder } from 'src/adapters/bidderFactory'
const ENDPOINT = '//s.sspqns.com/hb'
const REQUEST = {
'bidder': 'quantum',
'sizes': [[300, 225]],
'sizes': [[300, 250]],
'renderMode': 'banner',
'params': {
placementId: 21546
Expand Down Expand Up @@ -245,15 +245,16 @@ describe('quantumBidAdapter', () => {
expect(result[0]).to.have.property('cpm').equal(0.3)
expect(result[0]).to.have.property('width').to.be.below(2)
expect(result[0]).to.have.property('height').to.be.below(2)
expect(result[0]).to.have.property('mediaType').equal('native')
expect(result[0]).to.have.property('native')
})

it('should get correct bid response', () => {
const result = spec.interpretResponse({body: serverResponse}, REQUEST)
expect(result[0]).to.have.property('cpm').equal(0.3)
expect(result[0]).to.have.property('width').equal(300)
expect(result[0]).to.have.property('height').equal(225)
// expect(result[0]).to.have.property('native');
expect(result[0]).to.have.property('height').equal(250)
expect(result[0]).to.have.property('mediaType').equal('banner')
expect(result[0]).to.have.property('ad')
})

Expand Down