Skip to content

Commit

Permalink
updates to publisher ids
Browse files Browse the repository at this point in the history
  • Loading branch information
Miguel Morales committed Dec 23, 2024
1 parent 73e6c68 commit 4fcef12
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions test/spec/modules/openPairIdSystem_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ describe('openPairId', function () {
expect(id).to.be.deep.equal({id: publisherIds});
});

xit('should read publisher id from liveramp with default storageKey and additional clean room with configured storageKey', function() {
it('should read publisher id from liveramp with default storageKey and additional clean room with configured storageKey', function() {
let getDataStub = sandbox.stub(storage, 'getDataFromLocalStorage');
let liveRampPairIds = ['lr-test-pair-id1', 'lr-test-pair-id2', 'lr-test-pair-id3'];
getDataStub.withArgs('_lr_pairId').returns(btoa(JSON.stringify({'envelope': liveRampPairIds})));
let liveRampPublisherIds = ['lr-test-pair-id1', 'lr-test-pair-id2', 'lr-test-pair-id3'];
getDataStub.withArgs('_lr_pairId').returns(btoa(JSON.stringify({'envelope': liveRampPublisherIds})));

let habuPairIds = ['habu-test-pair-id1', 'habu-test-pair-id2', 'habu-test-pair-id3'];
getDataStub.withArgs('habu_pairId_custom').returns(btoa(JSON.stringify({'envelope': habuPairIds})));
let habuPublisherIds = ['habu-test-pair-id1', 'habu-test-pair-id2', 'habu-test-pair-id3'];
getDataStub.withArgs('habu_pairId_custom').returns(btoa(JSON.stringify({'envelope': habuPublisherIds})));

let id = submodule.getId({
params: {
Expand All @@ -43,63 +43,63 @@ describe('openPairId', function () {
liveramp: {}
}})

expect(id).to.be.deep.equal({id: habuPairIds.concat(liveRampPairIds)});
expect(id).to.be.deep.equal({id: habuPublisherIds.concat(liveRampPublisherIds)});
});

xit('should log an error if no ID is found when getId', function() {
it('should log an error if no ID is found when getId', function() {
submodule.getId({ params: {} });
expect(logInfoStub.calledOnce).to.be.true;
});

xit('should read publisher id from local storage if exists', function() {
let pairIds = ['test-pair-id1', 'test-pair-id2', 'test-pair-id3'];
it('should read publisher id from local storage if exists', function() {
let publisherIds = ['test-pair-id1', 'test-pair-id2', 'test-pair-id3'];
sandbox.stub(storage, 'getDataFromLocalStorage').withArgs('pairId').returns(btoa(JSON.stringify(pairIds)));

let id = submodule.getId({ params: {} });
expect(id).to.be.deep.equal({id: pairIds});
expect(id).to.be.deep.equal({id: publisherIds});
});

xit('should read publisher id from cookie if exists', function() {
let pairIds = ['test-pair-id4', 'test-pair-id5', 'test-pair-id6'];
it('should read publisher id from cookie if exists', function() {
let publisherIds = ['test-pair-id4', 'test-pair-id5', 'test-pair-id6'];
sandbox.stub(storage, 'getCookie').withArgs('pairId').returns(btoa(JSON.stringify(pairIds)));

let id = submodule.getId({ params: {} });
expect(id).to.be.deep.equal({id: pairIds});
expect(id).to.be.deep.equal({id: publisherIds});
});

xit('should read publisher id from default liveramp envelope local storage key if configured', function() {
let pairIds = ['test-pair-id1', 'test-pair-id2', 'test-pair-id3'];
sandbox.stub(storage, 'getDataFromLocalStorage').withArgs('_lr_pairId').returns(btoa(JSON.stringify({'envelope': pairIds})));
it('should read publisher id from default liveramp envelope local storage key if configured', function() {
let publisherIds = ['test-pair-id1', 'test-pair-id2', 'test-pair-id3'];
sandbox.stub(storage, 'getDataFromLocalStorage').withArgs('_lr_pairId').returns(btoa(JSON.stringify({'envelope': publisherIds})));
let id = submodule.getId({
params: {
liveramp: {}
}})
expect(id).to.be.deep.equal({id: pairIds})
expect(id).to.be.deep.equal({id: publisherIds})
});

xit('should read publisher id from default liveramp envelope cookie entry if configured', function() {
let pairIds = ['test-pair-id4', 'test-pair-id5', 'test-pair-id6'];
sandbox.stub(storage, 'getDataFromLocalStorage').withArgs('_lr_pairId').returns(btoa(JSON.stringify({'envelope': pairIds})));
it('should read publisher id from default liveramp envelope cookie entry if configured', function() {
let publisherIds = ['test-pair-id4', 'test-pair-id5', 'test-pair-id6'];
sandbox.stub(storage, 'getDataFromLocalStorage').withArgs('_lr_pairId').returns(btoa(JSON.stringify({'envelope': publisherIds})));
let id = submodule.getId({
params: {
liveramp: {}
}})
expect(id).to.be.deep.equal({id: pairIds})
expect(id).to.be.deep.equal({id: publisherIds})
});

xit('should read publisher id from specified liveramp envelope cookie entry if configured with storageKey', function() {
let pairIds = ['test-pair-id7', 'test-pair-id8', 'test-pair-id9'];
sandbox.stub(storage, 'getDataFromLocalStorage').withArgs('lr_pairId_custom').returns(btoa(JSON.stringify({'envelope': pairIds})));
it('should read publisher id from specified liveramp envelope cookie entry if configured with storageKey', function() {
let publisherIds = ['test-pair-id7', 'test-pair-id8', 'test-pair-id9'];
sandbox.stub(storage, 'getDataFromLocalStorage').withArgs('lr_pairId_custom').returns(btoa(JSON.stringify({'envelope': publisherIds})));
let id = submodule.getId({
params: {
liveramp: {
storageKey: 'lr_pairId_custom'
}
}})
expect(id).to.be.deep.equal({id: pairIds})
expect(id).to.be.deep.equal({id: publisherIds})
});

xit('should not get data from storage if local storage and cookies are disabled', function () {
it('should not get data from storage if local storage and cookies are disabled', function () {
sandbox.stub(storage, 'localStorageIsEnabled').returns(false);
sandbox.stub(storage, 'cookiesAreEnabled').returns(false);
let id = submodule.getId({
Expand Down

0 comments on commit 4fcef12

Please sign in to comment.