File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
android/src/test/java/com/instabug/reactlibrary Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -250,21 +250,24 @@ public Object answer(InvocationOnMock invocation) {
250
250
// given
251
251
MockedStatic mockArgument = mockStatic (Arguments .class );
252
252
MockedStatic mockReactApplicationContext = mockStatic (ReactApplicationContext .class );
253
+ final OnSdkDismissCallback .DismissType dismissType = OnSdkDismissCallback .DismissType .CANCEL ;
254
+ final OnSdkDismissCallback .ReportType reportType = OnSdkDismissCallback .ReportType .BUG ;
253
255
254
256
// when
255
257
when (Arguments .createMap ()).thenReturn (new JavaOnlyMap ());
256
258
mockBugReporting .when (() -> BugReporting .setOnDismissCallback (any (OnSdkDismissCallback .class ))).thenAnswer (new Answer () {
257
259
public Object answer (InvocationOnMock invocation ) {
258
260
((OnSdkDismissCallback ) invocation .getArguments ()[0 ])
259
- .call (OnSdkDismissCallback . DismissType . CANCEL , OnSdkDismissCallback . ReportType . BUG );
261
+ .call (dismissType , reportType );
260
262
return null ;
261
263
}});
262
264
bugReportingModule .setOnDismissHandler (null );
263
265
264
266
// then
265
267
WritableMap params = new JavaOnlyMap ();
266
- params .putString ("dismissType" , OnSdkDismissCallback .DismissType .CANCEL .toString ());
267
- params .putString ("reportType" , OnSdkDismissCallback .ReportType .BUG .toString ());
268
+ params .putString ("dismissType" , ArgsRegistry .dismissTypes .getKey (dismissType ));
269
+ params .putString ("reportType" , ArgsRegistry .sdkDismissReportTypes .getKey (reportType ));
270
+
268
271
verify (bugReportingModule ).sendEvent (Constants .IBG_POST_INVOCATION_HANDLER , params );
269
272
mockArgument .close ();
270
273
mockReactApplicationContext .close ();
You can’t perform that action at this time.
0 commit comments