My email is , My bank account number is , my SSN is , and my credit card number is .Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
');
+ expect(sanitizedDom.documentElement.innerHTML).to.equal('My email is , My bank account number is , my SSN is , and my credit card number is .Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
');
+ });
+ });
+
+ describe('setUidInStorage', function () {
+ it('sets Id in Storage', function () {
+ setUidInStorage('123456789');
+ let val = getUidFromStorage();
+ expect(val).to.deep.equal([{source: 'sddan.com', uids: [{id: '123456789', atype: 1}]}]);
+ });
+ });
+
+ describe('mergeEuidsArrays', function () {
+ it('merges Euids Arrays', function () {
+ const object1 = [{source: 'sddan.com', uids: [{id: '123456789', atype: 1}]}];
+ const object2 = [{source: 'sddan.com', uids: [{id: '987654321', atype: 1}]}];
+ const object3 = mergeEuidsArrays(object1, object2);
+ expect(object3).to.deep.equal([{source: 'sddan.com', uids: [{id: '123456789', atype: 1}, {id: '987654321', atype: 1}]}]);
+ });
+ });
+
+ describe('onDocumentReady', function () {
+ it('on Document Ready function execution', function () {
+ const testString = '';
+ const testFunction = function() { return true; };
+ let resString;
+ try {
+ resString = onDocumentReady(testString);
+ } catch (e) {}
+ expect(resString).to.be.false;
+ let resFunction = onDocumentReady(testFunction);
+ expect(resFunction).to.be.true;
+ });
+ });
+
+ describe('postContentForSemanticAnalysis', function () {
+ it('gets content for analysis', function () {
+ let res = postContentForSemanticAnalysis('1223456', 'https://www.sirdata.com/');
+ let resEmpty = postContentForSemanticAnalysis('1223456', '');
+ expect(res).to.be.true;
+ expect(resEmpty).to.be.false;
+ });
+ });
+
+ describe('loadCustomFunction', function () {
+ it('load function', function () {
+ const res = loadCustomFunction(function(...args) { return true; }, {}, {}, {}, {});
+ expect(res).to.be.true;
+ });
+ });
+
+ describe('onDataDeletionRequest', function () {
+ it('destroy id', function () {
+ const moduleConfig = {
+ params: {
+ partnerId: 1,
+ key: 1,
+ }
+ };
+ const res = onDataDeletionRequest(moduleConfig);
+ expect(res).to.be.true;
+ });
+ });
+
describe('Add Segment Data', function () {
it('adds segment data', function () {
const firstConfig = {
@@ -25,9 +127,12 @@ describe('sirdataRtdProvider', function () {
setGptKeyValues: true,
gptCurationId: 27449,
contextualMinRelevancyScore: 50,
+ actualUrl: 'https://www.sirdata.com/',
+ cookieAccessGranted: true,
bidders: []
}
};
+ sirdataSubmodule.init(firstConfig);
let adUnits = [
{
@@ -68,13 +173,12 @@ describe('sirdataRtdProvider', function () {
'segtaxid': 4,
'cattaxid': 7,
'contextual_categories': {'345': 100, '456': 100}
- }
+ },
+ 'sddan_id': '123456789',
+ 'post_content_token': '987654321'
}
- };
-
- addSegmentData(firstReqBidsConfigObj, firstData, firstConfig, () => {
- });
-
+ }
+ addSegmentData(firstReqBidsConfigObj, firstData, adUnits, function() { return true; });
expect(firstReqBidsConfigObj.ortb2Fragments.global.user.data[0].ext.segtax).to.equal(4);
});
});
@@ -109,6 +213,7 @@ describe('sirdataRtdProvider', function () {
}]
}
};
+ sirdataSubmodule.init(config);
let reqBidsConfigObj = {
adUnits: [{
@@ -197,11 +302,13 @@ describe('sirdataRtdProvider', function () {
'cattaxid': 7,
'contextual_categories': {'345': 100, '456': 100}
}
- }
+ },
+ 'sddan_id': '123456789',
+ 'post_content_token': '987654321'
};
getSegmentsAndCategories(reqBidsConfigObj, () => {
- }, config, {});
+ }, {}, {});
let request = server.requests[0];
request.respond(200, responseHeader, JSON.stringify(data));
@@ -228,16 +335,6 @@ describe('sirdataRtdProvider', function () {
describe('Set ortb2 for bidder', function () {
it('set ortb2 for a givent bidder', function () {
- const config = {
- params: {
- setGptKeyValues: false,
- contextualMinRelevancyScore: 50,
- bidders: [{
- bidder: 'appnexus',
- }]
- }
- };
-
let reqBidsConfigObj = {
adUnits: [{
bids: [{
@@ -252,22 +349,6 @@ describe('sirdataRtdProvider', function () {
}
};
- let data = {
- 'segments': [111111, 222222],
- 'segtaxid': null,
- 'cattaxid': null,
- 'contextual_categories': {'333333': 100},
- 'shared_taxonomy': {
- '27440': {
- 'segments': [444444, 555555],
- 'segtaxid': null,
- 'cattaxid': null,
- 'contextual_categories': {'666666': 100}
- }
- },
- 'global_taxonomy': {}
- };
-
window.googletag = window.googletag || {};
window.googletag.cmd = window.googletag.cmd || [];
From 0f91affebac045efd2470fafb76a0f138ea15f20 Mon Sep 17 00:00:00 2001
From: Aymeric Le Corre