diff --git a/Tests/StoreKitUnitTests/StorefrontTests.swift b/Tests/StoreKitUnitTests/StorefrontTests.swift index 1c64ff8ccc..330724c01d 100644 --- a/Tests/StoreKitUnitTests/StorefrontTests.swift +++ b/Tests/StoreKitUnitTests/StorefrontTests.swift @@ -47,4 +47,14 @@ class StorefrontTests: StoreKitConfigTestCase { } } + func testSystemInfoStorefront() async throws { + let expected = "ESP" + try await self.changeStorefront(expected) + + let systemInfo = SystemInfo(platformInfo: nil, finishTransactions: false) + let storefront = try XCTUnwrap(systemInfo.storefront) + + expect(storefront.countryCode) == expected + } + } diff --git a/Tests/UnitTests/Misc/SystemInfoTests.swift b/Tests/UnitTests/Misc/SystemInfoTests.swift index 8e53969b99..762a1f850b 100644 --- a/Tests/UnitTests/Misc/SystemInfoTests.swift +++ b/Tests/UnitTests/Misc/SystemInfoTests.swift @@ -54,14 +54,12 @@ class SystemInfoTests: TestCase { expect(SystemInfo.withReceiptResult(.receiptWithData, sandboxDetector).isSandbox) == false } - func testStorefront() { - let storefront = SystemInfo(platformInfo: nil, finishTransactions: false).storefront - + func testStorefrontForUnsupportedPlatforms() throws { if #available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.2, macCatalyst 13.1, *) { - expect(storefront?.countryCode) == "USA" - } else { - expect(storefront).to(beNil()) + throw XCTSkip("Test only for older platforms") } + + expect(SystemInfo.default.storefront).to(beNil()) } func testIsAppleSubscriptionURLWithAnotherURL() {