Skip to content

Commit

Permalink
Criteo Adapter: remove bid.adId (#8783)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzhang-criteo authored Aug 4, 2022
1 parent 35b4999 commit cdb290c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 39 deletions.
3 changes: 1 addition & 2 deletions modules/criteoBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { deepAccess, getUniqueIdentifierStr, isArray, logError, logInfo, logWarn, parseUrl } from '../src/utils.js';
import { deepAccess, isArray, logError, logInfo, logWarn, parseUrl } from '../src/utils.js';
import { loadExternalScript } from '../src/adloader.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import { config } from '../src/config.js';
Expand Down Expand Up @@ -235,7 +235,6 @@ export const spec = {
const bidId = bidRequest.bidId;
const bid = {
requestId: bidId,
adId: slot.bidId || getUniqueIdentifierStr(),
cpm: slot.cpm,
currency: slot.currency,
netRevenue: true,
Expand Down
37 changes: 0 additions & 37 deletions test/spec/modules/criteoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1310,7 +1310,6 @@ describe('The Criteo bidding adapter', function () {
const bids = spec.interpretResponse(response, request);
expect(bids).to.have.lengthOf(1);
expect(bids[0].requestId).to.equal('test-bidId');
expect(bids[0].adId).to.equal('abc123');
expect(bids[0].cpm).to.equal(1.23);
expect(bids[0].ad).to.equal('test-ad');
expect(bids[0].width).to.equal(728);
Expand Down Expand Up @@ -1344,7 +1343,6 @@ describe('The Criteo bidding adapter', function () {
const bids = spec.interpretResponse(response, request);
expect(bids).to.have.lengthOf(1);
expect(bids[0].requestId).to.equal('test-bidId');
expect(bids[0].adId).to.equal('abc123');
expect(bids[0].cpm).to.equal(1.23);
expect(bids[0].vastUrl).to.equal('http://test-ad');
expect(bids[0].mediaType).to.equal(VIDEO);
Expand Down Expand Up @@ -1401,7 +1399,6 @@ describe('The Criteo bidding adapter', function () {
const bids = spec.interpretResponse(response, request);
expect(bids).to.have.lengthOf(1);
expect(bids[0].requestId).to.equal('test-bidId');
expect(bids[0].adId).to.equal('abc123');
expect(bids[0].cpm).to.equal(1.23);
expect(bids[0].mediaType).to.equal(NATIVE);
});
Expand Down Expand Up @@ -1520,40 +1517,6 @@ describe('The Criteo bidding adapter', function () {
expect(bids[0].height).to.equal(90);
});

it('should generate unique adIds if none are returned by the endpoint', function () {
const response = {
body: {
slots: [{
impid: 'test-requestId',
cpm: 1.23,
creative: 'test-ad',
width: 300,
height: 250,
}, {
impid: 'test-requestId',
cpm: 4.56,
creative: 'test-ad',
width: 728,
height: 90,
}],
},
};
const request = {
bidRequests: [{
adUnitCode: 'test-requestId',
bidId: 'test-bidId',
sizes: [[300, 250], [728, 90]],
params: {
networkId: 456,
}
}]
};
const bids = spec.interpretResponse(response, request);
expect(bids).to.have.lengthOf(2);
const prebidBids = bids.map(bid => Object.assign(createBid(CONSTANTS.STATUS.GOOD, request.bidRequests[0]), bid));
expect(prebidBids[0].adId).to.not.equal(prebidBids[1].adId);
});

[{
hasBidResponseLevelPafData: true,
hasBidResponseBidLevelPafData: true,
Expand Down

0 comments on commit cdb290c

Please sign in to comment.