Skip to content

Commit 98c380e

Browse files
fix: Revise sandbox setting (#32)
1 parent fa8cc6d commit 98c380e

2 files changed

Lines changed: 7 additions & 11 deletions

File tree

src/Rokt-Kit.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,13 @@ var constructor = function () {
5656
self.userAttributes = filteredUserAttributes;
5757
self.onboardingExpProvider = settings.onboardingExpProvider;
5858

59-
var managerOptions = window.mParticle.Rokt.managerOptions || {};
60-
var sandbox = managerOptions.sandbox || false;
61-
6259
var launcherOptions = window.mParticle.Rokt.launcherOptions || {};
6360
launcherOptions.integrationName = generateIntegrationName(
6461
launcherOptions.integrationName
6562
);
6663

6764
if (testMode) {
68-
attachLauncher(accountId, sandbox, launcherOptions);
65+
attachLauncher(accountId, launcherOptions);
6966
return;
7067
}
7168

@@ -86,7 +83,7 @@ var constructor = function () {
8683
typeof window.Rokt.createLauncher === 'function' &&
8784
window.Rokt.currentLauncher === undefined
8885
) {
89-
attachLauncher(accountId, sandbox, launcherOptions);
86+
attachLauncher(accountId, launcherOptions);
9087
} else {
9188
console.error(
9289
'Rokt object is not available after script load.'
@@ -176,11 +173,10 @@ var constructor = function () {
176173
delete self.userAttributes[key];
177174
}
178175

179-
function attachLauncher(accountId, sandbox, launcherOptions) {
176+
function attachLauncher(accountId, launcherOptions) {
180177
var options = mergeObjects(
181178
{
182179
accountId: accountId,
183-
sandbox: sandbox,
184180
},
185181
launcherOptions || {}
186182
);

test/src/tests.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ describe('Rokt Forwarder', () => {
141141
window.Rokt.createLauncherCalled.should.equal(true);
142142
});
143143

144-
it('should set sandbox to true if sandbox is true in managerOptions', async () => {
145-
window.mParticle.Rokt.managerOptions = {
144+
it('should set sandbox to true if sandbox is true in launcherOptions', async () => {
145+
window.mParticle.Rokt.launcherOptions = {
146146
sandbox: true,
147147
};
148148

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

161-
it('should set sandbox to false if sandbox is false in managerOptions', async () => {
162-
window.mParticle.Rokt.managerOptions = {
161+
it('should set sandbox to false if sandbox is false in launcherOptions', async () => {
162+
window.mParticle.Rokt.launcherOptions = {
163163
sandbox: false,
164164
};
165165

0 commit comments

Comments
 (0)