Skip to content

Commit

Permalink
Fluct Bid Adapter: add schain support (prebid#9266)
Browse files Browse the repository at this point in the history
* add schain to req

* run circleci

Co-authored-by: Chris Huie <phoenixtechnerd@gmail.com>
  • Loading branch information
2 people authored and JacobKlein26 committed Feb 8, 2023
1 parent 71b2100 commit c680815
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
5 changes: 5 additions & 0 deletions modules/fluctBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ export const spec = {
});

data.params = request.params;

if (request.schain) {
data.schain = request.schain;
}

const searchParams = new URLSearchParams({
dfpUnitCode: request.params.dfpUnitCode,
tagId: request.params.tagId,
Expand Down
38 changes: 37 additions & 1 deletion test/spec/modules/fluctBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ describe('fluctAdapter', function () {
expect(request.data.params.kv).to.eql(undefined);
});

it('includes filtered user.eids if any exists', function () {
it('includes no data.schain by default', function () {
const request = spec.buildRequests(bidRequests, bidderRequest)[0];
expect(request.data.schain).to.eql(undefined);
});

it('includes filtered user.eids if any exist', function () {
const bidRequests2 = bidRequests.map(
(bidReq) => Object.assign(bidReq, {
userIdAsEids: [
Expand Down Expand Up @@ -175,6 +180,37 @@ describe('fluctAdapter', function () {
imsids: ['imsid1', 'imsid2']
});
});

it('includes data.schain if any exists', function () {
// this should be done by schain.js
const bidRequests2 = bidRequests.map(
(bidReq) => Object.assign(bidReq, {
schain: {
ver: '1.0',
complete: 1,
nodes: [
{
asi: 'example.com',
sid: 'publisher-id',
hp: 1
}
]
}
})
);
const request = spec.buildRequests(bidRequests2, bidderRequest)[0];
expect(request.data.schain).to.eql({
ver: '1.0',
complete: 1,
nodes: [
{
asi: 'example.com',
sid: 'publisher-id',
hp: 1
}
]
});
});
});

describe('interpretResponse', function() {
Expand Down

0 comments on commit c680815

Please sign in to comment.