-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PBS Bid Adapter : site should not exist when app is present (#9258)
* Update prebidServerBidAdapter_spec.js * Update prebidServerBidAdapter_spec.js * fix test * remove app from site test * add site/app/dooh function * fix config * remove deepSetValue * add to ortb converter * add check * add back publisher.id * fix linting * ortb conversion lib: leave only one of dooh, app, or site in the request Co-authored-by: Demetrio Girardi <dgirardi@prebid.org>
- Loading branch information
Showing
4 changed files
with
65 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import {onlyOneClientSection} from '../../../libraries/ortbConverter/processors/default.js'; | ||
|
||
describe('onlyOneClientSection', () => { | ||
[ | ||
[['app'], 'app'], | ||
[['site'], 'site'], | ||
[['dooh'], 'dooh'], | ||
[['app', 'site'], 'app'], | ||
[['dooh', 'app', 'site'], 'dooh'], | ||
[['dooh', 'site'], 'dooh'] | ||
].forEach(([sections, winner]) => { | ||
it(`should leave only ${winner} in request when it contains ${sections.join(', ')}`, () => { | ||
const req = Object.fromEntries(sections.map(s => [s, {foo: 'bar'}])); | ||
onlyOneClientSection(req); | ||
expect(Object.keys(req)).to.eql([winner]); | ||
}) | ||
}); | ||
it('should not choke if none of the sections are in the request', () => { | ||
const req = {}; | ||
onlyOneClientSection(req); | ||
expect(req).to.eql({}); | ||
}); | ||
}); |