@@ -20,24 +20,21 @@ import InstabugUtils from '../utils/InstabugUtils';
20
20
21
21
describe ( 'Instabug Module' , ( ) => {
22
22
23
- const startWithToken = sinon . spy ( NativeModules . Instabug , 'startWithToken ' ) ;
23
+ const start = sinon . spy ( NativeModules . Instabug , 'start ' ) ;
24
24
const setUserData = sinon . spy ( NativeModules . Instabug , 'setUserData' ) ;
25
25
const setTrackUserSteps = sinon . spy ( NativeModules . Instabug , 'setTrackUserSteps' ) ;
26
26
const setIBGLogPrintsToConsole = sinon . spy ( NativeModules . Instabug , 'setIBGLogPrintsToConsole' ) ;
27
27
const setSessionProfilerEnabled = sinon . spy ( NativeModules . Instabug , 'setSessionProfilerEnabled' ) ;
28
- const setPushNotificationsEnabled = sinon . spy ( NativeModules . IBGReplies , 'setPushNotificationsEnabled' ) ;
29
- const setFloatingButtonEdge = sinon . spy ( NativeModules . IBGBugReporting , 'setFloatingButtonEdge' ) ;
30
28
const setLocale = sinon . spy ( NativeModules . Instabug , 'setLocale' ) ;
31
29
const setColorTheme = sinon . spy ( NativeModules . Instabug , 'setColorTheme' ) ;
32
30
const setPrimaryColor = sinon . spy ( NativeModules . Instabug , 'setPrimaryColor' ) ;
33
31
const appendTags = sinon . spy ( NativeModules . Instabug , 'appendTags' ) ;
34
32
const resetTags = sinon . spy ( NativeModules . Instabug , 'resetTags' ) ;
35
33
const getTags = sinon . spy ( NativeModules . Instabug , 'getTags' ) ;
36
34
const setString = sinon . spy ( NativeModules . Instabug , 'setString' ) ;
37
- const setEnabledAttachmentTypes = sinon . spy ( NativeModules . IBGBugReporting , 'setEnabledAttachmentTypes' ) ;
38
- const identifyUserWithEmail = sinon . spy ( NativeModules . Instabug , 'identifyUserWithEmail' ) ;
35
+ const identifyUser = sinon . spy ( NativeModules . Instabug , 'identifyUser' ) ;
39
36
const logOut = sinon . spy ( NativeModules . Instabug , 'logOut' ) ;
40
- const logUserEventWithName = sinon . spy ( NativeModules . Instabug , 'logUserEventWithName ' ) ;
37
+ const logUserEvent = sinon . spy ( NativeModules . Instabug , 'logUserEvent ' ) ;
41
38
const log = sinon . spy ( NativeModules . Instabug , 'log' ) ;
42
39
const logVerbose = sinon . spy ( NativeModules . Instabug , 'logVerbose' ) ;
43
40
const logInfo = sinon . spy ( NativeModules . Instabug , 'logInfo' ) ;
@@ -71,10 +68,9 @@ describe('Instabug Module', () => {
71
68
const clearAllExperiments = sinon . spy ( NativeModules . Instabug , 'clearAllExperiments' ) ;
72
69
73
70
beforeEach ( ( ) => {
74
- startWithToken . resetHistory ( ) ;
71
+ start . resetHistory ( ) ;
75
72
setTrackUserSteps . resetHistory ( ) ;
76
73
setIBGLogPrintsToConsole . resetHistory ( ) ;
77
- setPushNotificationsEnabled . resetHistory ( ) ;
78
74
log . resetHistory ( ) ;
79
75
setSdkDebugLogsLevel . resetHistory ( ) ;
80
76
setDebugEnabled . resetHistory ( ) ;
@@ -104,25 +100,25 @@ describe('Instabug Module', () => {
104
100
expect ( reportScreenChange . calledOnceWithExactly ( screenName ) ) . toBe ( true ) ;
105
101
} ) ;
106
102
107
- it ( 'should call the native method startWithToken ' , ( ) => {
103
+ it ( 'should call the native method start ' , ( ) => {
108
104
109
105
Platform . OS = 'ios' ;
110
106
const token = 'some-token' ;
111
107
const invocationEvents = [ Instabug . invocationEvent . floatingButton , Instabug . invocationEvent . shake ] ;
112
108
Instabug . start ( token , invocationEvents ) ;
113
109
114
- expect ( startWithToken . calledOnceWithExactly ( token , invocationEvents ) ) . toBe ( true ) ;
110
+ expect ( start . calledOnceWithExactly ( token , invocationEvents ) ) . toBe ( true ) ;
115
111
116
112
} ) ;
117
113
118
- // it('should not call the native method startWithToken when platform is android', () => {
114
+ // it('should not call the native method start when platform is android', () => {
119
115
120
116
// Platform.OS = 'android';
121
117
// const token = 'some-token';
122
118
// const invocationEvents = [Instabug.invocationEvent.floatingButton, Instabug.invocationEvent.shake];
123
119
// Instabug.start(token, invocationEvents);
124
120
125
- // expect(startWithToken .calledOnceWithExactly(token, invocationEvents)).toBe(true);
121
+ // expect(start .calledOnceWithExactly(token, invocationEvents)).toBe(true);
126
122
127
123
// });
128
124
@@ -179,25 +175,6 @@ describe('Instabug Module', () => {
179
175
180
176
} ) ;
181
177
182
- it ( 'should call the native method setPushNotificationsEnabled' , ( ) => {
183
-
184
- Platform . OS = 'ios' ;
185
- Instabug . setPushNotificationsEnabled ( true ) ;
186
-
187
- expect ( setPushNotificationsEnabled . calledOnceWithExactly ( true ) ) . toBe ( true ) ;
188
-
189
- } ) ;
190
-
191
- it ( 'should call the native method setFloatingButtonEdge' , ( ) => {
192
-
193
- const offsetFromTop = 10 ;
194
- const edge = Instabug . floatingButtonEdge . left ;
195
- Instabug . setFloatingButtonEdge ( edge , offsetFromTop ) ;
196
-
197
- expect ( setFloatingButtonEdge . calledOnceWithExactly ( edge , offsetFromTop ) ) . toBe ( true ) ;
198
-
199
- } ) ;
200
-
201
178
it ( 'should call the native method setLocale' , ( ) => {
202
179
203
180
const locale = Instabug . locale . english ;
@@ -263,22 +240,14 @@ describe('Instabug Module', () => {
263
240
264
241
} ) ;
265
242
266
- it ( 'should call the native method setEnabledAttachmentTypes' , ( ) => {
267
-
268
- Instabug . setEnabledAttachmentTypes ( true , true , false , true ) ;
269
-
270
- expect ( setEnabledAttachmentTypes . calledOnceWithExactly ( true , true , false , true ) ) . toBe ( true ) ;
271
-
272
- } ) ;
273
-
274
- it ( 'should call the native method identifyUserWithEmail' , ( ) => {
243
+ it ( 'should call the native method identifyUser' , ( ) => {
275
244
276
245
277
246
const email = '[email protected] ' ;
278
247
const name = 'Instabug' ;
279
248
Instabug . identifyUser ( email , name ) ;
280
249
281
- expect ( identifyUserWithEmail . calledOnceWithExactly ( email , name ) ) . toBe ( true ) ;
250
+ expect ( identifyUser . calledOnceWithExactly ( email , name ) ) . toBe ( true ) ;
282
251
283
252
} ) ;
284
253
@@ -290,12 +259,12 @@ describe('Instabug Module', () => {
290
259
291
260
} ) ;
292
261
293
- it ( 'should call the native method logUserEventWithName ' , ( ) => {
262
+ it ( 'should call the native method logUserEvent ' , ( ) => {
294
263
295
264
const event = 'click' ;
296
265
Instabug . logUserEvent ( event ) ;
297
266
298
- expect ( logUserEventWithName . calledOnceWithExactly ( event ) ) . toBe ( true ) ;
267
+ expect ( logUserEvent . calledOnceWithExactly ( event ) ) . toBe ( true ) ;
299
268
300
269
} ) ;
301
270
0 commit comments