From a258e6f40aade66e54479ea97d30b2293f9f7c0e Mon Sep 17 00:00:00 2001 From: Mikhail Malkov Date: Tue, 24 Dec 2024 22:33:59 +0300 Subject: [PATCH 1/3] PB-2866 - added position to imp --- modules/nextMillenniumBidAdapter.js | 8 ++++ .../modules/nextMillenniumBidAdapter_spec.js | 40 ++++++++++++++++++- 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/modules/nextMillenniumBidAdapter.js b/modules/nextMillenniumBidAdapter.js index a4169947e85..182e336a506 100644 --- a/modules/nextMillenniumBidAdapter.js +++ b/modules/nextMillenniumBidAdapter.js @@ -315,6 +315,8 @@ export function getImpBanner(imp, banner) { h, format, }; + + setImpPos(imp.banner, banner?.pos); }; export function getImpVideo(imp, video) { @@ -336,6 +338,12 @@ export function getImpVideo(imp, video) { imp.video.w = video.data.w; imp.video.h = video.data.h; }; + + setImpPos(imp.video, video?.pos); +}; + +export function setImpPos(obj, pos) { + if (typeof pos === 'number' && pos >= 0 && pos <= 7) obj.pos = pos; }; export function setConsentStrings(postBody = {}, bidderRequest) { diff --git a/test/spec/modules/nextMillenniumBidAdapter_spec.js b/test/spec/modules/nextMillenniumBidAdapter_spec.js index bfcf7e80420..c7fabd562c7 100644 --- a/test/spec/modules/nextMillenniumBidAdapter_spec.js +++ b/test/spec/modules/nextMillenniumBidAdapter_spec.js @@ -1,6 +1,7 @@ import { expect } from 'chai'; import { getImp, + setImpPos, getSourceObj, replaceUsersyncMacros, setConsentStrings, @@ -28,6 +29,7 @@ describe('nextMillenniumBidAdapterTests', () => { data: {sizes: [[300, 250], [320, 250]]}, bidfloorcur: 'EUR', bidfloor: 1.11, + pos: 3, }, }, }, @@ -37,7 +39,12 @@ describe('nextMillenniumBidAdapterTests', () => { bidfloorcur: 'EUR', bidfloor: 1.11, ext: {prebid: {storedrequest: {id: '123'}}}, - banner: {w: 300, h: 250, format: [{w: 300, h: 250}, {w: 320, h: 250}]}, + banner: { + pos: 3, + w: 300, + h: 250, + format: [{w: 300, h: 250}, {w: 320, h: 250}], + }, }, }, @@ -56,6 +63,7 @@ describe('nextMillenniumBidAdapterTests', () => { video: { data: {playerSize: [400, 300], api: [2], placement: 1, plcmt: 1}, bidfloorcur: 'USD', + pos: 0, }, }, }, @@ -71,6 +79,7 @@ describe('nextMillenniumBidAdapterTests', () => { plcmt: 1, w: 400, h: 300, + pos: 0, }, }, }, @@ -177,6 +186,35 @@ describe('nextMillenniumBidAdapterTests', () => { } }); + describe('function setImpPos', () => { + const tests = [ + { + title: 'position is - 1', + pos: 0, + expected: {pos: 0}, + }, + + { + title: 'position is - 2', + pos: 7, + expected: {pos: 7}, + }, + + { + title: 'position is empty', + expected: {}, + }, + ]; + + for (const {title, pos, expected} of tests) { + it(title, () => { + const obj = {}; + setImpPos(obj, pos); + expect(obj).to.deep.equal(expected); + }); + }; + }); + describe('function getSourceObj', () => { const dataTests = [ { From feca7239355478ea230974ca1463ada0b9711d06 Mon Sep 17 00:00:00 2001 From: Mikhail Malkov Date: Tue, 24 Dec 2024 22:37:01 +0300 Subject: [PATCH 2/3] PB-2866 - added position to imp --- modules/nextMillenniumBidAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nextMillenniumBidAdapter.js b/modules/nextMillenniumBidAdapter.js index 182e336a506..bbfe56aa404 100644 --- a/modules/nextMillenniumBidAdapter.js +++ b/modules/nextMillenniumBidAdapter.js @@ -21,7 +21,7 @@ import {config} from '../src/config.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; import {getRefererInfo} from '../src/refererDetection.js'; -const NM_VERSION = '4.2.1'; +const NM_VERSION = '4.3.0'; const PBJS_VERSION = 'v$prebid.version$'; const GVLID = 1060; const BIDDER_CODE = 'nextMillennium'; From c8623ec2d65901fdb8ba07f247ba183bf28da096 Mon Sep 17 00:00:00 2001 From: Mikhail Malkov Date: Wed, 25 Dec 2024 00:04:23 +0300 Subject: [PATCH 3/3] PB-2866 - added position to imp - 2 --- modules/nextMillenniumBidAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nextMillenniumBidAdapter.js b/modules/nextMillenniumBidAdapter.js index bbfe56aa404..6e1443b85e5 100644 --- a/modules/nextMillenniumBidAdapter.js +++ b/modules/nextMillenniumBidAdapter.js @@ -308,7 +308,7 @@ export function getImpBanner(imp, banner) { if (banner.bidfloorcur) imp.bidfloorcur = banner.bidfloorcur; if (banner.bidfloor) imp.bidfloor = banner.bidfloor; - const format = (banner.data?.sizes || []).map(s => { return {w: s[0], h: s[1]} }) + const format = (banner.data?.sizes || []).map(s => { return {w: s[0], h: s[1]} }); const {w, h} = (format[0] || {}) imp.banner = { w,