Skip to content

Commit

Permalink
Offline Entitlements: fixed iOS 12 tests (#2514)
Browse files Browse the repository at this point in the history
These 2 tests should have been skipped on iOS 12.

Technically offline entitlements require iOS 15, but we can still run
these tests before that, which doesn't hurt. However, in iOS 12, we
can't even tell if the `CustomerInfo` was computed offline, so no point
running them.
  • Loading branch information
NachoSoto authored May 19, 2023
1 parent 50ffbfb commit 55818e7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Tests/UnitTests/Purchasing/CustomerInfoTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,11 @@ class BasicCustomerInfoTests: TestCase {
expect(self.customerInfo.copy(with: .failed).isComputedOffline) == false
}

func testIsComputedOffline() {
func testIsComputedOffline() throws {
// `CustomerInfo.entitlements.verification` isn't available in iOS 12,
// but offline CustomerInfo isn't supported anyway.
try AvailabilityChecks.iOS13APIAvailableOrSkipTest()

expect(self.customerInfo.copy(with: .verifiedOnDevice).isComputedOffline) == true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ class PurchasesPurchasingTests: BasePurchasesTests {
}

func testDoesntFinishTransactionIfComputingCustomerInfoOffline() throws {
// `CustomerInfo.entitlements.verification` isn't available in iOS 12,
// but offline CustomerInfo isn't supported anyway.
try AvailabilityChecks.iOS13APIAvailableOrSkipTest()

var finished = false

let productID = "com.product.id1"
Expand Down

0 comments on commit 55818e7

Please sign in to comment.