11import { BatchUploader } from '../../src/batchUploader' ;
22import { IMParticleWebSDKInstance } from '../../src/mp-instance' ;
3+ import { IStore } from '../../src/store' ;
34import { StoragePrivacyMap , StorageTypes } from '../../src/constants' ;
5+ import { SDKEvent } from '../../src/sdkRuntimeModels' ;
46
57describe ( 'BatchUploader' , ( ) => {
68 let batchUploader : BatchUploader ;
@@ -20,9 +22,9 @@ describe('BatchUploader', () => {
2022 mockMPInstance = {
2123 _Store : {
2224 storageName : 'mprtcl-v4_abcdef' ,
23- getNoFunctional : function ( this : any ) { return this . noFunctional ; } ,
24- getNoTargeting : function ( this : any ) { return this . noTargeting ; } ,
25- getPrivacyFlag : function ( this : any , storageType : StorageTypes ) {
25+ getNoFunctional : function ( this : IStore ) { return this . noFunctional ; } ,
26+ getNoTargeting : function ( this : IStore ) { return this . noTargeting ; } ,
27+ getPrivacyFlag : function ( this : IStore , storageType : StorageTypes ) {
2628 const privacyControl = StoragePrivacyMap [ storageType ] ;
2729 if ( privacyControl === 'functional' ) {
2830 return this . getNoFunctional ( ) ;
@@ -143,7 +145,7 @@ describe('BatchUploader', () => {
143145 const uploader = new BatchUploader ( mockMPInstance , 1000 ) ;
144146 expect ( uploader [ 'offlineStorageEnabled' ] ) . toBe ( false ) ;
145147
146- uploader . queueEvent ( { EventDataType : 4 } as any ) ;
148+ uploader . queueEvent ( { EventDataType : 4 } as SDKEvent ) ;
147149 expect ( sessionStorage . getItem ( 'mprtcl-v4_abcdef-events' ) ) . toBeNull ( ) ;
148150 expect ( localStorage . getItem ( 'mprtcl-v4_abcdef-batches' ) ) . toBeNull ( ) ;
149151 } ) ;
@@ -153,7 +155,7 @@ describe('BatchUploader', () => {
153155
154156 expect ( uploader [ 'offlineStorageEnabled' ] ) . toBe ( true ) ;
155157
156- uploader . queueEvent ( { EventDataType : 4 } as any ) ;
158+ uploader . queueEvent ( { EventDataType : 4 } as SDKEvent ) ;
157159 expect ( sessionStorage . getItem ( 'mprtcl-v4_abcdef-events' ) ) . not . toBeNull ( ) ;
158160
159161 jest . advanceTimersByTime ( 1000 ) ;
@@ -167,7 +169,7 @@ describe('BatchUploader', () => {
167169
168170 const uploader = new BatchUploader ( mockMPInstance , 1000 ) ;
169171
170- uploader . queueEvent ( { EventDataType : 4 } as any ) ;
172+ uploader . queueEvent ( { EventDataType : 4 } as SDKEvent ) ;
171173 expect ( sessionStorage . getItem ( 'mprtcl-v4_abcdef-events' ) ) . not . toBeNull ( ) ;
172174
173175 jest . advanceTimersByTime ( 1000 ) ;
0 commit comments