@@ -68,8 +68,7 @@ void main() {
68
68
log.clear ();
69
69
});
70
70
71
- test ('startWithToken:invocationEvents: should be called on iOS' ,
72
- () async {
71
+ test ('startWithToken:invocationEvents: should be called on iOS' , () async {
73
72
when (mockPlatform.isIOS ()).thenAnswer ((_) => true );
74
73
75
74
Instabug .start (appToken, invocationEvents);
@@ -433,6 +432,51 @@ void main() {
433
432
]);
434
433
});
435
434
435
+ test ('setShakingThresholdForiPhone: Test' , () async {
436
+ const iPhoneShakingThreshold = 1.6 ;
437
+ final List <dynamic > args = < dynamic > [iPhoneShakingThreshold];
438
+
439
+ when (mockPlatform.isIOS ()).thenAnswer ((_) => true );
440
+
441
+ BugReporting .setShakingThresholdForiPhone (iPhoneShakingThreshold);
442
+ expect (log, < Matcher > [
443
+ isMethodCall (
444
+ 'setShakingThresholdForiPhone:' ,
445
+ arguments: args,
446
+ )
447
+ ]);
448
+ });
449
+
450
+ test ('setShakingThresholdForiPad: Test' , () async {
451
+ const iPadShakingThreshold = 1.6 ;
452
+ final List <dynamic > args = < dynamic > [iPadShakingThreshold];
453
+
454
+ when (mockPlatform.isIOS ()).thenAnswer ((_) => true );
455
+
456
+ BugReporting .setShakingThresholdForiPad (iPadShakingThreshold);
457
+ expect (log, < Matcher > [
458
+ isMethodCall (
459
+ 'setShakingThresholdForiPad:' ,
460
+ arguments: args,
461
+ )
462
+ ]);
463
+ });
464
+
465
+ test ('setShakingThresholdForAndroid: Test' , () async {
466
+ const androidThreshold = 1000 ;
467
+ final List <dynamic > args = < dynamic > [androidThreshold];
468
+
469
+ when (mockPlatform.isAndroid ()).thenAnswer ((_) => true );
470
+
471
+ BugReporting .setShakingThresholdForAndroid (androidThreshold);
472
+ expect (log, < Matcher > [
473
+ isMethodCall (
474
+ 'setShakingThresholdForAndroid:' ,
475
+ arguments: args,
476
+ )
477
+ ]);
478
+ });
479
+
436
480
test ('setOnInvokeCallback Test' , () async {
437
481
BugReporting .setOnInvokeCallback (() => () {});
438
482
expect (log, < Matcher > [
@@ -467,6 +511,17 @@ void main() {
467
511
]);
468
512
});
469
513
514
+ test ('setInvocationEvents Test' , () async {
515
+ BugReporting .setInvocationEvents (null );
516
+ final List <dynamic > args = < dynamic > [< String > []];
517
+ expect (log, < Matcher > [
518
+ isMethodCall (
519
+ 'setInvocationEvents:' ,
520
+ arguments: args,
521
+ )
522
+ ]);
523
+ });
524
+
470
525
test (
471
526
'setEnabledAttachmentTypes:extraScreenShot:galleryImage:screenRecording: Test' ,
472
527
() async {
@@ -521,6 +576,17 @@ void main() {
521
576
]);
522
577
});
523
578
579
+ test ('setInvocationOptions Test: empty' , () async {
580
+ BugReporting .setInvocationOptions (null );
581
+ final List <dynamic > args = < dynamic > [< String > []];
582
+ expect (log, < Matcher > [
583
+ isMethodCall (
584
+ 'setInvocationOptions:' ,
585
+ arguments: args,
586
+ )
587
+ ]);
588
+ });
589
+
524
590
test ('showBugReportingWithReportTypeAndOptions:options Test' , () async {
525
591
BugReporting .show (
526
592
ReportType .bug, < InvocationOption > [InvocationOption .emailFieldHidden]);
@@ -536,6 +602,18 @@ void main() {
536
602
]);
537
603
});
538
604
605
+ test ('showBugReportingWithReportTypeAndOptions:options Test: empty options' ,
606
+ () async {
607
+ BugReporting .show (ReportType .bug, null );
608
+ final List <dynamic > args = < dynamic > [ReportType .bug.toString (), < String > []];
609
+ expect (log, < Matcher > [
610
+ isMethodCall (
611
+ 'showBugReportingWithReportTypeAndOptions:options:' ,
612
+ arguments: args,
613
+ )
614
+ ]);
615
+ });
616
+
539
617
test ('setSurveysEnabled: Test' , () async {
540
618
const isEnabled = false ;
541
619
final List <dynamic > args = < dynamic > [isEnabled];
0 commit comments