Skip to content

Commit 038176a

Browse files
author
Evan Greer
committed
update pointers
1 parent 6db86f8 commit 038176a

File tree

4 files changed

+21
-11
lines changed

4 files changed

+21
-11
lines changed

Iterable-iOS-AppExtensions.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22
s.name = "Iterable-iOS-AppExtensions"
33
s.module_name = "IterableAppExtensions"
4-
s.version = "6.6.0-beta"
4+
s.version = "6.6.0-beta1"
55
s.summary = "App Extensions for Iterable SDK"
66

77
s.description = <<-DESC

Iterable-iOS-SDK.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22
s.name = "Iterable-iOS-SDK"
33
s.module_name = "IterableSDK"
4-
s.version = "6.6.0-beta"
4+
s.version = "6.6.0-beta1"
55
s.summary = "Iterable's official SDK for iOS"
66

77
s.description = <<-DESC

swift-sdk/IterableAPI.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import UIKit
77

88
@objcMembers public final class IterableAPI: NSObject {
99
/// The current SDK version
10-
public static let sdkVersion = "6.6.0-beta"
10+
public static let sdkVersion = "6.6.0-beta1"
1111

1212
/// The email of the logged in user that this IterableAPI is using
1313
public static var email: String? {

tests/unit-tests/UserMergeScenariosTests.swift

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,35 +84,45 @@ class UserMergeScenariosTests: XCTestCase, AuthProvider {
8484
}
8585

8686
func testCriteriaNotMetUserIdDefault() { // criteria not met with merge default with setUserId
87+
// Setup
8788
let config = IterableConfig()
8889
config.enableAnonActivation = true
8990
IterableAPI.initializeForTesting(apiKey: UserMergeScenariosTests.apiKey,
9091
config: config,
9192
networkSession: mockSession,
9293
localStorage: localStorage)
9394
IterableAPI.logoutUser()
95+
9496
guard let jsonData = mockData.data(using: .utf8) else { return }
9597
localStorage.criteriaData = jsonData
98+
99+
// trigger custom event
96100
IterableAPI.track(event: "testEvent123")
97101

98-
if let events = localStorage.anonymousUserEvents {
99-
XCTAssertFalse(events.isEmpty, "Expected events to be logged")
100-
} else {
101-
XCTFail("Expected events to be logged but found nil")
102-
}
102+
waitForDuration(seconds: 1)
103+
104+
// Verify no purchase or anon session requests were made initially
105+
XCTAssertNil(mockSession.getRequest(withEndPoint: Const.Path.trackAnonSession),
106+
"There should not be an anon session request")
107+
XCTAssertNil(mockSession.getRequest(withEndPoint: Const.Path.trackPurchase),
108+
"There should not be a purchase request")
109+
103110

104111
IterableAPI.setUserId("testuser123")
112+
105113
if let userId = IterableAPI.userId {
106114
XCTAssertEqual(userId, "testuser123", "Expected userId to be 'testuser123'")
107115
} else {
108116
XCTFail("Expected userId but found nil")
109117
}
110118
waitForDuration(seconds: 5)
111119

112-
if localStorage.anonymousUserEvents != nil {
113-
XCTFail("Events are not replayed")
120+
// Verify purchase request was made after setting user ID
121+
if let purchaseRequest = mockSession.getRequest(withEndPoint: Const.Path.trackPurchase) {
122+
XCTAssertNotNil(purchaseRequest, "Expected purchase request on event replay")
123+
// Optional: Verify request details if needed
114124
} else {
115-
XCTAssertNil(localStorage.anonymousUserEvents, "Expected events to be nil")
125+
XCTFail("No purchase request was made after setting user ID")
116126
}
117127

118128
// Verify "merge user" API call is not made

0 commit comments

Comments
 (0)