-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't override designated initializer
- Loading branch information
Showing
2 changed files
with
36 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,42 +81,45 @@ class OfflineModeEndpointTests: XCTestCase { | |
"messageId": "msg_1", | ||
], | ||
] | ||
api.trackPushOpen(pushPayload, | ||
dataFields: ["data_field1": "value1"], | ||
onSuccess: { _ in | ||
expectation1.fulfill() | ||
}) { reason, _ in | ||
api.trackPushOpen( | ||
pushPayload, | ||
dataFields: ["data_field1": "value1"], | ||
onSuccess: { _ in | ||
expectation1.fulfill() | ||
} | ||
) { reason, _ in | ||
XCTFail(reason ?? "failed") | ||
} | ||
|
||
wait(for: [expectation1], timeout: 15) | ||
} | ||
|
||
func test04TrackEvent() throws { | ||
let expectation1 = expectation(description: #function) | ||
let localStorage = MockLocalStorage() | ||
localStorage.offlineMode = true | ||
let api = InternalIterableAPI.initializeForE2E(apiKey: Self.apiKey, | ||
localStorage: localStorage) | ||
let api = InternalIterableAPI.initializeForE2E( | ||
apiKey: Self.apiKey, | ||
localStorage: localStorage | ||
) | ||
api.email = "[email protected]" | ||
|
||
api.track("event1", | ||
dataFields: ["data_field1": "value1"], | ||
onSuccess: { _ in | ||
expectation1.fulfill() | ||
}) { reason, _ in | ||
|
||
api.track( | ||
"event1", | ||
dataFields: ["data_field1": "value1"], | ||
onSuccess: { _ in | ||
expectation1.fulfill() | ||
} | ||
) { reason, _ in | ||
XCTFail(reason ?? "failed") | ||
} | ||
|
||
wait(for: [expectation1], timeout: 15) | ||
} | ||
|
||
private static let apiKey = Environment.apiKey! | ||
private static let pushCampaignId = Environment.pushCampaignId! | ||
private static let pushTemplateId = Environment.pushTemplateId! | ||
private static let inAppCampaignId = Environment.inAppCampaignId! | ||
private lazy var persistenceContextProvider: IterablePersistenceContextProvider = { | ||
let provider = CoreDataPersistenceContextProvider()! | ||
return provider | ||
}() | ||
private lazy var persistenceContextProvider: IterablePersistenceContextProvider = CoreDataPersistenceContextProvider() | ||
} |