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 @@ -534,5 +534,35 @@ - (void)testSetCrashReportingEnabled {
534534 XCTAssertFalse (IBGCrashReporting.enabled );
535535}
536536
537+ /*
538+ +------------------------------------------------------------------------+
539+ | Chats Module |
540+ +------------------------------------------------------------------------+
541+ */
542+
543+ - (void )testSetChatsEnabled {
544+ id mock = OCMClassMock ([Instabug class ]);
545+
546+ [self .instabugBridge setChatsEnabled: YES ];
547+ XCTAssertTrue (IBGChats.enabled );
548+
549+ [self .instabugBridge setChatsEnabled: NO ];
550+ XCTAssertFalse (IBGChats.enabled );
551+ }
552+
553+ - (void )testShowChats {
554+ id mock = OCMClassMock ([IBGChats class ]);
555+ XCTestExpectation *expectation = [self expectationWithDescription: @" Testing [IBGChats showChats]" ];
556+
557+ OCMStub ([mock show ]);
558+ [self .instabugBridge showChats ];
559+
560+ [[NSRunLoop mainRunLoop ] performBlock: ^{
561+ OCMVerify ([mock show ]);
562+ [expectation fulfill ];
563+ }];
564+
565+ [self waitForExpectationsWithTimeout: EXPECTATION_TIMEOUT handler: nil ];
566+ }
537567
538568@end
Original file line number Diff line number Diff line change 127127
128128- (void )setCrashReportingEnabled : (BOOL )enabledCrashReporter ;
129129
130+ /*
131+ +------------------------------------------------------------------------+
132+ | Chats Module |
133+ +------------------------------------------------------------------------+
134+ */
135+
136+ - (void )setChatsEnabled : (BOOL )isEnabled ;
137+ - (void )showChats ;
138+
130139@end
You can’t perform that action at this time.
0 commit comments