From f6c3be070d65945b03e4a98f052790d7b63de774 Mon Sep 17 00:00:00 2001 From: Demetrio Girardi Date: Fri, 20 May 2022 11:25:01 -0700 Subject: [PATCH] convert bidders: livewrapped --- modules/livewrappedBidAdapter.js | 3 +-- test/spec/modules/livewrappedBidAdapter_spec.js | 17 ++--------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/modules/livewrappedBidAdapter.js b/modules/livewrappedBidAdapter.js index 34773e31a37..104ff667fcb 100644 --- a/modules/livewrappedBidAdapter.js +++ b/modules/livewrappedBidAdapter.js @@ -276,8 +276,7 @@ function handleEids(bidRequests) { } function getTopWindowLocation(bidderRequest) { - let url = bidderRequest && bidderRequest.refererInfo && bidderRequest.refererInfo.referer; - return config.getConfig('pageUrl') || url; + return bidderRequest?.refererInfo?.page; } function getAppBundle() { diff --git a/test/spec/modules/livewrappedBidAdapter_spec.js b/test/spec/modules/livewrappedBidAdapter_spec.js index 5d031d5b948..a4fee5e3b26 100644 --- a/test/spec/modules/livewrappedBidAdapter_spec.js +++ b/test/spec/modules/livewrappedBidAdapter_spec.js @@ -758,9 +758,9 @@ describe('Livewrapped adapter tests', function () { expect(data).to.deep.equal(expectedQuery); }); - it('should use params.url, then config pageUrl, then bidderRequest.refererInfo.referer', function() { + it('should use params.url, then bidderRequest.refererInfo.page', function() { let testRequest = clone(bidderRequest); - testRequest.refererInfo = {referer: 'https://www.topurl.com'}; + testRequest.refererInfo = {page: 'https://www.topurl.com'}; let result = spec.buildRequests(testRequest.bids, testRequest); let data = JSON.parse(result.data); @@ -773,19 +773,6 @@ describe('Livewrapped adapter tests', function () { data = JSON.parse(result.data); expect(data.url).to.equal('https://www.topurl.com'); - - let origGetConfig = config.getConfig; - sandbox.stub(config, 'getConfig').callsFake(function (key) { - if (key === 'pageUrl') { - return 'https://www.configurl.com'; - } - return origGetConfig.apply(config, arguments); - }); - - result = spec.buildRequests(testRequest.bids, testRequest); - data = JSON.parse(result.data); - - expect(data.url).to.equal('https://www.configurl.com'); }); it('should make use of pubcid if available', function() {