Skip to content

Commit

Permalink
add bidder fluct (#8016)
Browse files Browse the repository at this point in the history
  • Loading branch information
eknis authored Feb 9, 2022
1 parent fd32042 commit 81eae0b
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
10 changes: 10 additions & 0 deletions modules/imRtdProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ export function getBidderFunction(bidderName) {
);
}
return bid
},
fluct: function (bid, data) {
if (data.im_segments && data.im_segments.length) {
deepSetValue(
bid,
'params.kv.imsids',
data.im_segments
);
}
return bid
}
}
return biddersFunction[bidderName] || null;
Expand Down
31 changes: 30 additions & 1 deletion test/spec/modules/imRtdProvider_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ describe('imRtdProvider', function () {
describe('getBidderFunction', function () {
const assumedBidder = [
'ix',
'pubmatic'
'pubmatic',
'fluct'
];
assumedBidder.forEach(bidderName => {
it(`should return bidderFunction with assumed bidder: ${bidderName}`, function () {
Expand All @@ -70,6 +71,34 @@ describe('imRtdProvider', function () {
it(`should return null with unexpected bidder`, function () {
expect(getBidderFunction('test')).to.equal(null);
});
describe('fluct bidder function', function () {
it('should return a bid w/o im_segments if not any exists', function () {
const bid = {bidder: 'fluct'};
expect(getBidderFunction('fluct')(bid, '')).to.eql(bid);
});
it('should return a bid w/ im_segments if any exists', function () {
const bid = {
bidder: 'fluct',
params: {
kv: {
foo: ['foo1']
}
}
};
expect(getBidderFunction('fluct')(bid, {im_segments: ['12345', '67890']}))
.to.eql(
{
bidder: 'fluct',
params: {
kv: {
foo: ['foo1'],
imsids: ['12345', '67890']
}
}
}
);
});
});
})

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

0 comments on commit 81eae0b

Please sign in to comment.