File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
iOS_SDK/OneSignalSDK/UnitTests Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -1388,15 +1388,23 @@ - (void)testSendBadObjectInTags {
13881388 [UnitTestCommonMethods initOneSignal_andThreadWait ];
13891389
13901390 XCTAssertEqual (OneSignalClientOverrider.networkRequestCount , 2 );
1391+ XCTestExpectation *errorExpectation = [self expectationWithDescription: @" onesignal_failure_block_called" ];
1392+ errorExpectation.expectedFulfillmentCount = 1 ;
13911393 // The OneSignal class is not a valid json object
1392- [OneSignal sendTags: @{@" key1" : @" value1" , @" key2" : [OneSignal new ]}];
1394+ [OneSignal sendTags: @{@" key1" : @" value1" , @" key2" : [OneSignal new ]} onSuccess: ^(NSDictionary *result) {
1395+ XCTAssertNotNil (nil ); // Assert if success is called
1396+ } onFailure: ^(NSError *error) {
1397+ XCTAssertEqualObjects (error.domain , @" com.onesignal.tags" );
1398+ [errorExpectation fulfill ];
1399+ }];
13931400
13941401 // Make sure the tags were not sent.
13951402 [NSObjectOverrider runPendingSelectors ];
13961403 [UnitTestCommonMethods runBackgroundThreads ];
13971404 [NSObjectOverrider runPendingSelectors ];
13981405
13991406 XCTAssertEqual (OneSignalClientOverrider.networkRequestCount , 2 );
1407+ [self waitForExpectations: @[errorExpectation] timeout: 1 ];
14001408}
14011409
14021410- (void )testDeleteTags {
You can’t perform that action at this time.
0 commit comments