Skip to content

Commit

Permalink
fix rename event to plural form
Browse files Browse the repository at this point in the history
  • Loading branch information
idettman committed Jun 1, 2020
1 parent d7fdd68 commit 666e07f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions modules/prebidServerBidAdapter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -714,8 +714,8 @@ const OPEN_RTB_PROTOCOL = {
}

// store wurl by auctionId and adId so it can be accessed from the BID_WON event handler
if (utils.isStr(utils.deepAccess(bid, 'ext.prebid.event.win'))) {
addWurl(bidRequest.auctionId, bidObject.adId, utils.deepAccess(bid, 'ext.prebid.event.win'));
if (utils.isStr(utils.deepAccess(bid, 'ext.prebid.events.win'))) {
addWurl(bidRequest.auctionId, bidObject.adId, utils.deepAccess(bid, 'ext.prebid.events.win'));
}

let extPrebidTargeting = utils.deepAccess(bid, 'ext.prebid.targeting');
Expand All @@ -725,7 +725,7 @@ const OPEN_RTB_PROTOCOL = {
// once we get through the transition, this block will be removed.
if (utils.isPlainObject(extPrebidTargeting)) {
// If wurl exists, remove hb_winurl and hb_bidid targeting attributes
if (utils.isStr(utils.deepAccess(bid, 'ext.prebid.event.win'))) {
if (utils.isStr(utils.deepAccess(bid, 'ext.prebid.events.win'))) {
extPrebidTargeting = utils.getDefinedParams(extPrebidTargeting, Object.keys(extPrebidTargeting)
.filter(i => (i.indexOf('hb_winurl') === -1 && i.indexOf('hb_bidid') === -1)));
}
Expand Down
8 changes: 4 additions & 4 deletions test/spec/modules/prebidServerBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1778,7 +1778,7 @@ describe('S2S Adapter', function () {
config.setConfig({ s2sConfig });
const cacheResponse = utils.deepClone(RESPONSE_OPENRTB_VIDEO);
cacheResponse.seatbid.forEach(item => {
item.bid[0].ext.prebid.event = {
item.bid[0].ext.prebid.events = {
win: 'https://wurl.com?a=1&b=2'
};
item.bid[0].ext.prebid.targeting = {
Expand Down Expand Up @@ -1885,7 +1885,7 @@ describe('S2S Adapter', function () {

it('should call triggerPixel if wurl is defined', function () {
const clonedResponse = utils.deepClone(RESPONSE_OPENRTB);
clonedResponse.seatbid[0].bid[0].ext.prebid.event = {
clonedResponse.seatbid[0].bid[0].ext.prebid.events = {
win: 'https://wurl.org'
};

Expand All @@ -1904,7 +1904,7 @@ describe('S2S Adapter', function () {

it('should not call triggerPixel if the wurl cache does not contain the winning bid', function () {
const clonedResponse = utils.deepClone(RESPONSE_OPENRTB);
clonedResponse.seatbid[0].bid[0].ext.prebid.event = {
clonedResponse.seatbid[0].bid[0].ext.prebid.events = {
win: 'https://wurl.org'
};

Expand All @@ -1922,7 +1922,7 @@ describe('S2S Adapter', function () {

it('should not call triggerPixel if wurl is undefined', function () {
const clonedResponse = utils.deepClone(RESPONSE_OPENRTB);
clonedResponse.seatbid[0].bid[0].ext.prebid.event = {};
clonedResponse.seatbid[0].bid[0].ext.prebid.events = {};

adapter.callBids(REQUEST, BID_REQUESTS, addBidResponse, done, ajax);
server.requests[0].respond(200, {}, JSON.stringify(clonedResponse));
Expand Down

0 comments on commit 666e07f

Please sign in to comment.