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

SynacorMedia Bid Adapter: remove adId from the bid response #6520

Merged
merged 1 commit into from
Apr 5, 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
1 change: 0 additions & 1 deletion modules/synacormediaBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ export const spec = {
}
const bidObj = {
requestId: impid,
adId: bid.id.replace(/~/g, '-'),
cpm: parseFloat(bid.price),
width: parseInt(width, 10),
height: parseInt(height, 10),
Expand Down
44 changes: 19 additions & 25 deletions test/spec/modules/synacormediaBidAdapter_spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assert, expect } from 'chai';
import { BANNER } from 'src/mediaTypes.js';
import {config} from 'src/config.js';
import { config } from 'src/config.js';
import { spec } from 'modules/synacormediaBidAdapter.js';

describe('synacormediaBidAdapter ', function () {
Expand Down Expand Up @@ -55,7 +55,7 @@ describe('synacormediaBidAdapter ', function () {
});
});

describe('impression type', function() {
describe('impression type', function () {
let nonVideoReq = {
bidId: '9876abcd',
sizes: [[300, 250], [300, 600]],
Expand Down Expand Up @@ -107,7 +107,7 @@ describe('synacormediaBidAdapter ', function () {
}
},
};
it('should return correct impression type video/banner', function() {
it('should return correct impression type video/banner', function () {
assert.isFalse(spec.isVideoBid(nonVideoReq));
assert.isFalse(spec.isVideoBid(bannerReq));
assert.isTrue(spec.isVideoBid(videoReq));
Expand All @@ -126,12 +126,12 @@ describe('synacormediaBidAdapter ', function () {
mediaTypes: {
video: {
context: 'instream',
playerSize: [[ 640, 480 ]]
playerSize: [[640, 480]]
}
},
adUnitCode: 'video1',
transactionId: '93e5def8-29aa-4fe8-bd3a-0298c39f189a',
sizes: [[ 640, 480 ]],
sizes: [[640, 480]],
bidId: '2624fabbb078e8',
bidderRequestId: '117954d20d7c9c',
auctionId: 'defd525f-4f1e-4416-a4cb-ae53be90e706',
Expand All @@ -149,7 +149,7 @@ describe('synacormediaBidAdapter ', function () {
referer: 'https://localhost:9999/test/pages/video.html?pbjs_debug=true',
reachedTop: true,
numIframes: 0,
stack: [ 'https://localhost:9999/test/pages/video.html?pbjs_debug=true' ]
stack: ['https://localhost:9999/test/pages/video.html?pbjs_debug=true']
},
start: 1553624929700
};
Expand Down Expand Up @@ -427,7 +427,7 @@ describe('synacormediaBidAdapter ', function () {
expect(spec.buildRequests([validBidRequest], null)).to.be.undefined;
});

it('should return empty impression when there is no valid sizes in bidrequest', function() {
it('should return empty impression when there is no valid sizes in bidrequest', function () {
let validBidReqWithoutSize = {
bidId: '9876abcd',
sizes: [],
Expand Down Expand Up @@ -480,12 +480,12 @@ describe('synacormediaBidAdapter ', function () {
mediaTypes: {
video: {
context: 'instream',
playerSize: [[ 640, 480 ]]
playerSize: [[640, 480]]
}
},
adUnitCode: 'video1',
transactionId: '93e5def8-29aa-4fe8-bd3a-0298c39f189a',
sizes: [[ 640, 480 ]],
sizes: [[640, 480]],
bidId: '2624fabbb078e8',
bidderRequestId: '117954d20d7c9c',
auctionId: 'defd525f-4f1e-4416-a4cb-ae53be90e706',
Expand Down Expand Up @@ -534,7 +534,7 @@ describe('synacormediaBidAdapter ', function () {
mediaTypes: {
video: {
context: 'instream',
playerSize: [[ 640, 480 ]],
playerSize: [[640, 480]],
startdelay: 1,
linearity: 1,
placement: 1,
Expand All @@ -543,7 +543,7 @@ describe('synacormediaBidAdapter ', function () {
},
adUnitCode: 'video1',
transactionId: '93e5def8-29aa-4fe8-bd3a-0298c39f189a',
sizes: [[ 640, 480 ]],
sizes: [[640, 480]],
bidId: '2624fabbb078e8',
bidderRequestId: '117954d20d7c9c',
auctionId: 'defd525f-4f1e-4416-a4cb-ae53be90e706',
Expand Down Expand Up @@ -576,7 +576,7 @@ describe('synacormediaBidAdapter ', function () {
}
]);
});
it('should contain the CCPA privacy string when UspConsent is in bidder request', function() {
it('should contain the CCPA privacy string when UspConsent is in bidder request', function () {
// banner test
let req = spec.buildRequests([validBidRequest], bidderRequestWithCCPA);
expect(req).be.an('object');
Expand Down Expand Up @@ -652,7 +652,7 @@ describe('synacormediaBidAdapter ', function () {
});
});

describe('Bid Requests with schain object ', function() {
describe('Bid Requests with schain object ', function () {
let validBidReq = {
bidder: 'synacormedia',
params: {
Expand Down Expand Up @@ -803,7 +803,7 @@ describe('synacormediaBidAdapter ', function () {
url: 'https://prebid.technoratimedia.com/openrtb/bids/prebid?src=prebid_prebid_3.27.0-pre'
};
let serverResponse;
beforeEach(function() {
beforeEach(function () {
serverResponse = {
body: {
id: 'abc123',
Expand Down Expand Up @@ -848,7 +848,7 @@ describe('synacormediaBidAdapter ', function () {
price: 0.45,
nurl: 'https://uat-net.technoratimedia.com/openrtb/tags?ID=QVVDVElPTl9JRD1lOTBhYWU1My1hZDkwLTRkNDEtYTQxMC1lZDY1MjIxMDc0ZGMmQVVDVElPTl9CSURfSUQ9MTEzMzkxMjgwMDE2OTIzMzd-OTk5OX4wJkFVQ1RJT05fU0VBVF9JRD05OTk5JkFVQ1RJT05fSU1QX0lEPXYyZGE3MzIyYjJkZjYxZi02NDB4NDgwJkFDVE9SX1JFRj1ha2thLnRjcDovL2F3cy1lYXN0MUBhZHMxMy5jYXAtdXNlMS5zeW5hY29yLmNvbToyNTUxL3VzZXIvJGNMYmZiIy0xOTk4NTIzNTk3JlNFQVRfSUQ9cHJlYmlk&AUCTION_PRICE=${AUCTION_PRICE}',
adm: '<?xml version="1.0" encoding="UTF-8"?>\n<VAST version="3.0">\n<Ad id="11339128001692337~9999~0">\n<Wrapper>\n<AdSystem>Synacor Media Ad Server - 9999</AdSystem>\n<VASTAdTagURI>https://uat-net.technoratimedia.com/openrtb/tags?ID=QVVDVElPTl9JRD1lOTBhYWU1My1hZDkwLTRkNDEtYTQxMC1lZDY1MjIxMDc0ZGMmQVVDVElPTl9CSURfSUQ9MTEzMzkxMjgwMDE2OTIzMzd-OTk5OX4wJkFVQ1RJT05fU0VBVF9JRD05OTk5JkFVQ1RJT05fSU1QX0lEPXYyZGE3MzIyYjJkZjYxZi02NDB4NDgwJkFDVE9SX1JFRj1ha2thLnRjcDovL2F3cy1lYXN0MUBhZHMxMy5jYXAtdXNlMS5zeW5hY29yLmNvbToyNTUxL3VzZXIvJGNMYmZiIy0xOTk4NTIzNTk3JlNFQVRfSUQ9cHJlYmlk&AUCTION_PRICE=${AUCTION_PRICE}</VASTAdTagURI>\n</Wrapper>\n</Ad>\n</VAST>',
adomain: [ 'psacentral.org' ],
adomain: ['psacentral.org'],
cid: 'bidder-crid',
crid: 'bidder-cid',
cat: [],
Expand All @@ -867,7 +867,6 @@ describe('synacormediaBidAdapter ', function () {
expect(resp).to.be.an('array').to.have.lengthOf(1);
expect(resp[0]).to.eql({
requestId: '2da7322b2df61f',
adId: '11339128001692337-9999-0',
cpm: 0.45,
width: 640,
height: 480,
Expand All @@ -888,7 +887,6 @@ describe('synacormediaBidAdapter ', function () {
expect(resp).to.be.an('array').to.have.lengthOf(1);
expect(resp[0]).to.eql({
requestId: '9876abcd',
adId: '10865933907263896-9998-0',
cpm: 0.13,
width: 300,
height: 250,
Expand All @@ -911,7 +909,6 @@ describe('synacormediaBidAdapter ', function () {
expect(resp).to.be.an('array').to.have.lengthOf(2);
expect(resp[0]).to.eql({
requestId: '9876abcd',
adId: '10865933907263896-9998-0',
cpm: 0.13,
width: 300,
height: 250,
Expand All @@ -925,7 +922,6 @@ describe('synacormediaBidAdapter ', function () {

expect(resp[1]).to.eql({
requestId: '9876abcd',
adId: '10865933907263800-9999-0',
cpm: 1.99,
width: 300,
height: 600,
Expand Down Expand Up @@ -962,7 +958,7 @@ describe('synacormediaBidAdapter ', function () {
price: 0.45,
nurl: 'https://uat-net.technoratimedia.com/openrtb/tags?ID=QVVDVElPTl9JRD1lOTBhYWU1My1hZDkwLTRkNDEtYTQxMC1lZDY1MjIxMDc0ZGMmQVVDVElPTl9CSURfSUQ9MTEzMzkxMjgwMDE2OTIzMzd-OTk5OX4wJkFVQ1RJT05fU0VBVF9JRD05OTk5JkFVQ1RJT05fSU1QX0lEPXYyZGE3MzIyYjJkZjYxZi02NDB4NDgwJkFDVE9SX1JFRj1ha2thLnRjcDovL2F3cy1lYXN0MUBhZHMxMy5jYXAtdXNlMS5zeW5hY29yLmNvbToyNTUxL3VzZXIvJGNMYmZiIy0xOTk4NTIzNTk3JlNFQVRfSUQ9cHJlYmlk&AUCTION_PRICE=${AUCTION_PRICE}',
adm: '<?xml version="1.0" encoding="UTF-8"?>\n<VAST version="3.0">\n<Ad id="11339128001692337~9999~0">\n<Wrapper>\n<AdSystem>Synacor Media Ad Server - 9999</AdSystem>\n<VASTAdTagURI>https://uat-net.technoratimedia.com/openrtb/tags?ID=QVVDVElPTl9JRD1lOTBhYWU1My1hZDkwLTRkNDEtYTQxMC1lZDY1MjIxMDc0ZGMmQVVDVElPTl9CSURfSUQ9MTEzMzkxMjgwMDE2OTIzMzd-OTk5OX4wJkFVQ1RJT05fU0VBVF9JRD05OTk5JkFVQ1RJT05fSU1QX0lEPXYyZGE3MzIyYjJkZjYxZi02NDB4NDgwJkFDVE9SX1JFRj1ha2thLnRjcDovL2F3cy1lYXN0MUBhZHMxMy5jYXAtdXNlMS5zeW5hY29yLmNvbToyNTUxL3VzZXIvJGNMYmZiIy0xOTk4NTIzNTk3JlNFQVRfSUQ9cHJlYmlk&AUCTION_PRICE=${AUCTION_PRICE}</VASTAdTagURI>\n</Wrapper>\n</Ad>\n</VAST>',
adomain: [ 'psacentral.org' ],
adomain: ['psacentral.org'],
cid: 'bidder-crid',
crid: 'bidder-cid',
cat: [],
Expand All @@ -984,8 +980,8 @@ describe('synacormediaBidAdapter ', function () {
});

let resp = spec.interpretResponse(serverRespVideo, bidRequest);
sandbox.restore();
expect(resp[0].videoCacheKey).to.not.exist;
sandbox.restore();
expect(resp[0].videoCacheKey).to.not.exist;
});

it('should use video bid request height and width if not present in response', function () {
Expand Down Expand Up @@ -1022,7 +1018,7 @@ describe('synacormediaBidAdapter ', function () {
price: 0.45,
nurl: 'https://uat-net.technoratimedia.com/openrtb/tags?ID=QVVDVElPTl9JRD1lOTBhYWU1My1hZDkwLTRkNDEtYTQxMC1lZDY1MjIxMDc0ZGMmQVVDVElPTl9CSURfSUQ9MTEzMzkxMjgwMDE2OTIzMzd-OTk5OX4wJkFVQ1RJT05fU0VBVF9JRD05OTk5JkFVQ1RJT05fSU1QX0lEPXYyZGE3MzIyYjJkZjYxZi02NDB4NDgwJkFDVE9SX1JFRj1ha2thLnRjcDovL2F3cy1lYXN0MUBhZHMxMy5jYXAtdXNlMS5zeW5hY29yLmNvbToyNTUxL3VzZXIvJGNMYmZiIy0xOTk4NTIzNTk3JlNFQVRfSUQ9cHJlYmlk&AUCTION_PRICE=${AUCTION_PRICE}',
adm: '<?xml version="1.0" encoding="UTF-8"?>\n<VAST version="3.0">\n<Ad id="11339128001692337~9999~0">\n<Wrapper>\n<AdSystem>Synacor Media Ad Server - 9999</AdSystem>\n<VASTAdTagURI>https://uat-net.technoratimedia.com/openrtb/tags?ID=QVVDVElPTl9JRD1lOTBhYWU1My1hZDkwLTRkNDEtYTQxMC1lZDY1MjIxMDc0ZGMmQVVDVElPTl9CSURfSUQ9MTEzMzkxMjgwMDE2OTIzMzd-OTk5OX4wJkFVQ1RJT05fU0VBVF9JRD05OTk5JkFVQ1RJT05fSU1QX0lEPXYyZGE3MzIyYjJkZjYxZi02NDB4NDgwJkFDVE9SX1JFRj1ha2thLnRjcDovL2F3cy1lYXN0MUBhZHMxMy5jYXAtdXNlMS5zeW5hY29yLmNvbToyNTUxL3VzZXIvJGNMYmZiIy0xOTk4NTIzNTk3JlNFQVRfSUQ9cHJlYmlk&AUCTION_PRICE=${AUCTION_PRICE}</VASTAdTagURI>\n</Wrapper>\n</Ad>\n</VAST>',
adomain: [ 'psacentral.org' ],
adomain: ['psacentral.org'],
cid: 'bidder-crid',
crid: 'bidder-cid',
cat: []
Expand All @@ -1037,7 +1033,6 @@ describe('synacormediaBidAdapter ', function () {
expect(resp).to.be.an('array').to.have.lengthOf(1);
expect(resp[0]).to.eql({
requestId: '2da7322b2df61f',
adId: '11339128001692337-9999-0',
cpm: 0.45,
width: 300,
height: 250,
Expand Down Expand Up @@ -1090,7 +1085,6 @@ describe('synacormediaBidAdapter ', function () {
expect(resp).to.be.an('array').to.have.lengthOf(1);
expect(resp[0]).to.eql({
requestId: 'abc123',
adId: '10865933907263896-9998-0',
cpm: 0.13,
width: 400,
height: 350,
Expand Down