-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
On set targeting #3203
On set targeting #3203
Conversation
src/auctionManager.js
Outdated
@@ -91,6 +91,9 @@ export function newAuctionManager() { | |||
auctionManager.setStatusForBids = function(adId, status) { | |||
let bid = auctionManager.findBidByAdId(adId); | |||
if (bid) bid.status = status; | |||
|
|||
const auction = find(_auctions, auction => auction.getAuctionId() === bid.auctionId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This setStatusForBids function could get called for other statuses someday. Calling setBidTargeting needs to be done only when status
is 'BID_TARGETING_SET'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Also need to consider how to add this to the unit tests. I can't find tests for the other event (onBidWon) in the spec files either, so we ought to add one for that too. Adding @jaiminpanchal27 for advise on unit tests. |
Added several tests for the following events: BidWon, SetTargeting, Timeout. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* Add onSetTargeting method to bid adapter spec * Reset context before each criteo adapter test * Add a unit test to check spec.onTimeout() is called * Add a unit test to check spec.onBidWon() is called * Add a unit test to check spec.onSetTargeting() is called * Remove unused adUnits argument from callSetTargetingBidder * Add integration test on onSetTargeting * Move Bid status constants from targeting.js to constants.json * Make sure onSetTargeting won't be called when the bid is not in status BID_TARGETING_SET
* Add onSetTargeting method to bid adapter spec * Reset context before each criteo adapter test * Add a unit test to check spec.onTimeout() is called * Add a unit test to check spec.onBidWon() is called * Add a unit test to check spec.onSetTargeting() is called * Remove unused adUnits argument from callSetTargetingBidder * Add integration test on onSetTargeting * Move Bid status constants from targeting.js to constants.json * Make sure onSetTargeting won't be called when the bid is not in status BID_TARGETING_SET
* Add onSetTargeting method to bid adapter spec * Reset context before each criteo adapter test * Add a unit test to check spec.onTimeout() is called * Add a unit test to check spec.onBidWon() is called * Add a unit test to check spec.onSetTargeting() is called * Remove unused adUnits argument from callSetTargetingBidder * Add integration test on onSetTargeting * Move Bid status constants from targeting.js to constants.json * Make sure onSetTargeting won't be called when the bid is not in status BID_TARGETING_SET
Type of change
Description of change
Add onSetTargeting method to bid adapter spec
Corresponding change for prebid.org: prebid/prebid.github.io#1008