Skip to content

Commit 69219bd

Browse files
committed
Moved to a beta, added release for web2app branch
- Fixed tests too
1 parent 9414aaa commit 69219bd

File tree

7 files changed

+11
-30
lines changed

7 files changed

+11
-30
lines changed

.github/workflows/tag-version.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: TagVersion
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [ master, feature/web2app ]
66

77
concurrency:
88
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -68,4 +68,3 @@ jobs:
6868
env:
6969
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
7070
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
71-

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The changelog for `SuperwallKit`. Also see the [releases](https://github.com/superwall/Superwall-iOS/releases) on GitHub.
44

5-
## 4.1.0
5+
## 4.1.0-beta.1
66

77
### Enhancements
88

Sources/SuperwallKit/Misc/Constants.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ let sdkVersion = """
1818
*/
1919

2020
let sdkVersion = """
21-
4.1.0
21+
4.1.0-beta.1
2222
"""

SuperwallKit.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = "SuperwallKit"
4-
s.version = "4.1.0"
4+
s.version = "4.1.0-beta.1"
55
s.summary = "Superwall: In-App Paywalls Made Easy"
66
s.description = "Paywall infrastructure for mobile apps :) we make things like editing your paywall and running price tests as easy as clicking a few buttons. superwall.com"
77

Tests/SuperwallKitTests/Storage/Cache/CacheMock.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@ final class CacheMock: Cache {
1717
init(
1818
cacheInternalValue: [String: Data] = [:],
1919
userDocumentsInternalValue: [String: Data] = [:],
20-
appDocumentsInternalValue: [String: Data] = [:],
21-
factory: ExternalPurchaseControllerFactory = DependencyContainer()
20+
appDocumentsInternalValue: [String: Data] = [:]
2221
) {
2322
self.internalCache = cacheInternalValue
2423
self.internalUserDocuments = userDocumentsInternalValue
2524
self.internalAppDocuments = appDocumentsInternalValue
26-
super.init(factory: factory)
2725
}
2826

2927
override func read<Key>(

Tests/SuperwallKitTests/Storage/Cache/CacheTests.swift

+3-14
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ struct CacheTests {
3636
)
3737
cache = Cache(
3838
fileManager: fileManager,
39-
ioQueue: DispatchQueue(label: "ioQueue"),
40-
factory: DependencyContainer()
39+
ioQueue: DispatchQueue(label: "ioQueue")
4140
)
4241
}
4342

@@ -134,13 +133,9 @@ struct CacheTests {
134133
#expect(!fileManager.fileExists(atPath: appDocFolder.path))
135134
}
136135

137-
/// Test that cleanUserCodes correctly filters out non-device results and writes updated entitlements.
136+
/// Test that cleanUserCodes correctly filters out non-device results and clears entitlements.
138137
@Test("Filters out non-device results")
139138
mutating func testCleanUserCodes_() async throws {
140-
let mockPC = MockPurchaseController()
141-
let mockFactory = MockExternalPurchaseControllerFactory(purchaseController: mockPC)
142-
cache = Cache(factory: mockFactory)
143-
144139
let entitlement1 = Entitlement(id: "a")
145140
let entitlement2 = Entitlement(id: "b")
146141
let entitlement3 = Entitlement(id: "c")
@@ -208,17 +203,12 @@ struct CacheTests {
208203

209204
// Should only contain the deviceSuccess and expiredDevice
210205
#expect(updatedResponse.results.count == 2)
211-
#expect(updatedResponse.entitlements == [entitlement1])
212-
#expect(mockPC.didCallOffDeviceSubscriptionsDidChange == true)
206+
#expect(updatedResponse.entitlements.isEmpty)
213207
}
214208

215209
/// Test that cleanUserCodes correctly filters out non-device results and writes updated entitlements.
216210
@Test("Filters out non-device results")
217211
mutating func testEntitlementsAreSame() async throws {
218-
let mockPC = MockPurchaseController()
219-
let mockFactory = MockExternalPurchaseControllerFactory(purchaseController: mockPC)
220-
cache = Cache(factory: mockFactory)
221-
222212
let entitlement2 = Entitlement(id: "b")
223213
let entitlement3 = Entitlement(id: "c")
224214

@@ -268,6 +258,5 @@ struct CacheTests {
268258
// Should only contain the deviceSuccess and expiredDevice
269259
#expect(updatedResponse.results.count == 1)
270260
#expect(updatedResponse.entitlements.isEmpty)
271-
#expect(mockPC.didCallOffDeviceSubscriptionsDidChange == false)
272261
}
273262
}

Tests/SuperwallKitTests/Storage/StorageMock.swift

+3-8
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@ final class StorageMock: Storage {
1717
var didClearCachedSessionEvents = false
1818
var didSave = false
1919

20-
class DeviceInfoFactoryMock: DeviceHelperFactory, ExternalPurchaseControllerFactory {
21-
func makeExternalPurchaseController() -> any SuperwallKit.PurchaseController {
22-
DependencyContainer().purchaseController
23-
}
24-
20+
class DeviceInfoFactoryMock: DeviceHelperFactory, HasExternalPurchaseControllerFactory {
2521
func makeDeviceInfo() -> DeviceInfo {
2622
return DeviceInfo(appInstalledAtString: "a", locale: "b")
2723
}
@@ -44,13 +40,12 @@ final class StorageMock: Storage {
4440
internalSurveyAssignmentKey: String? = nil,
4541
coreDataManager: CoreDataManagerFakeDataMock = CoreDataManagerFakeDataMock(),
4642
confirmedAssignments: Set<Assignment>? = [],
47-
cache: Cache? = nil
43+
cache: Cache = Cache()
4844
) {
4945
self.internalCachedTransactions = internalCachedTransactions
5046
self.internalConfirmedAssignments = confirmedAssignments
5147
self.internalSurveyAssignmentKey = internalSurveyAssignmentKey
52-
let factory = DeviceInfoFactoryMock()
53-
super.init(factory: DeviceInfoFactoryMock(), cache: cache ?? Cache(factory: factory), coreDataManager: coreDataManager)
48+
super.init(factory: DeviceInfoFactoryMock(), cache: cache, coreDataManager: coreDataManager)
5449
}
5550

5651
override func get<Key>(_ keyType: Key.Type) -> Key.Value? where Key : Storable {

0 commit comments

Comments
 (0)