From 3e90126ba3b4c0b2bd3c1925c4b5ba9d031de406 Mon Sep 17 00:00:00 2001 From: slimkrazy Date: Thu, 23 Jan 2025 19:02:01 +0000 Subject: [PATCH] Pass user consent object to library --- modules/nodalsAiRtdProvider.js | 62 +++--- test/spec/modules/nodalsAiRtdProvider_spec.js | 199 +++++++++--------- 2 files changed, 133 insertions(+), 128 deletions(-) diff --git a/modules/nodalsAiRtdProvider.js b/modules/nodalsAiRtdProvider.js index 20f7aa34dc1..c1f60198e5c 100644 --- a/modules/nodalsAiRtdProvider.js +++ b/modules/nodalsAiRtdProvider.js @@ -1,27 +1,27 @@ -import { MODULE_TYPE_RTD } from '../src/activities/modules.js'; -import { loadExternalScript } from '../src/adloader.js'; -import { ajax } from '../src/ajax.js'; -import { submodule } from '../src/hook.js'; -import { getStorageManager } from '../src/storageManager.js'; -import { prefixLog } from '../src/utils.js'; +import { MODULE_TYPE_RTD } from "../src/activities/modules.js"; +import { loadExternalScript } from "../src/adloader.js"; +import { ajax } from "../src/ajax.js"; +import { submodule } from "../src/hook.js"; +import { getStorageManager } from "../src/storageManager.js"; +import { prefixLog } from "../src/utils.js"; -const MODULE_NAME = 'nodalsAi'; +const MODULE_NAME = "nodalsAi"; const GVLID = 1360; -const PUB_ENDPOINT_ORIGIN = 'https://nodals.io'; -const LOCAL_STORAGE_KEY = 'signals.nodals.ai'; +const PUB_ENDPOINT_ORIGIN = "https://nodals.io"; +const LOCAL_STORAGE_KEY = "signals.nodals.ai"; const STORAGE_TTL = 3600000; // 1 hour in milliseconds const fillTemplate = (strings, ...keys) => { return function (values) { return strings.reduce((result, str, i) => { const key = keys[i - 1]; - return result + (key ? values[key] || '' : '') + str; + return result + (key ? values[key] || "" : "") + str; }); }; }; -const PUB_ENDPOINT_PATH = fillTemplate`/p/v1/${'propertyId'}/config?${'consentParams'}`; -const { logInfo, logWarn, logError } = prefixLog('[NodalsAiRTDProvider]'); +const PUB_ENDPOINT_PATH = fillTemplate`/p/v1/${"propertyId"}/config?${"consentParams"}`; +const { logInfo, logWarn, logError } = prefixLog("[NodalsAiRTDProvider]"); class NodalsAiRtdProvider { // Public properties @@ -65,7 +65,7 @@ class NodalsAiRtdProvider { } return true; } else { - logWarn('Invalid configuration or missing user consent.'); + logWarn("Invalid configuration or missing user consent."); return false; } } @@ -89,10 +89,14 @@ class NodalsAiRtdProvider { return targetingData; } const facts = storedData?.facts ?? {}; - const targetingEngine = window?.$nodals?.adTargetingEngine['latest']; + const targetingEngine = window?.$nodals?.adTargetingEngine["latest"]; try { targetingEngine.init(config, facts); - targetingData = targetingEngine.getTargetingData(adUnitArray, storedData); + targetingData = targetingEngine.getTargetingData( + adUnitArray, + storedData, + userConsent + ); } catch (error) { logError(`Error determining targeting keys: ${error}`); } @@ -101,7 +105,7 @@ class NodalsAiRtdProvider { // Private methods #setOverrides(params) { - if (params?.storage?.ttl && typeof params.storage.ttl === 'number') { + if (params?.storage?.ttl && typeof params.storage.ttl === "number") { this.#overrides.storageTTL = params.storage.ttl * 1000; } this.#overrides.storageKey = params?.storage?.key; @@ -116,10 +120,10 @@ class NodalsAiRtdProvider { // eslint-disable-next-line no-dupe-class-members #isValidConfig(params) { // Basic validation logic - if (typeof params === 'object' && params?.propertyId) { + if (typeof params === "object" && params?.propertyId) { return true; } - logWarn('Invalid configuration'); + logWarn("Invalid configuration"); return false; } @@ -172,7 +176,7 @@ class NodalsAiRtdProvider { return null; } } else { - logError('Local storage is not available or not enabled.'); + logError("Local storage is not available or not enabled."); return null; } } @@ -194,7 +198,7 @@ class NodalsAiRtdProvider { }; this.storage.setDataInLocalStorage(key, JSON.stringify(storageObject)); } else { - logError('Local storage is not available or not enabled.'); + logError("Local storage is not available or not enabled."); } } @@ -216,14 +220,14 @@ class NodalsAiRtdProvider { const endpointOrigin = this.#overrides.endpointOrigin || PUB_ENDPOINT_ORIGIN; const parameterMap = { - gdpr_consent: userConsent?.gdpr?.consentString ?? '', - gdpr: userConsent?.gdpr?.gdprApplies ? '1' : '0', - us_privacy: userConsent?.uspConsent ?? '', - gpp: userConsent?.gpp?.gppString ?? '', + gdpr_consent: userConsent?.gdpr?.consentString ?? "", + gdpr: userConsent?.gdpr?.gdprApplies ? "1" : "0", + us_privacy: userConsent?.uspConsent ?? "", + gpp: userConsent?.gpp?.gppString ?? "", gpp_sid: userConsent.gpp && Array.isArray(userConsent.gpp.applicableSections) - ? userConsent.gpp.applicableSections.join(',') - : '', + ? userConsent.gpp.applicableSections.join(",") + : "", }; const querystring = new URLSearchParams(parameterMap).toString(); const values = { @@ -251,7 +255,7 @@ class NodalsAiRtdProvider { }; const options = { - method: 'GET', + method: "GET", withCredentials: false, }; @@ -285,7 +289,7 @@ class NodalsAiRtdProvider { #loadAdLibraries(deps) { // eslint-disable-next-line no-unused-vars for (const [key, value] of Object.entries(deps)) { - if (typeof value === 'string') { + if (typeof value === "string") { loadExternalScript(value, MODULE_TYPE_RTD, MODULE_NAME, () => { // noop }); @@ -296,4 +300,4 @@ class NodalsAiRtdProvider { export const nodalsAiRtdSubmodule = new NodalsAiRtdProvider(); -submodule('realTimeData', nodalsAiRtdSubmodule); +submodule("realTimeData", nodalsAiRtdSubmodule); diff --git a/test/spec/modules/nodalsAiRtdProvider_spec.js b/test/spec/modules/nodalsAiRtdProvider_spec.js index 6cfce3d050b..1e576fb2fb3 100644 --- a/test/spec/modules/nodalsAiRtdProvider_spec.js +++ b/test/spec/modules/nodalsAiRtdProvider_spec.js @@ -1,54 +1,54 @@ -import { expect } from 'chai'; -import { MODULE_TYPE_RTD } from 'src/activities/modules.js'; -import { loadExternalScriptStub } from 'test/mocks/adloaderStub.js'; -import { server } from 'test/mocks/xhr.js'; +import { expect } from "chai"; +import { MODULE_TYPE_RTD } from "src/activities/modules.js"; +import { loadExternalScriptStub } from "test/mocks/adloaderStub.js"; +import { server } from "test/mocks/xhr.js"; -import { nodalsAiRtdSubmodule } from 'modules/nodalsAiRtdProvider.js'; +import { nodalsAiRtdSubmodule } from "modules/nodalsAiRtdProvider.js"; const jsonResponseHeaders = { - 'Content-Type': 'application/json', + "Content-Type": "application/json", }; const successPubEndpointResponse = { deps: { - '1.0.0': 'https://static.nodals.io/sdk/rule/1.0.0/engine.js', - '1.1.0': 'https://static.nodals.io/sdk/rule/1.1.0/engine.js', + "1.0.0": "https://static.nodals.io/sdk/rule/1.0.0/engine.js", + "1.1.0": "https://static.nodals.io/sdk/rule/1.1.0/engine.js", }, facts: { - 'browser.name': 'safari', - 'geo.country': 'AR', + "browser.name": "safari", + "geo.country": "AR", }, campaigns: [ { id: 1234, ads: [ { - delivery_id: '1234', - property_id: 'fd32da', + delivery_id: "1234", + property_id: "fd32da", weighting: 1, kvs: [ { - k: 'nodals', - v: '1', + k: "nodals", + v: "1", }, ], rules: { engine: { - version: '1.0.0', + version: "1.0.0", }, conditions: { ANY: [ { - fact: 'id', - op: 'allin', - val: ['1', '2', '3'], + fact: "id", + op: "allin", + val: ["1", "2", "3"], }, ], NONE: [ { - fact: 'ua.browser', - op: 'eq', - val: 'opera', + fact: "ua.browser", + op: "eq", + val: "opera", }, ], }, @@ -61,7 +61,7 @@ const successPubEndpointResponse = { const engineGetTargetingDataReturnValue = { adUnit1: { - adv1: 'foobarbaz', + adv1: "foobarbaz", }, }; @@ -108,12 +108,12 @@ const setDataInLocalStorage = (data) => { ); }; -describe('NodalsAI RTD Provider', () => { +describe("NodalsAI RTD Provider", () => { let sandbox; let validConfig; beforeEach(() => { - validConfig = { params: { propertyId: '10312dd2' } }; + validConfig = { params: { propertyId: "10312dd2" } }; sandbox = sinon.sandbox.create(); nodalsAiRtdSubmodule.storage.removeDataFromLocalStorage( @@ -125,27 +125,27 @@ describe('NodalsAI RTD Provider', () => { sandbox.restore(); }); - describe('Module properties', () => { - it('should have the name property set correctly', function () { - expect(nodalsAiRtdSubmodule.name).equals('nodalsAi'); + describe("Module properties", () => { + it("should have the name property set correctly", function () { + expect(nodalsAiRtdSubmodule.name).equals("nodalsAi"); }); - it('should expose the correct TCF Global Vendor ID', function () { + it("should expose the correct TCF Global Vendor ID", function () { expect(nodalsAiRtdSubmodule.gvlid).equals(1360); }); }); - describe('init()', () => { - describe('when initialised with empty consent data', () => { + describe("init()", () => { + describe("when initialised with empty consent data", () => { const userConsent = {}; - it('should return true when initialized with valid config and empty user consent', function () { + it("should return true when initialized with valid config and empty user consent", function () { const result = nodalsAiRtdSubmodule.init(validConfig, userConsent); expect(result).to.be.true; expect(server.requests.length).to.equal(1); }); - it('should return false when initialized with invalid config', () => { + it("should return false when initialized with invalid config", () => { const config = { params: { invalid: true } }; const result = nodalsAiRtdSubmodule.init(config, userConsent); expect(result).to.be.false; @@ -153,58 +153,58 @@ describe('NodalsAI RTD Provider', () => { }); }); - describe('when initialised with valid config data', () => { - it('should return false when user is under GDPR jurisdiction and purpose1 has not been granted', () => { + describe("when initialised with valid config data", () => { + it("should return false when user is under GDPR jurisdiction and purpose1 has not been granted", () => { const userConsent = generateGdprConsent({ purpose1Consent: false }); const result = nodalsAiRtdSubmodule.init(validConfig, userConsent); expect(result).to.be.false; }); - it('should return false when user is under GDPR jurisdiction and Nodals AI as a vendor has no consent', () => { + it("should return false when user is under GDPR jurisdiction and Nodals AI as a vendor has no consent", () => { const userConsent = generateGdprConsent({ nodalsConsent: false }); const result = nodalsAiRtdSubmodule.init(validConfig, userConsent); expect(result).to.be.false; }); - it('should return true when user is under GDPR jurisdiction and all consent provided', function () { + it("should return true when user is under GDPR jurisdiction and all consent provided", function () { const userConsent = generateGdprConsent(); const result = nodalsAiRtdSubmodule.init(validConfig, userConsent); expect(result).to.be.true; }); - it('should return true when user is not under GDPR jurisdiction', () => { + it("should return true when user is not under GDPR jurisdiction", () => { const userConsent = generateGdprConsent({ gdprApplies: false }); const result = nodalsAiRtdSubmodule.init(validConfig, userConsent); expect(result).to.be.true; }); }); - describe('when initialised with valid config and data already in storage', () => { - it('should return true and not make a remote request when stored data is valid', function () { - setDataInLocalStorage({ data: { foo: 'bar' }, createdAt: Date.now() }); + describe("when initialised with valid config and data already in storage", () => { + it("should return true and not make a remote request when stored data is valid", function () { + setDataInLocalStorage({ data: { foo: "bar" }, createdAt: Date.now() }); const result = nodalsAiRtdSubmodule.init(validConfig, {}); expect(result).to.be.true; expect(server.requests.length).to.equal(0); }); - it('should return true and make a remote request when stored data has no TTL defined', function () { - setDataInLocalStorage({ data: { foo: 'bar' } }); + it("should return true and make a remote request when stored data has no TTL defined", function () { + setDataInLocalStorage({ data: { foo: "bar" } }); const result = nodalsAiRtdSubmodule.init(validConfig, {}); expect(result).to.be.true; expect(server.requests.length).to.equal(1); }); - it('should return true and make a remote request when stored data has expired', function () { - setDataInLocalStorage({ data: { foo: 'bar' }, createdAt: 100 }); + it("should return true and make a remote request when stored data has expired", function () { + setDataInLocalStorage({ data: { foo: "bar" }, createdAt: 100 }); const result = nodalsAiRtdSubmodule.init(validConfig, {}); expect(result).to.be.true; expect(server.requests.length).to.equal(1); }); - it('should detect stale data if override TTL is exceeded', function () { + it("should detect stale data if override TTL is exceeded", function () { const fiveMinutesAgoMs = Date.now() - 5 * 60 * 1000; setDataInLocalStorage({ - data: { foo: 'bar' }, + data: { foo: "bar" }, createdAt: fiveMinutesAgoMs, }); const config = Object.assign({}, validConfig); @@ -214,10 +214,10 @@ describe('NodalsAI RTD Provider', () => { expect(server.requests.length).to.equal(1); }); - it('should NOT detect stale data if override TTL is not exceeded', function () { + it("should NOT detect stale data if override TTL is not exceeded", function () { const fiveMinutesAgoMs = Date.now() - 5 * 60 * 1000; setDataInLocalStorage({ - data: { foo: 'bar' }, + data: { foo: "bar" }, createdAt: fiveMinutesAgoMs, }); const config = Object.assign({}, validConfig); @@ -227,73 +227,73 @@ describe('NodalsAI RTD Provider', () => { expect(server.requests.length).to.equal(0); }); - it('should return true and make a remote request when data stored under default key, but override key specified', () => { - setDataInLocalStorage({ data: { foo: 'bar' }, createdAt: Date.now() }); + it("should return true and make a remote request when data stored under default key, but override key specified", () => { + setDataInLocalStorage({ data: { foo: "bar" }, createdAt: Date.now() }); const config = Object.assign({}, validConfig); - config.params.storage = { key: '_foobarbaz_' }; + config.params.storage = { key: "_foobarbaz_" }; const result = nodalsAiRtdSubmodule.init(config, {}); expect(result).to.be.true; expect(server.requests.length).to.equal(1); }); }); - describe('when performing requests to the publisher endpoint', () => { - it('should construct the correct URL to the default origin', () => { + describe("when performing requests to the publisher endpoint", () => { + it("should construct the correct URL to the default origin", () => { const userConsent = generateGdprConsent(); nodalsAiRtdSubmodule.init(validConfig, userConsent); let request = server.requests[0]; - expect(request.method).to.equal('GET'); + expect(request.method).to.equal("GET"); expect(request.withCredentials).to.be.false; const requestUrl = new URL(request.url); - expect(requestUrl.origin).to.equal('https://nodals.io'); + expect(requestUrl.origin).to.equal("https://nodals.io"); }); - it('should construct the URL to the overridden origin when specified in the config', () => { + it("should construct the URL to the overridden origin when specified in the config", () => { const config = Object.assign({}, validConfig); - config.params.endpoint = { origin: 'http://localhost:8000' }; + config.params.endpoint = { origin: "http://localhost:8000" }; const userConsent = generateGdprConsent(); nodalsAiRtdSubmodule.init(config, userConsent); let request = server.requests[0]; - expect(request.method).to.equal('GET'); + expect(request.method).to.equal("GET"); expect(request.withCredentials).to.be.false; const requestUrl = new URL(request.url); - expect(requestUrl.origin).to.equal('http://localhost:8000'); + expect(requestUrl.origin).to.equal("http://localhost:8000"); }); - it('should construct the correct URL with the correct path', () => { + it("should construct the correct URL with the correct path", () => { const userConsent = generateGdprConsent(); nodalsAiRtdSubmodule.init(validConfig, userConsent); let request = server.requests[0]; const requestUrl = new URL(request.url); - expect(requestUrl.pathname).to.equal('/p/v1/10312dd2/config'); + expect(requestUrl.pathname).to.equal("/p/v1/10312dd2/config"); }); - it('should construct the correct URL with the correct GDPR query params', () => { + it("should construct the correct URL with the correct GDPR query params", () => { const consentData = { - consentString: 'foobarbaz', + consentString: "foobarbaz", }; const userConsent = generateGdprConsent(consentData); nodalsAiRtdSubmodule.init(validConfig, userConsent); let request = server.requests[0]; const requestUrl = new URL(request.url); - expect(requestUrl.searchParams.get('gdpr')).to.equal('1'); - expect(requestUrl.searchParams.get('gdpr_consent')).to.equal( - 'foobarbaz' + expect(requestUrl.searchParams.get("gdpr")).to.equal("1"); + expect(requestUrl.searchParams.get("gdpr_consent")).to.equal( + "foobarbaz" ); - expect(requestUrl.searchParams.get('us_privacy')).to.equal(''); - expect(requestUrl.searchParams.get('gpp')).to.equal(''); - expect(requestUrl.searchParams.get('gpp_sid')).to.equal(''); + expect(requestUrl.searchParams.get("us_privacy")).to.equal(""); + expect(requestUrl.searchParams.get("gpp")).to.equal(""); + expect(requestUrl.searchParams.get("gpp_sid")).to.equal(""); }); }); - describe('when handling responses from the publisher endpoint', () => { - it('should store successful response data in local storage', () => { + describe("when handling responses from the publisher endpoint", () => { + it("should store successful response data in local storage", () => { const userConsent = generateGdprConsent(); nodalsAiRtdSubmodule.init(validConfig, userConsent); @@ -309,15 +309,15 @@ describe('NodalsAI RTD Provider', () => { nodalsAiRtdSubmodule.STORAGE_KEY ) ); - expect(request.method).to.equal('GET'); - expect(storedData).to.have.property('createdAt'); + expect(request.method).to.equal("GET"); + expect(storedData).to.have.property("createdAt"); expect(storedData.data).to.deep.equal(successPubEndpointResponse); }); - it('should store successful response data in local storage under the override key', () => { + it("should store successful response data in local storage under the override key", () => { const userConsent = generateGdprConsent(); const config = Object.assign({}, validConfig); - config.params.storage = { key: '_foobarbaz_' }; + config.params.storage = { key: "_foobarbaz_" }; nodalsAiRtdSubmodule.init(config, userConsent); let request = server.requests[0]; @@ -328,14 +328,14 @@ describe('NodalsAI RTD Provider', () => { ); const storedData = JSON.parse( - nodalsAiRtdSubmodule.storage.getDataFromLocalStorage('_foobarbaz_') + nodalsAiRtdSubmodule.storage.getDataFromLocalStorage("_foobarbaz_") ); - expect(request.method).to.equal('GET'); - expect(storedData).to.have.property('createdAt'); + expect(request.method).to.equal("GET"); + expect(storedData).to.have.property("createdAt"); expect(storedData.data).to.deep.equal(successPubEndpointResponse); }); - it('should attempt to load the referenced script libraries contained in the response payload', () => { + it("should attempt to load the referenced script libraries contained in the response payload", () => { const userConsent = generateGdprConsent(); nodalsAiRtdSubmodule.init(validConfig, userConsent); @@ -349,14 +349,14 @@ describe('NodalsAI RTD Provider', () => { expect(loadExternalScriptStub.calledTwice).to.be.true; expect( loadExternalScriptStub.calledWith( - successPubEndpointResponse.deps['1.0.0'], + successPubEndpointResponse.deps["1.0.0"], MODULE_TYPE_RTD, nodalsAiRtdSubmodule.name ) ).to.be.true; expect( loadExternalScriptStub.calledWith( - successPubEndpointResponse.deps['1.1.0'], + successPubEndpointResponse.deps["1.1.0"], MODULE_TYPE_RTD, nodalsAiRtdSubmodule.name ) @@ -365,7 +365,7 @@ describe('NodalsAI RTD Provider', () => { }); }); - describe('getTargetingData()', () => { + describe("getTargetingData()", () => { afterEach(() => { if (window.$nodals) { delete window.$nodals; @@ -373,11 +373,11 @@ describe('NodalsAI RTD Provider', () => { }); const stubVersionedTargetingEngine = (returnValue, raiseError = false) => { - const version = 'latest'; + const version = "latest"; const initStub = sinon.stub(); const getTargetingDataStub = sinon.stub(); if (raiseError) { - getTargetingDataStub.throws(new Error('Stubbed error')); + getTargetingDataStub.throws(new Error("Stubbed error")); } else { getTargetingDataStub.returns(returnValue); } @@ -390,16 +390,16 @@ describe('NodalsAI RTD Provider', () => { return window.$nodals.adTargetingEngine[version]; }; - it('should return an empty object when no data is available in local storage', () => { + it("should return an empty object when no data is available in local storage", () => { const result = nodalsAiRtdSubmodule.getTargetingData( - ['adUnit1'], + ["adUnit1"], validConfig, {} ); expect(result).to.deep.equal({}); }); - it('should return an empty object when getTargetingData throws error', () => { + it("should return an empty object when getTargetingData throws error", () => { stubVersionedTargetingEngine({}, true); // TODO: Change the data const userConsent = generateGdprConsent(); setDataInLocalStorage({ @@ -407,14 +407,14 @@ describe('NodalsAI RTD Provider', () => { createdAt: Date.now(), }); const result = nodalsAiRtdSubmodule.getTargetingData( - ['adUnit1'], + ["adUnit1"], validConfig, userConsent ); expect(result).to.deep.equal({}); }); - it('should initialise the versioned targeting engine', () => { + it("should initialise the versioned targeting engine", () => { const returnData = {}; const engine = stubVersionedTargetingEngine(returnData); const userConsent = generateGdprConsent(); @@ -423,7 +423,7 @@ describe('NodalsAI RTD Provider', () => { createdAt: Date.now(), }); nodalsAiRtdSubmodule.getTargetingData( - ['adUnit1'], + ["adUnit1"], validConfig, userConsent ); @@ -434,7 +434,7 @@ describe('NodalsAI RTD Provider', () => { expect(args[1]).to.deep.equal(successPubEndpointResponse.facts); }); - it('should proxy the correct data to engine.getTargetingData()', () => { + it("should proxy the correct data to engine.getTargetingData()", () => { const engine = stubVersionedTargetingEngine( engineGetTargetingDataReturnValue ); @@ -444,18 +444,19 @@ describe('NodalsAI RTD Provider', () => { createdAt: Date.now(), }); nodalsAiRtdSubmodule.getTargetingData( - ['adUnit1', 'adUnit2'], + ["adUnit1", "adUnit2"], validConfig, userConsent ); expect(engine.getTargetingData.called).to.be.true; const args = engine.getTargetingData.getCall(0).args; - expect(args[0]).to.deep.equal(['adUnit1', 'adUnit2']); + expect(args[0]).to.deep.equal(["adUnit1", "adUnit2"]); expect(args[1]).to.deep.equal(successPubEndpointResponse); + expect(args[2]).to.deep.equal(userConsent); }); - it('should return the response from engine.getTargetingData when data is available and we have consent under GDPR jurisdiction', () => { + it("should return the response from engine.getTargetingData when data is available and we have consent under GDPR jurisdiction", () => { stubVersionedTargetingEngine(engineGetTargetingDataReturnValue); const userConsent = generateGdprConsent(); setDataInLocalStorage({ @@ -464,7 +465,7 @@ describe('NodalsAI RTD Provider', () => { }); const result = nodalsAiRtdSubmodule.getTargetingData( - ['adUnit1'], + ["adUnit1"], validConfig, userConsent ); @@ -472,7 +473,7 @@ describe('NodalsAI RTD Provider', () => { expect(result).to.deep.equal(engineGetTargetingDataReturnValue); }); - it('should return the response from engine.getTargetingData when data is available and we are NOT under GDPR jurisdiction', () => { + it("should return the response from engine.getTargetingData when data is available and we are NOT under GDPR jurisdiction", () => { stubVersionedTargetingEngine(engineGetTargetingDataReturnValue); const userConsent = generateGdprConsent({ gdprApplies: false }); setDataInLocalStorage({ @@ -481,7 +482,7 @@ describe('NodalsAI RTD Provider', () => { }); const result = nodalsAiRtdSubmodule.getTargetingData( - ['adUnit1'], + ["adUnit1"], validConfig, userConsent ); @@ -489,7 +490,7 @@ describe('NodalsAI RTD Provider', () => { expect(result).to.deep.equal(engineGetTargetingDataReturnValue); }); - it('should return an empty object when data is available, but user has not provided consent to Nodals AI as a vendor', () => { + it("should return an empty object when data is available, but user has not provided consent to Nodals AI as a vendor", () => { stubVersionedTargetingEngine(engineGetTargetingDataReturnValue); const userConsent = generateGdprConsent({ nodalsConsent: false }); setDataInLocalStorage({ @@ -498,7 +499,7 @@ describe('NodalsAI RTD Provider', () => { }); const result = nodalsAiRtdSubmodule.getTargetingData( - ['adUnit1'], + ["adUnit1"], validConfig, userConsent );