@@ -67,11 +67,15 @@ describe('Rokt Forwarder', () => {
6767 this . accountId = null ;
6868 this . sandbox = null ;
6969 this . integrationName = null ;
70+ this . noFunctional = null ;
71+ this . noTargeting = null ;
7072
7173 this . createLauncherCalled = false ;
7274 this . createLauncher = function ( options ) {
7375 self . accountId = options . accountId ;
7476 self . integrationName = options . integrationName ;
77+ self . noFunctional = options . noFunctional ;
78+ self . noTargeting = options . noTargeting ;
7579 self . createLauncherCalled = true ;
7680 self . isInitialized = true ;
7781
@@ -131,8 +135,60 @@ describe('Rokt Forwarder', () => {
131135 ) ;
132136
133137 window . Rokt . accountId . should . equal ( '123456' ) ;
138+ window . Rokt . createLauncherCalled . should . equal ( true ) ;
139+ } ) ;
140+
141+ it ( 'should set optional settings from customFlags' , async ( ) => {
142+ await mParticle . forwarder . init (
143+ {
144+ accountId : '123456' ,
145+ } ,
146+ reportService . cb ,
147+ true ,
148+ null ,
149+ { } ,
150+ null ,
151+ null ,
152+ null ,
153+ {
154+ 'Rokt.integrationName' : 'customName' ,
155+ 'Rokt.noFunctional' : true ,
156+ 'Rokt.noTargeting' : true ,
157+ }
158+ ) ;
159+
160+ var expectedIntegrationName =
161+ 'mParticle_wsdkv_1.2.3_kitv_' +
162+ require ( '../../package.json' ) . version +
163+ '_customName' ;
164+
165+ window . Rokt . createLauncherCalled . should . equal ( true ) ;
166+ window . Rokt . accountId . should . equal ( '123456' ) ;
167+ window . Rokt . integrationName . should . equal ( expectedIntegrationName ) ;
168+ window . Rokt . noFunctional . should . equal ( true ) ;
169+ window . Rokt . noTargeting . should . equal ( true ) ;
170+ } ) ;
171+
172+ it ( 'should not set optional settings when not in customFlags' , async ( ) => {
173+ await mParticle . forwarder . init (
174+ {
175+ accountId : '123456' ,
176+ } ,
177+ reportService . cb ,
178+ true ,
179+ null ,
180+ { }
181+ ) ;
182+
183+ var expectedIntegrationName =
184+ 'mParticle_wsdkv_1.2.3_kitv_' +
185+ require ( '../../package.json' ) . version ;
134186
135187 window . Rokt . createLauncherCalled . should . equal ( true ) ;
188+ window . Rokt . accountId . should . equal ( '123456' ) ;
189+ window . Rokt . integrationName . should . equal ( expectedIntegrationName ) ;
190+ ( window . Rokt . noFunctional === undefined ) . should . equal ( true ) ;
191+ ( window . Rokt . noTargeting === undefined ) . should . equal ( true ) ;
136192 } ) ;
137193
138194 it ( 'should set the filters on the forwarder' , async ( ) => {
0 commit comments