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

AcuityAds Bid Adapter: add endpointId param #12644

Merged
merged 15 commits into from
Jan 16, 2025
Merged
2 changes: 1 addition & 1 deletion modules/acuityadsBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const spec = {
gvlid: GVLID,
supportedMediaTypes: [BANNER, VIDEO, NATIVE],

isBidRequestValid: isBidRequestValid(['placementId']),
isBidRequestValid: isBidRequestValid(),
buildRequests: buildRequests(AD_URL),
interpretResponse,
getUserSyncs: getUserSyncs(SYNC_URL)
Expand Down
49 changes: 49 additions & 0 deletions test/spec/modules/acuityadsBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,55 @@ describe('AcuityAdsBidAdapter', function () {
}
});

it('Returns valid endpoints', function () {
const bids = [
{
bidId: getUniqueIdentifierStr(),
bidder: bidder,
mediaTypes: {
[BANNER]: {
sizes: [[300, 250]]
}
},
params: {
endpointId: 'testBanner',
},
userIdAsEids
}
];

let serverRequest = spec.buildRequests(bids, bidderRequest);

const { placements } = serverRequest.data;
for (let i = 0, len = placements.length; i < len; i++) {
const placement = placements[i];
expect(placement.endpointId).to.be.oneOf(['testBanner', 'testVideo', 'testNative']);
expect(placement.adFormat).to.be.oneOf([BANNER, VIDEO, NATIVE]);
expect(placement.bidId).to.be.a('string');
expect(placement.schain).to.be.an('object');
expect(placement.bidfloor).to.exist.and.to.equal(0);
expect(placement.type).to.exist.and.to.equal('network');
expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids);

if (placement.adFormat === BANNER) {
expect(placement.sizes).to.be.an('array');
}
switch (placement.adFormat) {
case BANNER:
expect(placement.sizes).to.be.an('array');
break;
case VIDEO:
expect(placement.playerSize).to.be.an('array');
expect(placement.minduration).to.be.an('number');
expect(placement.maxduration).to.be.an('number');
break;
case NATIVE:
expect(placement.native).to.be.an('object');
break;
}
}
});

it('Returns data with gdprConsent and without uspConsent', function () {
delete bidderRequest.uspConsent;
serverRequest = spec.buildRequests(bids, bidderRequest);
Expand Down
Loading