Skip to content

Commit

Permalink
Revert "SAS Bid Adapter: Fledge support (#11348)" (#11349)
Browse files Browse the repository at this point in the history
This reverts commit 2307f93.
  • Loading branch information
krzysztofequativ authored Apr 16, 2024
1 parent 524617d commit 44e8e9f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 80 deletions.
16 changes: 1 addition & 15 deletions modules/smartadserverBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,6 @@ export const spec = {
payload.us_privacy = bidderRequest.uspConsent;
}

const ae = deepAccess(bid, 'ortb2Imp.ext.ae');
if (bidderRequest && bidderRequest.fledgeEnabled && ae) {
payload.ae = ae;
}

const bannerMediaType = deepAccess(bid, 'mediaTypes.banner');
const videoMediaType = deepAccess(bid, 'mediaTypes.video');
const isSupportedVideoContext = videoMediaType && (videoMediaType.context === 'instream' || videoMediaType.context === 'outstream');
Expand Down Expand Up @@ -271,7 +266,7 @@ export const spec = {
*/
interpretResponse: function (serverResponse, bidRequestString) {
const bidResponses = [];
const response = serverResponse.body;
let response = serverResponse.body;
try {
if (response && !response.isNoAd && (response.ad || response.adUrl)) {
const bidRequest = JSON.parse(bidRequestString.data);
Expand Down Expand Up @@ -301,19 +296,10 @@ export const spec = {
}

bidResponses.push(bidResponse);

const fledgeAuctionConfigs = response.auctionConfigs;
if (fledgeAuctionConfigs && Array.isArray(fledgeAuctionConfigs)) {
return {
bids: bidResponses,
fledgeAuctionConfigs
};
}
}
} catch (error) {
logError('Error while parsing smart server response', error);
}

return bidResponses;
},

Expand Down
65 changes: 0 additions & 65 deletions test/spec/modules/smartadserverBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,27 +458,6 @@ describe('Smart bid adapter tests', function () {
expect(syncs).to.have.lengthOf(0);
});

it('Verify auctionConfigs', function () {
const request = spec.buildRequests(DEFAULT_PARAMS);
const auctionConfigs = [{
bidId: '02g93e54w9ps',
config: {
decisionLogicUrl: 'https://seller.sas.com/decision_logic.js',
interestGroupBuyers: ['https://buyer.sas.com'],
seller: 'https://seller.sas.com'
}
}];
const bids = spec.interpretResponse({
body: {
...BID_RESPONSE.body,
auctionConfigs
}
}, request[0]);

expect(bids).to.have.property('bids').and.to.satisfy(value => (value === null || Array.isArray(value)));
expect(bids.fledgeAuctionConfigs).to.be.an('array').and.to.deep.equal(auctionConfigs);
});

describe('gdpr tests', function () {
afterEach(function () {
config.setConfig({ ortb2: undefined });
Expand Down Expand Up @@ -1526,50 +1505,6 @@ describe('Smart bid adapter tests', function () {
});
});

describe('Fledge for GPT', function () {
it('should send fledge eligibility flag when fledge enabled and ortb2Imp.ext.ae set', function () {
const bidRequests = deepClone(DEFAULT_PARAMS_WO_OPTIONAL);
const ae = {
ae: 1
};

bidRequests[0].ortb2Imp = {
ext: ae
};

const request = spec.buildRequests(bidRequests, {
fledgeEnabled: true
});
const requestContent = JSON.parse(request[0].data);

expect(requestContent).to.have.property('ae').and.to.equal(ae.ae);
});

it('should not send fledge eligibility flag when fledge not enabled', function () {
const bidRequests = deepClone(DEFAULT_PARAMS_WO_OPTIONAL);
bidRequests[0].ortb2Imp = {
ext: {
ae: 1
}
};

const request = spec.buildRequests(bidRequests);
const requestContent = JSON.parse(request[0].data);

expect(requestContent).to.not.have.property('ae');
});

it('should not send fledge eligibility flag when ortb2Imp.ext.ae not set', function () {
const bidRequests = deepClone(DEFAULT_PARAMS_WO_OPTIONAL);
const request = spec.buildRequests(bidRequests, {
fledgeEnabled: true
});
const requestContent = JSON.parse(request[0].data);

expect(requestContent).to.not.have.property('ae');
});
});

describe('#getValuableProperty method', function () {
it('should return an object when calling with a number value', () => {
const obj = spec.getValuableProperty('prop', 3);
Expand Down

0 comments on commit 44e8e9f

Please sign in to comment.