From ea8692c4a9f6e34e1bf93c5877b170f87e79ebf8 Mon Sep 17 00:00:00 2001 From: asurovenko-zeta <80847074+asurovenko-zeta@users.noreply.github.com> Date: Mon, 15 Apr 2024 19:36:18 +0200 Subject: [PATCH] ZetaGlobalSsp Bid Adapter: modify timeout object (#11236) * ZetaGlobalSsp Adapter: modify onTimeout object * - * fix unit test --------- Co-authored-by: Surovenko Alexey Co-authored-by: Alexey Surovenko --- modules/zeta_global_sspBidAdapter.js | 9 ++++++++- test/spec/modules/zeta_global_sspBidAdapter_spec.js | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/zeta_global_sspBidAdapter.js b/modules/zeta_global_sspBidAdapter.js index 722c51dc058..f3e2e12c143 100644 --- a/modules/zeta_global_sspBidAdapter.js +++ b/modules/zeta_global_sspBidAdapter.js @@ -272,7 +272,14 @@ export const spec = { onTimeout: function(timeoutData) { if (timeoutData) { - ajax(TIMEOUT_URL, null, JSON.stringify(timeoutData), { + const payload = timeoutData.map(d => ({ + bidder: d?.bidder, + shortname: d?.params?.map(p => p?.tags?.shortname).find(p => p), + sid: d?.params?.map(p => p?.sid).find(p => p), + country: d?.ortb2?.device?.geo?.country, + devicetype: d?.ortb2?.device?.devicetype + })); + ajax(TIMEOUT_URL, null, JSON.stringify(payload), { method: 'POST', options: { withCredentials: false, diff --git a/test/spec/modules/zeta_global_sspBidAdapter_spec.js b/test/spec/modules/zeta_global_sspBidAdapter_spec.js index f9cfe2dde6a..7b5c0278019 100644 --- a/test/spec/modules/zeta_global_sspBidAdapter_spec.js +++ b/test/spec/modules/zeta_global_sspBidAdapter_spec.js @@ -544,7 +544,7 @@ describe('Zeta Ssp Bid Adapter', function () { it('Timeout should exists and be a function', function () { expect(spec.onTimeout).to.exist.and.to.be.a('function'); - expect(spec.onTimeout({ timeout: 1000 })).to.be.undefined; + expect(spec.onTimeout([{bidder: '1'}])).to.be.undefined; }); it('Test schain provided', function () {