From 0dab91fe578f7f71d2f58d261915f14da2753b2b Mon Sep 17 00:00:00 2001 From: NachoSoto Date: Tue, 13 Jun 2023 09:09:23 -0700 Subject: [PATCH] `IntegrationTests`: explicit SK1 mode I noticed that `BaseBackendIntegrationTests` sets the `StoreKit2Setting` to `.default`, but in these `StoreKit 1` tests we weren't overriding that setting. When the default changes to `StoreKit 2`, this would have unknowingly changed and we'd have stopped testing `StoreKit 1`. --- .../OfflineStoreKitIntegrationTests.swift | 2 ++ .../StoreKitObserverModeIntegrationTests.swift | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/Tests/BackendIntegrationTests/OfflineStoreKitIntegrationTests.swift b/Tests/BackendIntegrationTests/OfflineStoreKitIntegrationTests.swift index 3404f93ccb..3b0249f634 100644 --- a/Tests/BackendIntegrationTests/OfflineStoreKitIntegrationTests.swift +++ b/Tests/BackendIntegrationTests/OfflineStoreKitIntegrationTests.swift @@ -40,6 +40,8 @@ class OfflineStoreKit2IntegrationTests: OfflineStoreKit1IntegrationTests { class OfflineStoreKit1IntegrationTests: BaseOfflineStoreKitIntegrationTests { + override class var storeKit2Setting: StoreKit2Setting { return .disabled } + override func setUp() async throws { try await super.setUp() diff --git a/Tests/BackendIntegrationTests/StoreKitObserverModeIntegrationTests.swift b/Tests/BackendIntegrationTests/StoreKitObserverModeIntegrationTests.swift index 089fa53d33..730d08ed5a 100644 --- a/Tests/BackendIntegrationTests/StoreKitObserverModeIntegrationTests.swift +++ b/Tests/BackendIntegrationTests/StoreKitObserverModeIntegrationTests.swift @@ -63,6 +63,8 @@ class StoreKit2ObserverModeIntegrationTests: StoreKit1ObserverModeIntegrationTes class StoreKit1ObserverModeIntegrationTests: BaseStoreKitObserverModeIntegrationTests { + override class var storeKit2Setting: StoreKit2Setting { return .disabled } + func testPurchaseOutsideTheAppPostsReceipt() async throws { try self.testSession.buyProduct(productIdentifier: Self.monthlyNoIntroProductID) @@ -83,6 +85,8 @@ class StoreKit2ObserverModeWithExistingPurchasesTests: StoreKit1ObserverModeWith @available(iOS 15.0, tvOS 15.0, watchOS 8.0, macOS 12.0, *) class StoreKit1ObserverModeWithExistingPurchasesTests: BaseStoreKitObserverModeIntegrationTests { + override class var storeKit2Setting: StoreKit2Setting { return .disabled } + // MARK: - Transactions observation private static var transactionsObservation: Task?