Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSEGS are now part of BPSEGS #15

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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