Skip to content

Commit

Permalink
convert bidders: livewrapped
Browse files Browse the repository at this point in the history
  • Loading branch information
dgirardi committed May 20, 2022
1 parent e2260b6 commit f6c3be0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
3 changes: 1 addition & 2 deletions modules/livewrappedBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
17 changes: 2 additions & 15 deletions test/spec/modules/livewrappedBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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() {
Expand Down

0 comments on commit f6c3be0

Please sign in to comment.