Skip to content

Commit 6600bf7

Browse files
Revert "Update ABTest for the new customTreatment case from Tracks library."
This reverts commit 56b1f4b.
1 parent 56b1f4b commit 6600bf7

File tree

6 files changed

+18
-29
lines changed

6 files changed

+18
-29
lines changed

Experiments/Experiments/ABTest.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,8 @@ public extension Variation {
7676
switch self {
7777
case .control:
7878
return "control"
79-
case .treatment:
80-
return "treatment"
81-
case .customTreatment(let string):
82-
return "treatment: \(string)"
79+
case .treatment(let string):
80+
return string.map { "treatment: \($0)" } ?? "treatment"
8381
}
8482
}
8583
}

Podfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ def aztec
2727
end
2828

2929
def tracks
30-
# pod 'Automattic-Tracks-iOS', '~> 0.13.0'
30+
pod 'Automattic-Tracks-iOS', '~> 0.13.0'
3131
# pod 'Automattic-Tracks-iOS', :git => 'https://github.com/Automattic/Automattic-Tracks-iOS.git', :branch => ''
32-
pod 'Automattic-Tracks-iOS', :git => 'https://github.com/Automattic/Automattic-Tracks-iOS.git', :commit => '5bcaa6db14d314ff388ed145af15c7a0379ee017'
32+
# pod 'Automattic-Tracks-iOS', :git => 'https://github.com/Automattic/Automattic-Tracks-iOS.git', :commit => ''
3333
# pod 'Automattic-Tracks-iOS', :path => '../Automattic-Tracks-iOS'
3434
end
3535

Podfile.lock

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ PODS:
3131
- Kingfisher (7.2.2)
3232
- NSObject-SafeExpectations (0.0.4)
3333
- "NSURL+IDN (0.4)"
34-
- Sentry (7.31.2):
35-
- Sentry/Core (= 7.31.2)
36-
- Sentry/Core (7.31.2)
34+
- Sentry (7.25.1):
35+
- Sentry/Core (= 7.25.1)
36+
- Sentry/Core (7.25.1)
3737
- Sodium (0.9.1)
3838
- Sourcery (1.0.3)
3939
- StripeTerminal (2.14.0)
4040
- SVProgressHUD (2.2.5)
41-
- UIDeviceIdentifier (2.2.0)
41+
- UIDeviceIdentifier (2.0.0)
4242
- WordPress-Aztec-iOS (1.11.0)
4343
- WordPress-Editor-iOS (1.11.0):
4444
- WordPress-Aztec-iOS (= 1.11.0)
@@ -82,7 +82,7 @@ PODS:
8282

8383
DEPENDENCIES:
8484
- Alamofire (~> 4.8)
85-
- Automattic-Tracks-iOS (from `https://github.com/Automattic/Automattic-Tracks-iOS.git`, commit `5bcaa6db14d314ff388ed145af15c7a0379ee017`)
85+
- Automattic-Tracks-iOS (~> 0.13.0)
8686
- CocoaLumberjack (~> 3.7.4)
8787
- CocoaLumberjack/Swift (~> 3.7.4)
8888
- Gridicons (~> 1.2.0)
@@ -106,6 +106,7 @@ SPEC REPOS:
106106
trunk:
107107
- Alamofire
108108
- AppAuth
109+
- Automattic-Tracks-iOS
109110
- CocoaLumberjack
110111
- FormatterKit
111112
- GoogleSignIn
@@ -139,16 +140,6 @@ SPEC REPOS:
139140
- ZendeskSupportProvidersSDK
140141
- ZendeskSupportSDK
141142

