From 4d6cd54621cd4aef34c4fa5f6661cdf415c52f19 Mon Sep 17 00:00:00 2001 From: Martin Altunyan Date: Tue, 6 Feb 2024 11:25:58 -0800 Subject: [PATCH] Fix for the multi-size in- slot --- modules/gumgumBidAdapter.js | 4 ++-- test/spec/modules/gumgumBidAdapter_spec.js | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/modules/gumgumBidAdapter.js b/modules/gumgumBidAdapter.js index 15af94494a3..53fdc5bba36 100644 --- a/modules/gumgumBidAdapter.js +++ b/modules/gumgumBidAdapter.js @@ -553,10 +553,10 @@ function interpretResponse(serverResponse, bidRequest) { sizes = [`${maxw}x${maxh}`]; } else if (product === 5 && includes(sizes, '1x1')) { sizes = ['1x1']; - } else if (product === 2 && includes(sizes, '1x1')) { + } else if ((product === 2 && includes(sizes, '1x1')) || product === 3) { const requestSizesThatMatchResponse = (bidRequest.sizes && bidRequest.sizes.reduce((result, current) => { const [ width, height ] = current; - if (responseWidth === width || responseHeight === height) result.push(current.join('x')); + if (responseWidth === width && responseHeight === height) result.push(current.join('x')); return result }, [])) || []; sizes = requestSizesThatMatchResponse.length ? requestSizesThatMatchResponse : parseSizesInput(bidRequest.sizes) diff --git a/test/spec/modules/gumgumBidAdapter_spec.js b/test/spec/modules/gumgumBidAdapter_spec.js index e0529a895f5..52cfd0294e7 100644 --- a/test/spec/modules/gumgumBidAdapter_spec.js +++ b/test/spec/modules/gumgumBidAdapter_spec.js @@ -880,6 +880,19 @@ describe('gumgumAdapter', function () { expect(result.height = expectedSize[1]); }) + it('request size that matches response size for in-slot', function () { + const request = { ...bidRequest }; + const body = { ...serverResponse }; + const expectedSize = [[ 320, 50 ], [300, 600], [300, 250]]; + let result; + request.pi = 3; + body.ad.width = 300; + body.ad.height = 600; + result = spec.interpretResponse({ body }, request)[0]; + expect(result.width = expectedSize[1][0]); + expect(result.height = expectedSize[1][1]); + }) + it('defaults to use bidRequest sizes', function () { const { ad, jcsi, pag, thms, meta } = serverResponse const noAdSizes = { ...ad }