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

Yahoo SSP Bid Adapter: interstitial fix #7746

Merged
merged 5 commits into from
Nov 23, 2021
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
6 changes: 5 additions & 1 deletion modules/yahoosspBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Renderer } from '../src/Renderer.js';

const INTEGRATION_METHOD = 'prebid.js';
const BIDDER_CODE = 'yahoossp';
const ADAPTER_VERSION = '1.0.1';
const ADAPTER_VERSION = '1.0.2';
const PREBID_VERSION = '$prebid.version$';
const DEFAULT_BID_TTL = 300;
const TEST_MODE_DCN = '8a969516017a7a396ec539d97f540011';
Expand Down Expand Up @@ -359,6 +359,10 @@ function appendImpObject(bid, openRtbObject) {
impObject.ext.data = bid.ortb2Imp.ext.data;
};

if (deepAccess(bid, 'ortb2Imp.instl') && isNumber(bid.ortb2Imp.instl) && (bid.ortb2Imp.instl === 1)) {
impObject.instl = bid.ortb2Imp.instl;
};

if (getPubIdMode(bid) === false) {
impObject.tagid = bid.params.pos;
impObject.ext.pos = bid.params.pos;
Expand Down
29 changes: 28 additions & 1 deletion test/spec/modules/yahoosspBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const DEFAULT_AD_UNIT_CODE = '/19968336/header-bid-tag-1';
const DEFAULT_AD_UNIT_TYPE = 'banner';
const DEFAULT_PARAMS_BID_OVERRIDE = {};
const DEFAULT_VIDEO_CONTEXT = 'instream';
const ADAPTER_VERSION = '1.0.1';
const ADAPTER_VERSION = '1.0.2';
const PREBID_VERSION = '$prebid.version$';
const INTEGRATION_METHOD = 'prebid.js';

Expand Down Expand Up @@ -656,6 +656,33 @@ describe('YahooSSP Bid Adapter:', () => {
const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data;
expect(data.imp[0].ext.data).to.deep.equal(validBidRequests[0].ortb2Imp.ext.data);
});
// adUnit.ortb2Imp.instl
it(`should allow adUnit.ortb2Imp.instl numeric boolean "1" to be added to the bid-request`, () => {
let { validBidRequests, bidderRequest } = generateBuildRequestMock({})
validBidRequests[0].ortb2Imp = {
instl: 1
};
const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data;
expect(data.imp[0].instl).to.deep.equal(validBidRequests[0].ortb2Imp.instl);
});

it(`should prevent adUnit.ortb2Imp.instl boolean "true" to be added to the bid-request`, () => {
let { validBidRequests, bidderRequest } = generateBuildRequestMock({})
validBidRequests[0].ortb2Imp = {
instl: true
};
const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data;
expect(data.imp[0].instl).to.not.exist;
});

it(`should prevent adUnit.ortb2Imp.instl boolean "false" to be added to the bid-request`, () => {
let { validBidRequests, bidderRequest } = generateBuildRequestMock({})
validBidRequests[0].ortb2Imp = {
instl: false
};
const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data;
expect(data.imp[0].instl).to.not.exist;
});
});

describe('e2etest mode support:', () => {
Expand Down