Skip to content

Commit

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

* add new params to rise adapter

* add unit tests for isWrapper and sessionId adapter params
  • Loading branch information
lasloche authored and seergiioo6 committed Mar 23, 2021
1 parent 1a47cd3 commit 0e7cbea
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/riseBidAdapter.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/riseBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ describe('riseAdapter', function () {
bidderCode: 'rise',
}

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 @@ -83,6 +85,22 @@ describe('riseAdapter', 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('sends bid request to test ENDPOINT via GET', function () {
const requests = spec.buildRequests(testModeBidRequests, bidderRequest);
for (const request of requests) {
Expand Down

0 comments on commit 0e7cbea

Please sign in to comment.