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

Jixie Bid Adapter: Add read jxtoko cookie #9331

Merged
merged 16 commits into from
Dec 13, 2022
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
2 changes: 2 additions & 0 deletions modules/jixieBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ function fetchIds_() {
if (tmp) ret.client_id_ls = tmp;
tmp = storage.getDataFromLocalStorage('_jxxs');
if (tmp) ret.session_id_ls = tmp;
tmp = storage.getCookie('_jxtoko');
if (tmp) ret.jxtoko_id = tmp;
} catch (error) {}
return ret;
}
Expand Down
5 changes: 5 additions & 0 deletions test/spec/modules/jixieBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ describe('jixie Adapter', function () {

const clientIdTest1_ = '1aba6a40-f711-11e9-868c-53a2ae972xxx';
const sessionIdTest1_ = '1594782644-1aba6a40-f711-11e9-868c-53a2ae972xxx';
const jxtokoTest1_ = 'eyJJRCI6ImFiYyJ9';

// to serve as the object that prebid will call jixie buildRequest with: (param2)
const bidderRequest_ = {
Expand Down Expand Up @@ -198,6 +199,9 @@ describe('jixie Adapter', function () {
// get the interceptors ready:
let getCookieStub = sinon.stub(storage, 'getCookie');
let getLocalStorageStub = sinon.stub(storage, 'getDataFromLocalStorage');
getCookieStub
.withArgs('_jxtoko')
.returns(jxtokoTest1_);
getCookieStub
.withArgs('_jxx')
.returns(clientIdTest1_);
Expand Down Expand Up @@ -227,6 +231,7 @@ describe('jixie Adapter', function () {
expect(payload).to.have.property('client_id_ls', clientIdTest1_);
expect(payload).to.have.property('session_id_c', sessionIdTest1_);
expect(payload).to.have.property('session_id_ls', sessionIdTest1_);
expect(payload).to.have.property('jxtoko_id', jxtokoTest1_);
expect(payload).to.have.property('device', device_);
expect(payload).to.have.property('domain', domain_);
expect(payload).to.have.property('pageurl', pageurl_);
Expand Down