Skip to content
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
10 changes: 3 additions & 7 deletions src/Rokt-Kit.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,13 @@ var constructor = function () {
self.userAttributes = filteredUserAttributes;
self.onboardingExpProvider = settings.onboardingExpProvider;

var managerOptions = window.mParticle.Rokt.managerOptions || {};
var sandbox = managerOptions.sandbox || false;

var launcherOptions = window.mParticle.Rokt.launcherOptions || {};
launcherOptions.integrationName = generateIntegrationName(
launcherOptions.integrationName
);

if (testMode) {
attachLauncher(accountId, sandbox, launcherOptions);
attachLauncher(accountId, launcherOptions);
return;
}

Expand All @@ -86,7 +83,7 @@ var constructor = function () {
typeof window.Rokt.createLauncher === 'function' &&
window.Rokt.currentLauncher === undefined
) {
attachLauncher(accountId, sandbox, launcherOptions);
attachLauncher(accountId, launcherOptions);
} else {
console.error(
'Rokt object is not available after script load.'
Expand Down Expand Up @@ -176,11 +173,10 @@ var constructor = function () {
delete self.userAttributes[key];
}

function attachLauncher(accountId, sandbox, launcherOptions) {
function attachLauncher(accountId, launcherOptions) {
Comment thread
alexs-mparticle marked this conversation as resolved.
var options = mergeObjects(
{
accountId: accountId,
sandbox: sandbox,
},
launcherOptions || {}
);
Expand Down
8 changes: 4 additions & 4 deletions test/src/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ describe('Rokt Forwarder', () => {
window.Rokt.createLauncherCalled.should.equal(true);
});

it('should set sandbox to true if sandbox is true in managerOptions', async () => {
window.mParticle.Rokt.managerOptions = {
it('should set sandbox to true if sandbox is true in launcherOptions', async () => {
window.mParticle.Rokt.launcherOptions = {
sandbox: true,
};

Expand All @@ -158,8 +158,8 @@ describe('Rokt Forwarder', () => {
window.Rokt.sandbox.should.equal(true);
});

it('should set sandbox to false if sandbox is false in managerOptions', async () => {
window.mParticle.Rokt.managerOptions = {
it('should set sandbox to false if sandbox is false in launcherOptions', async () => {
window.mParticle.Rokt.launcherOptions = {
sandbox: false,
};

Expand Down