diff --git a/src/Rokt-Kit.js b/src/Rokt-Kit.js index c68f1cf..7c96218 100644 --- a/src/Rokt-Kit.js +++ b/src/Rokt-Kit.js @@ -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; } @@ -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.' @@ -176,11 +173,10 @@ var constructor = function () { delete self.userAttributes[key]; } - function attachLauncher(accountId, sandbox, launcherOptions) { + function attachLauncher(accountId, launcherOptions) { var options = mergeObjects( { accountId: accountId, - sandbox: sandbox, }, launcherOptions || {} ); diff --git a/test/src/tests.js b/test/src/tests.js index 733b240..193d05f 100644 --- a/test/src/tests.js +++ b/test/src/tests.js @@ -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, }; @@ -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, };