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 all 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
8 changes: 6 additions & 2 deletions modules/quantumBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,15 @@ export const spec = {
if (serverBody.cobj) {
bid.cobj = serverBody.cobj;
}
if (bidRequest.sizes) {
bid.width = bidRequest.sizes[0][0];
bid.height = bidRequest.sizes[0][1];
}

bid.nurl = serverBody.nurl;
bid.sync = serverBody.sync;
if (bidRequest.renderMode && bidRequest.renderMode === 'banner') {
bid.width = 300;
bid.height = 225;
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 +219,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