From f406e82a16500e5e6ecb9b2921ba31d1f3107c30 Mon Sep 17 00:00:00 2001 From: Antonio Pallares Date: Tue, 28 Jan 2025 10:08:33 +0100 Subject: [PATCH] test: add API test for new `DangerousSettings` init --- .../AllAPITests.xcodeproj/project.pbxproj | 6 ++++++ .../SwiftAPITester/DangerousSettingsAPI.swift | 18 ++++++++++++++++++ .../AllAPITests/SwiftAPITester/main.swift | 2 ++ 3 files changed, 26 insertions(+) create mode 100644 Tests/APITesters/AllAPITests/SwiftAPITester/DangerousSettingsAPI.swift diff --git a/Tests/APITesters/AllAPITests/AllAPITests.xcodeproj/project.pbxproj b/Tests/APITesters/AllAPITests/AllAPITests.xcodeproj/project.pbxproj index 29e89d517d..8c186e32f9 100644 --- a/Tests/APITesters/AllAPITests/AllAPITests.xcodeproj/project.pbxproj +++ b/Tests/APITesters/AllAPITests/AllAPITests.xcodeproj/project.pbxproj @@ -126,6 +126,7 @@ 3502630E2CF61E9F00894270 /* SubscriptionInfoAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3502630D2CF61E9A00894270 /* SubscriptionInfoAPI.swift */; }; 35370AC52CFF8304004F0A64 /* RCSubscriptionInfoAPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 35370AC42CFF82F8004F0A64 /* RCSubscriptionInfoAPI.h */; }; 35370AC82CFF8317004F0A64 /* RCSubscriptionInfoAPI.m in Sources */ = {isa = PBXBuildFile; fileRef = 35370AC72CFF8312004F0A64 /* RCSubscriptionInfoAPI.m */; }; + 75C1B6AD2D48D4550011512D /* DangerousSettingsAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75C1B6AC2D48D4550011512D /* DangerousSettingsAPI.swift */; }; FD33CD732D03587E000D13A4 /* CustomerCenterViewControllerAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD33CD722D035876000D13A4 /* CustomerCenterViewControllerAPI.swift */; }; FDCC983A2D0A0FD500F5854B /* CustomerCenterViewAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDCC98392D0A0FD500F5854B /* CustomerCenterViewAPI.swift */; }; /* End PBXBuildFile section */ @@ -354,6 +355,8 @@ 3502630D2CF61E9A00894270 /* SubscriptionInfoAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionInfoAPI.swift; sourceTree = ""; }; 35370AC42CFF82F8004F0A64 /* RCSubscriptionInfoAPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCSubscriptionInfoAPI.h; sourceTree = ""; }; 35370AC72CFF8312004F0A64 /* RCSubscriptionInfoAPI.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RCSubscriptionInfoAPI.m; sourceTree = ""; }; + 75C1B6AC2D48D4550011512D /* DangerousSettingsAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DangerousSettingsAPI.swift; sourceTree = ""; }; + 75C1B6AE2D48D4DB0011512D /* RevenueCat.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = RevenueCat.framework; sourceTree = BUILT_PRODUCTS_DIR; }; FD33CD722D035876000D13A4 /* CustomerCenterViewControllerAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomerCenterViewControllerAPI.swift; sourceTree = ""; }; FDCC98392D0A0FD500F5854B /* CustomerCenterViewAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomerCenterViewAPI.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -533,6 +536,7 @@ 2D4C61942C5AD34900A29FD2 /* Frameworks */ = { isa = PBXGroup; children = ( + 75C1B6AE2D48D4DB0011512D /* RevenueCat.framework */, 2D4C62D82C5D41EC00A29FD2 /* RevenueCat.framework */, 2D4C62D42C5D41E200A29FD2 /* RevenueCat.framework */, 2D4C62D02C5D41D400A29FD2 /* ReceiptParser.framework */, @@ -551,6 +555,7 @@ 2D4C61D42C5AD62900A29FD2 /* ConfigurationAPI.swift */, 1E37C7812C6518410009D546 /* CustomerCenterConfigDataAPI.swift */, 2D4C61C92C5AD62800A29FD2 /* CustomerInfoAPI.swift */, + 75C1B6AC2D48D4550011512D /* DangerousSettingsAPI.swift */, 2D4C61CA2C5AD62900A29FD2 /* EntitlementInfoAPI.swift */, 2D4C61C12C5AD62800A29FD2 /* EntitlementInfosAPI.swift */, 2D4C61D52C5AD62900A29FD2 /* ErrorCodesAPI.swift */, @@ -1021,6 +1026,7 @@ 2D4C61E32C5AD62A00A29FD2 /* PurchasesDiagnosticsAPI.swift in Sources */, 2D4C61E22C5AD62A00A29FD2 /* CustomerInfoAPI.swift in Sources */, 2D4C61DC2C5AD62A00A29FD2 /* StoreTransactionAPI.swift in Sources */, + 75C1B6AD2D48D4550011512D /* DangerousSettingsAPI.swift in Sources */, 2D4C61EC2C5AD62A00A29FD2 /* AttributionAPI.swift in Sources */, 2D4C61EB2C5AD62A00A29FD2 /* AttributionNetworkAPI.swift in Sources */, 2D4C61ED2C5AD62A00A29FD2 /* PackageAPI.swift in Sources */, diff --git a/Tests/APITesters/AllAPITests/SwiftAPITester/DangerousSettingsAPI.swift b/Tests/APITesters/AllAPITests/SwiftAPITester/DangerousSettingsAPI.swift new file mode 100644 index 0000000000..869d35246c --- /dev/null +++ b/Tests/APITesters/AllAPITests/SwiftAPITester/DangerousSettingsAPI.swift @@ -0,0 +1,18 @@ +// +// Copyright RevenueCat Inc. All Rights Reserved. +// +// Licensed under the MIT License (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://opensource.org/licenses/MIT +// +// DangerousSettingsAPI.swift +// +// Created by Antonio Pallares on 28/1/25. + +@_spi(Internal) import RevenueCat + +func checkDangerousSettingsAPI() { + let _: DangerousSettings = DangerousSettings(uiPreviewMode: true) +} diff --git a/Tests/APITesters/AllAPITests/SwiftAPITester/main.swift b/Tests/APITesters/AllAPITests/SwiftAPITester/main.swift index 7ea4e440c4..6d58a72fa0 100644 --- a/Tests/APITesters/AllAPITests/SwiftAPITester/main.swift +++ b/Tests/APITesters/AllAPITests/SwiftAPITester/main.swift @@ -70,5 +70,7 @@ func main() -> Int { checkVerificationResultAPI() + checkDangerousSettingsAPI() + return 0 }