Skip to content

Commit

Permalink
Yieldmo - Dont require params.video (#10467)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertrmartinez committed Sep 13, 2023
1 parent 550a7cb commit 51a2b9c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/yieldmoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,12 +432,12 @@ function openRtbImpression(bidRequest) {
}
};

const mediaTypesParams = deepAccess(bidRequest, 'mediaTypes.video');
const mediaTypesParams = deepAccess(bidRequest, 'mediaTypes.video', {});
Object.keys(mediaTypesParams)
.filter(param => includes(OPENRTB_VIDEO_BIDPARAMS, param))
.forEach(param => imp.video[param] = mediaTypesParams[param]);

const videoParams = deepAccess(bidRequest, 'params.video');
const videoParams = deepAccess(bidRequest, 'params.video', {});
Object.keys(videoParams)
.filter(param => includes(OPENRTB_VIDEO_BIDPARAMS, param))
.forEach(param => imp.video[param] = videoParams[param]);
Expand Down
12 changes: 12 additions & 0 deletions test/spec/modules/yieldmoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,18 @@ describe('YieldmoAdapter', function () {
expect(requests[0].url).to.be.equal(VIDEO_ENDPOINT);
});

it('should not require params.video if required props in mediaTypes.video', function () {
videoBid.mediaTypes.video = {
...videoBid.mediaTypes.video,
...videoBid.params.video
};
delete videoBid.params.video;
const requests = build([videoBid]);
expect(requests.length).to.equal(1);
expect(requests[0].method).to.equal('POST');
expect(requests[0].url).to.be.equal(VIDEO_ENDPOINT);
});

it('should add mediaTypes.video prop to the imp.video prop', function () {
utils.deepAccess(videoBid, 'mediaTypes.video')['minduration'] = 40;
expect(buildVideoBidAndGetVideoParam().minduration).to.equal(40);
Expand Down

0 comments on commit 51a2b9c

Please sign in to comment.