@@ -1363,8 +1363,7 @@ class InAppTests: XCTestCase {
1363
1363
}
1364
1364
1365
1365
fileprivate func verifyCustomActionIsCalled( customActionScheme: String , customActionName: String ) {
1366
- let expectation1 = expectation ( description: " ensure correct number of messages " )
1367
- let expectation2 = expectation ( description: " verify custom action is called, customActionScheme: \( customActionScheme) , customActionName: \( customActionName) " )
1366
+ let expectation1 = expectation ( description: " verify custom action is called, customActionScheme: \( customActionScheme) , customActionName: \( customActionName) " )
1368
1367
1369
1368
let mockInAppFetcher = MockInAppFetcher ( )
1370
1369
@@ -1377,7 +1376,7 @@ class InAppTests: XCTestCase {
1377
1376
let mockCustomActionDelegate = MockCustomActionDelegate ( returnValue: true )
1378
1377
mockCustomActionDelegate. callback = { actionName, _ in
1379
1378
XCTAssertEqual ( actionName, customActionName)
1380
- expectation2 . fulfill ( )
1379
+ expectation1 . fulfill ( )
1381
1380
}
1382
1381
1383
1382
let config = IterableConfig ( )
@@ -1404,17 +1403,9 @@ class InAppTests: XCTestCase {
1404
1403
}
1405
1404
""" . toJsonDict ( )
1406
1405
1407
- mockInAppFetcher. mockInAppPayloadFromServer ( internalApi: internalApi, payload) . onSuccess { [ weak internalApi] _ in
1408
- guard let internalApi = internalApi else {
1409
- XCTFail ( " Expected internalApi to be not nil " )
1410
- return
1411
- }
1412
- let messages = internalApi. inAppManager. getMessages ( )
1413
- XCTAssertEqual ( messages. count, 1 )
1414
- expectation1. fulfill ( )
1415
- }
1406
+ mockInAppFetcher. mockInAppPayloadFromServer ( internalApi: internalApi, payload)
1416
1407
1417
- wait ( for: [ expectation1, expectation2 ] , timeout: testExpectationTimeout, enforceOrder : true )
1408
+ wait ( for: [ expectation1] , timeout: testExpectationTimeout)
1418
1409
}
1419
1410
}
1420
1411
0 commit comments