@@ -412,6 +412,48 @@ describe('Instabug Module', () => {
412
412
expect ( NativeInstabug . identifyUser ) . toBeCalledWith ( email , name ) ;
413
413
} ) ;
414
414
415
+ it ( 'identifyUser when id is empty should call the native method identifyUser' , ( ) => {
416
+ const email = '[email protected] ' ;
417
+ const name = 'Instabug' ;
418
+ const id = '' ;
419
+ Instabug . identifyUser ( email , name , id ) ;
420
+
421
+ expect ( NativeInstabug . identifyUser ) . toBeCalledTimes ( 1 ) ;
422
+ expect ( NativeInstabug . identifyUser ) . toBeCalledWith ( email , name ) ;
423
+ } ) ;
424
+
425
+ it ( 'identifyUser when id is undefined should call the native method identifyUser' , ( ) => {
426
+ const email = '[email protected] ' ;
427
+ const name = 'Instabug' ;
428
+ const id = undefined ;
429
+ Instabug . identifyUser ( email , name , id ) ;
430
+
431
+ expect ( NativeInstabug . identifyUser ) . toBeCalledTimes ( 1 ) ;
432
+ expect ( NativeInstabug . identifyUser ) . toBeCalledWith ( email , name ) ;
433
+ } ) ;
434
+
435
+ it ( 'identifyUser when id is present should call the Android native method identifyUser' , ( ) => {
436
+ Platform . OS = 'android' ;
437
+ const email = '[email protected] ' ;
438
+ const name = 'Instabug' ;
439
+ const id = 'id' ;
440
+ Instabug . identifyUser ( email , name , id ) ;
441
+
442
+ expect ( NativeInstabug . identifyUser ) . toBeCalledTimes ( 1 ) ;
443
+ expect ( NativeInstabug . identifyUser ) . toBeCalledWith ( email , name , id ) ;
444
+ } ) ;
445
+
446
+ it ( 'identifyUser when id is present should call the iOS native method identifyUserWithID' , ( ) => {
447
+ Platform . OS = 'ios' ;
448
+ const email = '[email protected] ' ;
449
+ const name = 'Instabug' ;
450
+ const id = 'id' ;
451
+ Instabug . identifyUser ( email , name , id ) ;
452
+
453
+ expect ( NativeInstabug . identifyUserWithId ) . toBeCalledTimes ( 1 ) ;
454
+ expect ( NativeInstabug . identifyUserWithId ) . toBeCalledWith ( email , name , id ) ;
455
+ } ) ;
456
+
415
457
it ( 'should call the native method logOut' , ( ) => {
416
458
Instabug . logOut ( ) ;
417
459
0 commit comments