Skip to content

Commit

Permalink
Humansecurity Rtd Provider : update activity control for loadExternal…
Browse files Browse the repository at this point in the history
…Script (#12318)

* Update humansecurityRtdProvider.js

* fix lint

* fix tests
  • Loading branch information
ChrisHuie authored Oct 11, 2024
1 parent b301a32 commit 73da00f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion modules/humansecurityRtdProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
import { getRefererInfo } from '../src/refererDetection.js';
import { getGlobal } from '../src/prebidGlobal.js';
import { loadExternalScript } from '../src/adloader.js';
import { MODULE_TYPE_RTD } from '../src/activities/modules.js';

/**
* @typedef {import('../modules/rtdModule/index.js').RtdSubmodule} RtdSubmodule
Expand Down Expand Up @@ -91,7 +92,7 @@ function load(config) {
const scriptAttrs = { 'data-sid': sessionId };
const scriptUrl = `${SCRIPT_URL}?r=${refDomain}${clientId ? `&c=${clientId}` : ''}`;

loadExternalScript(scriptUrl, SUBMODULE_NAME, onImplLoaded, null, scriptAttrs);
loadExternalScript(scriptUrl, MODULE_TYPE_RTD, SUBMODULE_NAME, onImplLoaded, null, scriptAttrs);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions test/spec/modules/humansecurityRtdProvider_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ describe('humansecurity RTD module', function () {

const args = loadExternalScriptStub.getCall(0).args;
expect(args[0]).to.be.equal(`${SCRIPT_URL}?r=example.com`);
expect(args[1]).to.be.equal(SUBMODULE_NAME);
expect(args[2]).to.be.equal(onImplLoaded);
expect(args[3]).to.be.equal(null);
expect(args[4]).to.be.deep.equal({ 'data-sid': 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee' });
expect(args[2]).to.be.equal(SUBMODULE_NAME);
expect(args[3]).to.be.equal(onImplLoaded);
expect(args[4]).to.be.equal(null);
expect(args[5]).to.be.deep.equal({ 'data-sid': 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee' });
});

it('should insert external script element with "customerId" info from config', () => {
Expand Down

0 comments on commit 73da00f

Please sign in to comment.