Skip to content

Commit

Permalink
Fix JS Test
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBuggedYRN committed Jan 12, 2023
1 parent ced701e commit ff3226c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/modules/BugReporting.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,18 +134,18 @@ describe('Testing BugReporting Module', () => {

it('should call the native method setOnDismissHandler with a function', () => {
const callback = jest.fn();
BugReporting.onSDKDismissedHandler(callback);
BugReporting.onDismissHandler(callback);

expect(NativeBugReporting.setOnDismissHandler).toBeCalledTimes(1);
expect(NativeBugReporting.setOnDismissHandler).toBeCalledWith(callback);
});

it('should invoke callback on emitting the event IBGpostInvocationHandler', () => {
const dismissType = 'cancel';
const reportType = 'bug';
const dismissType = Instabug.dismissType.cancel;
const reportType = BugReporting.reportType.bug;
const callback = jest.fn();

BugReporting.onSDKDismissedHandler(callback);
BugReporting.onDismissHandler(callback);
IBGEventEmitter.emit(IBGConstants.ON_SDK_DISMISSED_HANDLER, {
dismissType: dismissType,
reportType: reportType,
Expand Down

0 comments on commit ff3226c

Please sign in to comment.