Skip to content

Commit

Permalink
IronSource Bid Adapter: add session_id & is_wrapper params to adapter (
Browse files Browse the repository at this point in the history
…#6408)

* add new params

* add unit tests for isWrapper and sessionId adapter params
  • Loading branch information
lasloche authored Mar 15, 2021
1 parent 4b0779a commit da78728
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/ironsourceBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ function generateParameters(bid, bidderRequest) {
bid_id: utils.getBidIdParameter('bidId', bid),
bidder_request_id: utils.getBidIdParameter('bidderRequestId', bid),
transaction_id: utils.getBidIdParameter('transactionId', bid),
session_id: utils.getBidIdParameter('auctionId', bid),
session_id: params.sessionId || utils.getBidIdParameter('auctionId', bid),
is_wrapper: !!params.isWrapper,
publisher_name: domain,
site_domain: domain,
bidder_version: BIDDER_VERSION
Expand Down
18 changes: 18 additions & 0 deletions test/spec/modules/ironsourceBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ describe('ironsourceAdapter', function () {
bidderCode: 'ironsource',
}

const customSessionId = '12345678';

it('sends bid request to ENDPOINT via GET', function () {
const requests = spec.buildRequests(bidRequests, bidderRequest);
for (const request of requests) {
Expand All @@ -98,6 +100,22 @@ describe('ironsourceAdapter', function () {
}
});

it('sends the is_wrapper query param', function () {
bidRequests[0].params.isWrapper = true;
const requests = spec.buildRequests(bidRequests, bidderRequest);
for (const request of requests) {
expect(request.data.is_wrapper).to.equal(true);
}
});

it('sends the custom session id as a query param', function () {
bidRequests[0].params.sessionId = customSessionId;
const requests = spec.buildRequests(bidRequests, bidderRequest);
for (const request of requests) {
expect(request.data.session_id).to.equal(customSessionId);
}
});

it('should send the correct width and height', function () {
const requests = spec.buildRequests(bidRequests, bidderRequest);
for (const request of requests) {
Expand Down

0 comments on commit da78728

Please sign in to comment.