142-
EXTERNAL SOURCES:
143-
Automattic-Tracks-iOS:
144-
:commit: 5bcaa6db14d314ff388ed145af15c7a0379ee017
145-
:git: https://github.com/Automattic/Automattic-Tracks-iOS.git
146-
147-
CHECKOUT OPTIONS:
148-
Automattic-Tracks-iOS:
149-
:commit: 5bcaa6db14d314ff388ed145af15c7a0379ee017
150-
:git: https://github.com/Automattic/Automattic-Tracks-iOS.git
151-
152143
SPEC CHECKSUMS:
153144
Alamofire: 3ec537f71edc9804815215393ae2b1a8ea33a844
154145
AppAuth: 8fca6b5563a5baef2c04bee27538025e4ceb2add
@@ -163,12 +154,12 @@ SPEC CHECKSUMS:
163154
Kingfisher: 184d4d1a8c36666e663caf8e08abe87898595c53
164155
NSObject-SafeExpectations: ab8fe623d36b25aa1f150affa324e40a2f3c0374
165156
"NSURL+IDN": afc873e639c18138a1589697c3add197fe8679ca
166-
Sentry: b15765d11769852fe78c9add942f7df60ed5dbf5
157+
Sentry: dd29c18c32b0af9269949f079cf631d581ca76ca
167158
Sodium: 23d11554ecd556196d313cf6130d406dfe7ac6da
168159
Sourcery: 70a6048014bd4f37ea80e6bd4354d47bf3b760e1
169160
StripeTerminal: 9bb367c9efa7bcddf2602cc29f8962390d87b6a6
170161
SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6
171-
UIDeviceIdentifier: f33af270ba9045ea18b31d9aab88e42a0082ea67
162+
UIDeviceIdentifier: af4e11e25a2ea670078e2bd677bb0e8144f9f063
172163
WordPress-Aztec-iOS: 050b34d4c3adfb7c60363849049b13d60683b348
173164
WordPress-Editor-iOS: 304098424f1051cb271546c99f906aac296b1b81
174165
WordPressAuthenticator: 27178591a805804bd27959f1f76ddcb94605916c
@@ -187,6 +178,6 @@ SPEC CHECKSUMS:
187178
ZendeskSupportProvidersSDK: 2bdf8544f7cd0fd4c002546f5704b813845beb2a
188179
ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba
189180

190-
PODFILE CHECKSUM: 7ece374478e82b0728d3bd4eb086e5171a80e50f
181+
PODFILE CHECKSUM: 8b243f1ea76d4db3aa638b50ef0d516185d01c2c
191182

192183
COCOAPODS: 1.11.3

WooCommerce/Classes/ViewRelated/Dashboard/DashboardViewModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ final class DashboardViewModel {
151151
/// and if the user is part of the treatment group for the products onboarding A/B test.
152152
///
153153
private func setProductsOnboardingBannerIfNeeded() {
154-
guard ABTest.productsOnboardingBanner.variation == .treatment else {
154+
guard ABTest.productsOnboardingBanner.variation == .treatment(nil) else {
155155
return
156156
}
157157

WooCommerce/Classes/ViewRelated/Products/Add Product/AddProductCoordinator.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ final class AddProductCoordinator: Coordinator {
3737
init(siteID: Int64,
3838
sourceBarButtonItem: UIBarButtonItem,
3939
sourceNavigationController: UINavigationController,
40-
isProductCreationTypeEnabled: Bool = ABTest.productsOnboardingTemplateProducts.variation == .treatment,
40+
isProductCreationTypeEnabled: Bool = ABTest.productsOnboardingTemplateProducts.variation == .treatment(nil),
4141
storage: StorageManagerType = ServiceLocator.storageManager,
4242
productImageUploader: ProductImageUploaderProtocol = ServiceLocator.productImageUploader) {
4343
self.siteID = siteID
@@ -52,7 +52,7 @@ final class AddProductCoordinator: Coordinator {
5252
init(siteID: Int64,
5353
sourceView: UIView,
5454
sourceNavigationController: UINavigationController,
55-
isProductCreationTypeEnabled: Bool = ABTest.productsOnboardingTemplateProducts.variation == .treatment,
55+
isProductCreationTypeEnabled: Bool = ABTest.productsOnboardingTemplateProducts.variation == .treatment(nil),
5656
storage: StorageManagerType = ServiceLocator.storageManager,
5757
productImageUploader: ProductImageUploaderProtocol = ServiceLocator.productImageUploader) {
5858
self.siteID = siteID

WooCommerce/WooCommerceTests/ViewRelated/Dashboard/DashboardViewModelTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ final class DashboardViewModelTests: XCTestCase {
9191

9292
func test_products_onboarding_announcements_take_precedence() {
9393
// Given
94-
MockABTesting.setVariation(.treatment, for: .productsOnboardingBanner)
94+
MockABTesting.setVariation(.treatment(nil), for: .productsOnboardingBanner)
9595
stores.whenReceivingAction(ofType: ProductAction.self) { action in
9696
switch action {
9797
case let .checkProductsOnboardingEligibility(_, completion):
@@ -127,7 +127,7 @@ final class DashboardViewModelTests: XCTestCase {
127127

128128
func test_onboarding_announcement_not_displayed_when_previously_dismissed() {
129129
// Given
130-
MockABTesting.setVariation(.treatment, for: .productsOnboardingBanner)
130+
MockABTesting.setVariation(.treatment(nil), for: .productsOnboardingBanner)
131131
stores.whenReceivingAction(ofType: ProductAction.self) { action in
132132
switch action {
133133
case let .checkProductsOnboardingEligibility(_, completion):

0 commit comments

Comments
 (0)