Skip to content

Commit

Permalink
Supporting placement parameter and logging warning message, for the p…
Browse files Browse the repository at this point in the history
…lcmt parameter, if it is missing.
  • Loading branch information
pm-nitin-shirsat committed May 24, 2024
1 parent 70b6e36 commit a3667c1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/pubmaticBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const VIDEO_CUSTOM_PARAMS = {
'h': DATA_TYPES.NUMBER,
'battr': DATA_TYPES.ARRAY,
'linearity': DATA_TYPES.NUMBER,
// 'placement': DATA_TYPES.NUMBER,
'placement': DATA_TYPES.NUMBER,
'plcmt': DATA_TYPES.NUMBER,
'minbitrate': DATA_TYPES.NUMBER,
'maxbitrate': DATA_TYPES.NUMBER,
Expand Down
11 changes: 9 additions & 2 deletions test/spec/modules/pubmaticBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ describe('PubMatic adapter', function () {
protocols: [2, 3],
battr: [13, 14],
linearity: 1,
placement: 2,
// plcmt: 2,
plcmt: 1,
minbitrate: 10,
Expand Down Expand Up @@ -169,6 +170,7 @@ describe('PubMatic adapter', function () {
h: 480,
battr: [13, 14],
linearity: 1,
placement: 2,
// plcmt: 2,
plcmt: 1,
minbitrate: 100,
Expand Down Expand Up @@ -394,6 +396,7 @@ describe('PubMatic adapter', function () {
h: 480,
battr: [13, 14],
linearity: 1,
placement: 2,
// plcmt: 2,
plcmt: 1,
minbitrate: 100,
Expand Down Expand Up @@ -522,6 +525,7 @@ describe('PubMatic adapter', function () {
h: 480,
battr: [13, 14],
linearity: 1,
placement: 2,
// plcmt: 2,
plcmt: 1,
minbitrate: 100,
Expand Down Expand Up @@ -593,6 +597,7 @@ describe('PubMatic adapter', function () {
h: 480,
battr: [13, 14],
linearity: 1,
placement: 2,
// plcmt: 2,
plcmt: 1,
minbitrate: 100,
Expand Down Expand Up @@ -2564,6 +2569,7 @@ describe('PubMatic adapter', function () {
expect(data.imp[1]['video']['battr'][1]).to.equal(multipleMediaRequests[1].params.video['battr'][1]);

expect(data.imp[1]['video']['linearity']).to.equal(multipleMediaRequests[1].params.video['linearity']);
expect(data.imp[1]['video']['placement']).to.equal(multipleMediaRequests[1].params.video['placement']);
expect(data.imp[1]['video']['plcmt']).to.equal(multipleMediaRequests[1].params.video['plcmt']);
expect(data.imp[1]['video']['minbitrate']).to.equal(multipleMediaRequests[1].params.video['minbitrate']);
expect(data.imp[1]['video']['maxbitrate']).to.equal(multipleMediaRequests[1].params.video['maxbitrate']);
Expand Down Expand Up @@ -2859,6 +2865,7 @@ describe('PubMatic adapter', function () {
expect(data.imp[0]['video']['battr'][1]).to.equal(videoBidRequests[0].params.video['battr'][1]);

expect(data.imp[0]['video']['linearity']).to.equal(videoBidRequests[0].params.video['linearity']);
expect(data.imp[0]['video']['placement']).to.equal(videoBidRequests[0].params.video['placement']);
expect(data.imp[0]['video']['plcmt']).to.equal(videoBidRequests[0].params.video['plcmt']);
expect(data.imp[0]['video']['minbitrate']).to.equal(videoBidRequests[0].params.video['minbitrate']);
expect(data.imp[0]['video']['maxbitrate']).to.equal(videoBidRequests[0].params.video['maxbitrate']);
Expand Down Expand Up @@ -4069,11 +4076,11 @@ describe('PubMatic adapter', function () {
sandbox.restore();
})

it('should log Video.Placement param missing', function() {
it('should log Video.plcmt param missing', function() {
checkVideoPlacement(videoData, adUnit);
sinon.assert.calledWith(utils.logWarn, msg_placement_missing);
})
it('shoud not log Video.Placement param missing', function() {
it('shoud not log Video.plcmt param missing', function() {
videoData['plcmt'] = 1;
checkVideoPlacement(videoData, adUnit);
sinon.assert.neverCalledWith(utils.logWarn, msg_placement_missing);
Expand Down

0 comments on commit a3667c1

Please sign in to comment.