6
6
AnalyticsService ,
7
7
NON_TRACKING_ANONYMOUS_ID ,
8
8
} from './analytics.service' ;
9
+ import { AppType } from 'src/modules/core/models/server-provider.interface' ;
9
10
10
11
let mockAnalyticsTrack ;
11
12
jest . mock (
@@ -59,7 +60,7 @@ describe('AnalyticsService', () => {
59
60
60
61
describe ( 'initialize' , ( ) => {
61
62
it ( 'should set anonymousId' , ( ) => {
62
- service . initialize ( { anonymousId : mockAnonymousId , sessionId } ) ;
63
+ service . initialize ( { anonymousId : mockAnonymousId , sessionId, appType : AppType . Electron } ) ;
63
64
64
65
const anonymousId = service . getAnonymousId ( ) ;
65
66
@@ -70,7 +71,7 @@ describe('AnalyticsService', () => {
70
71
describe ( 'sendEvent' , ( ) => {
71
72
beforeEach ( ( ) => {
72
73
mockAnalyticsTrack = jest . fn ( ) ;
73
- service . initialize ( { anonymousId : mockAnonymousId , sessionId } ) ;
74
+ service . initialize ( { anonymousId : mockAnonymousId , sessionId, appType : AppType . Electron } ) ;
74
75
} ) ;
75
76
it ( 'should send event with anonymousId if permission are granted' , async ( ) => {
76
77
settingsService . getSettings = jest
@@ -87,7 +88,9 @@ describe('AnalyticsService', () => {
87
88
anonymousId : mockAnonymousId ,
88
89
integrations : { Amplitude : { session_id : sessionId } } ,
89
90
event : TelemetryEvents . ApplicationStarted ,
90
- properties : { } ,
91
+ properties : {
92
+ buildType : AppType . Electron ,
93
+ } ,
91
94
} ) ;
92
95
} ) ;
93
96
it ( 'should not send event if permission are not granted' , async ( ) => {
@@ -118,7 +121,9 @@ describe('AnalyticsService', () => {
118
121
anonymousId : mockAnonymousId ,
119
122
integrations : { Amplitude : { session_id : sessionId } } ,
120
123
event : TelemetryEvents . ApplicationStarted ,
121
- properties : { } ,
124
+ properties : {
125
+ buildType : AppType . Electron ,
126
+ } ,
122
127
} ) ;
123
128
} ) ;
124
129
} ) ;
0 commit comments