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

Concert Bid Adapter: Add dealId Property to Bid Responses #22

Merged
merged 4 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion modules/concertBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ export const spec = {
meta: { advertiserDomains: bid && bid.adomain ? bid.adomain : [] },
creativeId: bid.creativeId,
netRevenue: bid.netRevenue,
currency: bid.currency
currency: bid.currency,
...(bid.dealid && { dealId: bid.dealid }),
};
});

Expand Down
16 changes: 16 additions & 0 deletions test/spec/modules/concertBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,22 @@ describe('ConcertAdapter', function () {
});
});

it('should include dealId when present in bidResponse', function() {
const bids = spec.interpretResponse({
body: {
bids: [
{ ...bidResponse.body.bids[0], dealid: 'CON-123' }
]
}
}, bidRequest);
expect(bids[0]).to.have.property('dealId');
});

it('should exclude dealId when absent in bidResponse', function() {
const bids = spec.interpretResponse(bidResponse, bidRequest);
expect(bids[0]).to.not.have.property('dealId');
});

it('should return empty bids if there is no response from server', function() {
const bids = spec.interpretResponse({ body: null }, bidRequest);
expect(bids).to.have.lengthOf(0);
Expand Down