Skip to content

Commit

Permalink
JustPremium - schain support added (prebid#7506)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcin15g authored and Chris Pabst committed Jan 10, 2022
1 parent d94f3f7 commit 866f090
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
6 changes: 5 additions & 1 deletion modules/justpremiumBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { deepAccess } from '../src/utils.js';
const BIDDER_CODE = 'justpremium'
const GVLID = 62
const ENDPOINT_URL = 'https://pre.ads.justpremium.com/v/2.0/t/xhr'
const JP_ADAPTER_VERSION = '1.7'
const JP_ADAPTER_VERSION = '1.8'
const pixels = []

export const spec = {
Expand Down Expand Up @@ -65,6 +65,10 @@ export const spec = {
jp_adapter: JP_ADAPTER_VERSION
}

if (validBidRequests[0].schain) {
payload.schain = validBidRequests[0].schain;
}

const payloadString = JSON.stringify(payload)

return {
Expand Down
18 changes: 16 additions & 2 deletions test/spec/modules/justpremiumBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ describe('justpremium adapter', function () {
sandbox.restore();
});

let schainConfig = {
'ver': '1.0',
'complete': 1,
'nodes': [
{
'asi': 'indirectseller.com',
'sid': '00001',
'hp': 1
}
]
}

let adUnits = [
{
adUnitCode: 'div-gpt-ad-1471513102552-1',
Expand All @@ -33,7 +45,8 @@ describe('justpremium adapter', function () {
params: {
zone: 28313,
allow: ['lb', 'wp']
}
},
schain: schainConfig
},
{
adUnitCode: 'div-gpt-ad-1471513102552-2',
Expand Down Expand Up @@ -75,6 +88,7 @@ describe('justpremium adapter', function () {
expect(jpxRequest).to.not.equal(null)
expect(jpxRequest.zone).to.not.equal('undefined')
expect(bidderRequest.refererInfo.referer).to.equal('https://justpremium.com')
expect(jpxRequest.schain).to.deep.equal(schainConfig)
expect(jpxRequest.sw).to.equal(window.top.screen.width)
expect(jpxRequest.sh).to.equal(window.top.screen.height)
expect(jpxRequest.ww).to.equal(window.top.innerWidth)
Expand All @@ -83,7 +97,7 @@ describe('justpremium adapter', function () {
expect(jpxRequest.id).to.equal(adUnits[0].params.zone)
expect(jpxRequest.mediaTypes && jpxRequest.mediaTypes.banner && jpxRequest.mediaTypes.banner.sizes).to.not.equal('undefined')
expect(jpxRequest.version.prebid).to.equal('$prebid.version$')
expect(jpxRequest.version.jp_adapter).to.equal('1.7')
expect(jpxRequest.version.jp_adapter).to.equal('1.8')
expect(jpxRequest.pubcid).to.equal('0000000')
expect(jpxRequest.uids.tdid).to.equal('1111111')
expect(jpxRequest.uids.id5id.uid).to.equal('2222222')
Expand Down

0 comments on commit 866f090

Please sign in to comment.