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

im Rtd Provider: add bidder fluct #8016

Merged
merged 1 commit into from
Feb 9, 2022
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
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