@@ -35,45 +35,37 @@ class IterableAPITests: XCTestCase {
35
35
}
36
36
37
37
func testInitializeCheckEndpoint( ) {
38
- let expectation1 = XCTestExpectation ( description: " links endpoint called " )
39
- let expectation2 = XCTestExpectation ( description: " api endpoint called " )
38
+ let expectation1 = XCTestExpectation ( description: " api endpoint called " )
40
39
41
40
let mockNetworkSession = MockNetworkSession ( )
42
41
mockNetworkSession. requestCallback = { urlRequest in
43
42
if let url = urlRequest. url {
44
- if url. absoluteString. starts ( with: Endpoint . links ) {
43
+ if url. absoluteString. starts ( with: Endpoint . api ) {
45
44
expectation1. fulfill ( )
46
- } else if url. absoluteString. starts ( with: Endpoint . api) {
47
- expectation2. fulfill ( )
48
45
}
49
46
}
50
47
}
51
48
52
49
let config = IterableConfig ( )
53
- config. checkForDeferredDeeplink = true
54
50
let internalAPI = IterableAPIInternal . initializeForTesting ( apiKey: IterableAPITests . apiKey, config: config, networkSession: mockNetworkSession)
55
51
internalAPI. email = IterableAPITests . email
56
52
internalAPI. track ( " Some Event " )
57
53
58
54
XCTAssertEqual ( internalAPI. apiKey, IterableAPITests . apiKey)
59
55
60
- wait ( for: [ expectation1, expectation2 ] , timeout: testExpectationTimeout)
56
+ wait ( for: [ expectation1] , timeout: testExpectationTimeout)
61
57
}
62
58
63
59
func testInitializeWithNewEndpoint( ) {
64
- let expectation1 = XCTestExpectation ( description: " new links endpoint called " )
65
- let expectation2 = XCTestExpectation ( description: " new api endpoint called " )
60
+ let expectation1 = XCTestExpectation ( description: " new api endpoint called " )
66
61
67
62
let newApiEndpoint = " https://test.iterable.com/api/ "
68
- let newLinksEndpoint = " https://links.test.iterable.com/ "
69
63
70
64
let mockNetworkSession = MockNetworkSession ( )
71
65
mockNetworkSession. requestCallback = { urlRequest in
72
66
if let url = urlRequest. url {
73
- if url. absoluteString. starts ( with: newLinksEndpoint ) {
67
+ if url. absoluteString. starts ( with: newApiEndpoint ) {
74
68
expectation1. fulfill ( )
75
- } else if url. absoluteString. starts ( with: newApiEndpoint) {
76
- expectation2. fulfill ( )
77
69
}
78
70
}
79
71
}
@@ -83,14 +75,13 @@ class IterableAPITests: XCTestCase {
83
75
let internalAPI = IterableAPIInternal . initializeForTesting ( apiKey: IterableAPITests . apiKey,
84
76
config: config,
85
77
apiEndPointOverride: newApiEndpoint,
86
- linksEndPointOverride: newLinksEndpoint,
87
78
networkSession: mockNetworkSession)
88
79
internalAPI. email = IterableAPITests . email
89
80
internalAPI. track ( " Some Event " )
90
81
91
82
XCTAssertEqual ( internalAPI. apiKey, IterableAPITests . apiKey)
92
83
93
- wait ( for: [ expectation1, expectation2 ] , timeout: testExpectationTimeout)
84
+ wait ( for: [ expectation1] , timeout: testExpectationTimeout)
94
85
}
95
86
96
87
func testTrackEventWithNoEmailOrUser( ) {
0 commit comments