File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed
InstabugSample/ios/InstabugSampleTests Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -528,5 +528,35 @@ - (void)testSetCrashReportingEnabled {
528528 XCTAssertFalse (IBGCrashReporting.enabled );
529529}
530530
531+ /*
532+ +------------------------------------------------------------------------+
533+ | Chats Module |
534+ +------------------------------------------------------------------------+
535+ */
536+
537+ - (void )testSetChatsEnabled {
538+ id mock = OCMClassMock ([Instabug class ]);
539+
540+ [self .instabugBridge setChatsEnabled: YES ];
541+ XCTAssertTrue (IBGChats.enabled );
542+
543+ [self .instabugBridge setChatsEnabled: NO ];
544+ XCTAssertFalse (IBGChats.enabled );
545+ }
546+
547+ - (void )testShowChats {
548+ id mock = OCMClassMock ([IBGChats class ]);
549+ XCTestExpectation *expectation = [self expectationWithDescription: @" Testing [IBGChats showChats]" ];
550+
551+ OCMStub ([mock show ]);
552+ [self .instabugBridge showChats ];
553+
554+ [[NSRunLoop mainRunLoop ] performBlock: ^{
555+ OCMVerify ([mock show ]);
556+ [expectation fulfill ];
557+ }];
558+
559+ [self waitForExpectationsWithTimeout: EXPECTATION_TIMEOUT handler: nil ];
560+ }
531561
532562@end
Original file line number Diff line number Diff line change 126126
127127- (void )setCrashReportingEnabled : (BOOL )enabledCrashReporter ;
128128
129+ /*
130+ +------------------------------------------------------------------------+
131+ | Chats Module |
132+ +------------------------------------------------------------------------+
133+ */
134+
135+ - (void )setChatsEnabled : (BOOL )isEnabled ;
136+ - (void )showChats ;
137+
129138@end
You can’t perform that action at this time.
0 commit comments