@@ -72,26 +72,33 @@ - (void) testgivenHandler$setOnInvokeHandler_whenQuery_thenShouldCallNativeApi {
72
72
73
73
- (void ) testgivenHandlerCANCEL $setOnDismissHandler_whenQuery_thenShouldCallNativeApi {
74
74
id partialMock = OCMPartialMock (self.instabugBridge );
75
+ IBGDismissType dismissType = IBGDismissTypeCancel;
76
+ IBGReportType reportType = IBGReportTypeBug;
77
+
75
78
RCTResponseSenderBlock callback = ^(NSArray *response) {};
76
79
[partialMock setOnDismissHandler: callback];
77
80
XCTAssertNotNil (IBGBugReporting.didDismissHandler );
78
- NSDictionary *result = @{ @" dismissType" : @" CANCEL" ,
79
- @" reportType" : @" bug" };
81
+ NSDictionary *result = @{ @" dismissType" : @(dismissType),
82
+ @" reportType" : @(reportType)};
83
+
80
84
OCMStub ([partialMock sendEventWithName: @" IBGpostInvocationHandler" body: result]);
81
- IBGBugReporting.didDismissHandler (IBGDismissTypeCancel,IBGReportTypeBug );
85
+ IBGBugReporting.didDismissHandler (dismissType, reportType );
82
86
OCMVerify ([partialMock sendEventWithName: @" IBGpostInvocationHandler" body: result]);
83
87
}
84
88
85
89
- (void ) testgivenHandlerSUBMIT $setOnDismissHandler_whenQuery_thenShouldCallNativeApi {
86
90
id partialMock = OCMPartialMock (self.instabugBridge );
91
+ IBGDismissType dismissType = IBGDismissTypeSubmit;
92
+ IBGReportType reportType = IBGReportTypeFeedback;
93
+
87
94
RCTResponseSenderBlock callback = ^(NSArray *response) {};
88
95
[partialMock setOnDismissHandler: callback];
89
96
XCTAssertNotNil (IBGBugReporting.didDismissHandler );
90
-
91
- NSDictionary *result = @{ @" dismissType " : @" SUBMIT " ,
92
- @" reportType " : @" feedback " };
97
+ NSDictionary *result = @{ @" dismissType " : @(dismissType),
98
+ @" reportType " : @(reportType)};
99
+
93
100
OCMStub ([partialMock sendEventWithName: @" IBGpostInvocationHandler" body: result]);
94
- IBGBugReporting.didDismissHandler (IBGDismissTypeSubmit,IBGReportTypeFeedback );
101
+ IBGBugReporting.didDismissHandler (dismissType, reportType );
95
102
OCMVerify ([partialMock sendEventWithName: @" IBGpostInvocationHandler" body: result]);
96
103
}
97
104
0 commit comments