Skip to content

Commit

Permalink
theadx bid adaptor new eids test added
Browse files Browse the repository at this point in the history
  • Loading branch information
mku committed Jun 5, 2024
1 parent 3ce1754 commit 6a2c7d0
Showing 1 changed file with 40 additions and 2 deletions.
42 changes: 40 additions & 2 deletions test/spec/modules/theAdxBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,21 @@ describe('TheAdxAdapter', function () {
[300, 600]
]
}
}
},
userId: {
uid2: { id: 'sample-uid2' },
id5id: {
'uid': 'sample-id5id',
'ext': {
'linkType': 'abc'
}
},
netId: 'sample-netid',
sharedid: {
'id': 'sample-sharedid',
},

},
};

const sampleBidderRequest = {
Expand Down Expand Up @@ -357,6 +371,30 @@ describe('TheAdxAdapter', function () {
expect(mediaTypes.video).to.not.be.null;
expect(mediaTypes.video).to.not.be.undefined;
});

it('add eids to request', function () {
let localBidRequest = JSON.parse(JSON.stringify(sampleBidRequest));

let results = spec.buildRequests([localBidRequest], sampleBidderRequest);
let result = results.pop();
let payload = JSON.parse(result.data);
expect(payload).to.not.be.null;
expect(payload.ext).to.not.be.null;

expect(payload.ext.uid2).to.not.be.null;
expect(payload.ext.uid2.length).to.greaterThan(0);

expect(payload.ext.id5id).to.not.be.null;
expect(payload.ext.id5id.length).to.greaterThan(0);
expect(payload.ext.id5_linktype).to.not.be.null;
expect(payload.ext.id5_linktype.length).to.greaterThan(0);

expect(payload.ext.netid).to.not.be.null;
expect(payload.ext.netid.length).to.greaterThan(0);

expect(payload.ext.sharedid).to.not.be.null;
expect(payload.ext.sharedid.length).to.greaterThan(0);
});
});

describe('response interpreter', function () {
Expand Down Expand Up @@ -495,7 +533,7 @@ describe('TheAdxAdapter', function () {
banner: {}
},
requestId: incomingRequestId,
deals: [{id: dealId}]
deals: [{ id: dealId }]
};
let serverResponse = {
body: sampleResponse
Expand Down

0 comments on commit 6a2c7d0

Please sign in to comment.