From 5620dff6ece81ea9ae4c32bba1b7addeaa7d6a58 Mon Sep 17 00:00:00 2001 From: Nick Jacob Date: Tue, 4 Oct 2022 11:28:00 -0400 Subject: [PATCH] empty string adUnitId parameter is treated as missing --- modules/amxBidAdapter.js | 2 +- test/spec/modules/amxBidAdapter_spec.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/amxBidAdapter.js b/modules/amxBidAdapter.js index c5ce3745526..d1bd2edeee4 100644 --- a/modules/amxBidAdapter.js +++ b/modules/amxBidAdapter.js @@ -147,7 +147,7 @@ function convertRequest(bid) { const tid = deepAccess(bid, 'params.tagId'); const au = - bid.params != null && typeof bid.params.adUnitId === 'string' + bid.params != null && typeof bid.params.adUnitId === 'string' && bid.params.adUnitId !== '' ? bid.params.adUnitId : bid.adUnitCode; diff --git a/test/spec/modules/amxBidAdapter_spec.js b/test/spec/modules/amxBidAdapter_spec.js index fe85e874c3b..d71e9ab5cba 100644 --- a/test/spec/modules/amxBidAdapter_spec.js +++ b/test/spec/modules/amxBidAdapter_spec.js @@ -359,6 +359,7 @@ describe('AmxBidAdapter', () => { bidId: sampleRequestId + '_2', params: { ...sampleBidRequestBase.params, + adUnitId: '', tagId: 'example', }, }, @@ -404,12 +405,12 @@ describe('AmxBidAdapter', () => { it('can build a video request', () => { const { data } = spec.buildRequests( - [sampleBidRequestVideo], + [{...sampleBidRequestVideo, params: { ...sampleBidRequestVideo.params, adUnitId: 'custom-auid' }}], sampleBidderRequest ); expect(Object.keys(data.m).length).to.equal(1); expect(data.m[sampleRequestId + '_video']).to.deep.equal({ - au: 'div-gpt-ad-example', + au: 'custom-auid', ms: [[[300, 150]], [], [[360, 250]]], av: true, aw: 360,