@@ -72,38 +72,49 @@ - (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
98
105
- (void ) testgivenHandlerADD_ATTACHMENT $setOnDismissHandler_whenQuery_thenShouldCallNativeApi {
99
106
id partialMock = OCMPartialMock (self.instabugBridge );
107
+ IBGDismissType dismissType = IBGDismissTypeAddAttachment;
108
+ IBGReportType reportType = IBGReportTypeFeedback;
109
+
100
110
RCTResponseSenderBlock callback = ^(NSArray *response) {};
101
111
[partialMock setOnDismissHandler: callback];
102
112
XCTAssertNotNil (IBGBugReporting.didDismissHandler );
103
- NSDictionary *result = @{ @" dismissType" : @" ADD_ATTACHMENT" ,
104
- @" reportType" : @" feedback" };
113
+ NSDictionary *result = @{ @" dismissType" : @(dismissType),
114
+ @" reportType" : @(reportType)};
115
+
105
116
OCMStub ([partialMock sendEventWithName: @" IBGpostInvocationHandler" body: result]);
106
- IBGBugReporting.didDismissHandler (IBGDismissTypeAddAttachment,IBGReportTypeFeedback );
117
+ IBGBugReporting.didDismissHandler (dismissType, reportType );
107
118
OCMVerify ([partialMock sendEventWithName: @" IBGpostInvocationHandler" body: result]);
108
119
}
109
120
0 commit comments