Skip to content

Commit

Permalink
PSEGS are now part of BPSEGS (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebrobert authored Sep 30, 2024
1 parent 4991e6e commit 476b736
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
3 changes: 1 addition & 2 deletions modules/beopBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ export const spec = {
nid: firstSlot.nid,
nptnid: firstSlot.nptnid,
pid: firstSlot.pid,
psegs: psegs,
bpsegs: (userBpSegs.concat(siteBpSegs)).map(item => item.toString()),
bpsegs: (userBpSegs.concat(siteBpSegs, psegs)).map(item => item.toString()),
url: pageUrl,
lang: (window.navigator.language || window.navigator.languages[0]),
kwds: keywords,
Expand Down
13 changes: 5 additions & 8 deletions test/spec/modules/beopBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ describe('BeOp Bid Adapter tests', () => {
expect(payload.url).to.equal('http://test.te');
});

it('should call the endpoint with psegs and bpsegs (stringified) data if any or [] if none', function () {
it('should call the endpoint with bpsegs (stringified) data if any or [] if none', function () {
let bidderRequest =
{
'ortb2': {
Expand All @@ -149,15 +149,14 @@ describe('BeOp Bid Adapter tests', () => {

const request = spec.buildRequests(bidRequests, bidderRequest);
const payload = JSON.parse(request.data);
expect(payload.psegs).to.exist;
expect(payload.psegs).to.include(1234);
expect(payload.psegs).to.include(5678);
expect(payload.psegs).to.include(910);
expect(payload.psegs).to.not.include(1);
expect(payload.bpsegs).to.exist;
expect(payload.bpsegs).to.include('axed');
expect(payload.bpsegs).to.include('axec');
expect(payload.bpsegs).to.include('1234');
expect(payload.bpsegs).to.include('1234');
expect(payload.bpsegs).to.include('5678');
expect(payload.bpsegs).to.include('910');
expect(payload.bpsegs).to.not.include('1');

let bidderRequest2 =
{
Expand All @@ -166,8 +165,6 @@ describe('BeOp Bid Adapter tests', () => {

const request2 = spec.buildRequests(bidRequests, bidderRequest2);
const payload2 = JSON.parse(request2.data);
expect(payload2.psegs).to.exist;
expect(payload2.psegs).to.be.empty;
expect(payload2.bpsegs).to.exist;
expect(payload2.bpsegs).to.be.empty;
});
Expand Down

0 comments on commit 476b736

Please sign in to comment.