From b3ea3eb8588d333a4776f7cb1b36b5c03fd9b72f Mon Sep 17 00:00:00 2001 From: NachoSoto Date: Thu, 8 Jun 2023 12:27:25 -0700 Subject: [PATCH] iOS 17 snapshots --- Tests/UnitTests/Misc/AnyEncodableTests.swift | 7 +++- ...json => iOS12-testNestedDictionary.1.json} | 0 .../iOS13-testNestedDictionary.1.json | 18 ++++++++++ .../iOS14-testNestedDictionary.1.json | 18 ++++++++++ .../iOS15-testNestedDictionary.1.json | 18 ++++++++++ .../iOS16-testNestedDictionary.1.json | 18 ++++++++++ .../iOS17-testNestedDictionary.1.json | 18 ++++++++++ Tests/UnitTests/Mocks/MockHTTPClient.swift | 5 +-- ...stCachesCustomerGetsForSameCustomer.1.json | 10 ++++++ ...sntCacheCustomerGetsForSameCustomer.1.json | 10 ++++++ ...sntCacheCustomerGetsForSameCustomer.2.json | 10 ++++++ .../iOS17-testEncodesCustomerUserID.1.json | 10 ++++++ ...testGetCustomerCallsBackendProperly.1.json | 10 ++++++ ...tCustomerInfoDoesNotMakeTwoRequests.1.json | 10 ++++++ ...tCustomerInfoWithFailedVerification.1.json | 10 ++++++ ...GetCustomerInfoWithVerifiedResponse.1.json | 10 ++++++ .../iOS17-testGetsCustomerInfo.1.json | 10 ++++++ ...17-testHandlesGetCustomerInfoErrors.1.json | 10 ++++++ .../iOS17-testHandlesInvalidJSON.1.json | 10 ++++++ .../iOS17-testSendsNonceWhenEnabled.1.json | 11 ++++++ ...pdatesRequestDateFromResponseHeader.1.json | 10 ++++++ ...iOS17-testEligibilityUnknownIfError.1.json | 17 ++++++++++ ...estEligibilityUnknownIfUnknownError.1.json | 17 ++++++++++ .../iOS17-testPostsProductIdentifiers.1.json | 18 ++++++++++ ...lementsDoesntCacheForMultipleUserID.1.json | 10 ++++++ ...lementsDoesntCacheForMultipleUserID.2.json | 10 ++++++ ...testGetOfferingsCachesForSameUserID.1.json | 10 ++++++ ...S17-testGetOfferingsCallsHTTPMethod.1.json | 10 ++++++ ...ringsCallsHTTPMethodWithRandomDelay.1.json | 10 ++++++ .../iOS17-testGetOfferingsFailSendsNil.1.json | 10 ++++++ ...tGetOfferingsNetworkErrorSendsError.1.json | 10 ++++++ .../iOS17-testGetOfferingsOneOffering.1.json | 10 ++++++ ...testRepeatedRequestsLogDebugMessage.1.json | 10 ++++++ ...testHealthRequestIsNotAuthenticated.1.json | 10 ++++++ .../iOS17-testHealthRequestWithFailure.1.json | 10 ++++++ .../iOS17-testHealthRequestWithSuccess.1.json | 10 ++++++ ...iOS17-testLoginCachesForSameUserIDs.1.json | 13 +++++++ ...oginCallsAllCompletionBlocksInCache.1.json | 13 +++++++ ...ithCustomerInfoAndCreatedFalseIf200.1.json | 13 +++++++ ...ithCustomerInfoAndCreatedFalseIf201.1.json | 13 +++++++ ...etionWithErrorIfCustomerInfoIsEmpty.1.json | 13 +++++++ ...oesntCacheForDifferentCurrentUserID.1.json | 13 +++++++ ...oesntCacheForDifferentCurrentUserID.2.json | 13 +++++++ ...ginDoesntCacheForDifferentNewUserID.1.json | 13 +++++++ ...ginDoesntCacheForDifferentNewUserID.2.json | 13 +++++++ .../iOS17-testLoginMakesRightCalls.1.json | 13 +++++++ ...sesNetworkErrorIfCouldntCommunicate.1.json | 13 +++++++ ...17-testGetProductEntitlementMapping.1.json | 10 ++++++ ...titlementMappingCachesForSameUserID.1.json | 10 ++++++ ...7-testPostAdServicesCallsHttpClient.1.json | 12 +++++++ ...testPostAttributesPutsDataInDataKey.1.json | 16 +++++++++ .../iOS17-testOfferForSigningCorrectly.1.json | 20 +++++++++++ ...tOfferForSigningEmptyOffersResponse.1.json | 20 +++++++++++ ...S17-testOfferForSigningNetworkError.1.json | 20 +++++++++++ ...ngNoDataAndNoSignatureErrorResponse.1.json | 20 +++++++++++ ...ferForSigningSignatureErrorResponse.1.json | 20 +++++++++++ ...17-testCachesRequestsForSameReceipt.1.json | 22 ++++++++++++ .../iOS17-testDoesNotPostConsentStatus.1.json | 16 +++++++++ ...testDoesntCacheForDifferentCurrency.1.json | 22 ++++++++++++ ...testDoesntCacheForDifferentCurrency.2.json | 26 ++++++++++++++ ...estDoesntCacheForDifferentDiscounts.1.json | 22 ++++++++++++ ...estDoesntCacheForDifferentDiscounts.2.json | 33 ++++++++++++++++++ ...testDoesntCacheForDifferentOffering.1.json | 23 +++++++++++++ ...testDoesntCacheForDifferentOffering.2.json | 23 +++++++++++++ ...estDoesntCacheForDifferentOfferings.1.json | 22 ++++++++++++ ...estDoesntCacheForDifferentOfferings.2.json | 23 +++++++++++++ ...testDoesntCacheForDifferentReceipts.1.json | 22 ++++++++++++ ...testDoesntCacheForDifferentReceipts.2.json | 22 ++++++++++++ ...-testDoesntCacheForDifferentRestore.1.json | 22 ++++++++++++ ...-testDoesntCacheForDifferentRestore.2.json | 22 ++++++++++++ ...rrorIsForwardedForCustomerInfoCalls.1.json | 22 ++++++++++++ .../iOS17-testFreeTrialPostsCorrectly.1.json | 27 +++++++++++++++ ...sEntitlementsWithFailedVerification.1.json | 22 ++++++++++++ ...etsEntitlementsWithVerifiedResponse.1.json | 22 ++++++++++++ ...tGetsUpdatedSubscriberInfoAfterPost.1.json | 10 ++++++ ...tGetsUpdatedSubscriberInfoAfterPost.2.json | 22 ++++++++++++ .../iOS17-testIndividualParamsCanBeNil.1.json | 26 ++++++++++++++ .../iOS17-testPayAsYouGoPostsCorrectly.1.json | 27 +++++++++++++++ .../iOS17-testPayUpFrontPostsCorrectly.1.json | 27 +++++++++++++++ ...ngReceiptCreatesACustomerInfoObject.1.json | 22 ++++++++++++ ...onAndServerErrorComputesOfflineUser.1.json | 26 ++++++++++++++ ...taAndServerErrorComputesOfflineUser.1.json | 22 ++++++++++++ ...iOS17-testPostsReceiptDataCorrectly.1.json | 22 ++++++++++++ ...eceiptDataWithDiscountInfoCorrectly.1.json | 34 +++++++++++++++++++ ...ReceiptDataWithProductDataCorrectly.1.json | 26 ++++++++++++++ ...DataWithProductRequestDataCorrectly.1.json | 28 +++++++++++++++ ...-testRequestContainsSignatureHeader.1.json | 10 ++++++ ...stFailsIfSignatureVerificationFails.1.json | 10 ++++++ ...-testPostReceiptWithAdServicesToken.1.json | 23 +++++++++++++ ...esCustomerInfoIfStatusCodeIsSuccess.1.json | 30 ++++++++++++++++ ...PassesErrorIfStatusCodeIsNotSuccess.1.json | 30 ++++++++++++++++ ...hSubscriberAttributesReturnsBadJson.1.json | 30 ++++++++++++++++ ...scriberAttributesSendsThemCorrectly.1.json | 30 ++++++++++++++++ ...ithoutSubscriberAttributesSkipsThem.1.json | 22 ++++++++++++ ...esCallsCompletionInNetworkErrorCase.1.json | 21 ++++++++++++ ...ributesCallsCompletionInSuccessCase.1.json | 21 ++++++++++++ ...CompletionWithErrorInBadRequestCase.1.json | 21 ++++++++++++ ...ttributesSendsAttributesErrorsIfAny.1.json | 21 ++++++++++++ ...riberAttributesSendsRightParameters.1.json | 21 ++++++++++++ .../TestHelpers/CurrentTestCaseTracker.swift | 10 ++++++ .../TestHelpers/OSVersionEquivalent.swift | 1 + 101 files changed, 1697 insertions(+), 5 deletions(-) rename Tests/UnitTests/Misc/__Snapshots__/AnyEncodableTests/{testNestedDictionary.1.json => iOS12-testNestedDictionary.1.json} (100%) create mode 100644 Tests/UnitTests/Misc/__Snapshots__/AnyEncodableTests/iOS13-testNestedDictionary.1.json create mode 100644 Tests/UnitTests/Misc/__Snapshots__/AnyEncodableTests/iOS14-testNestedDictionary.1.json create mode 100644 Tests/UnitTests/Misc/__Snapshots__/AnyEncodableTests/iOS15-testNestedDictionary.1.json create mode 100644 Tests/UnitTests/Misc/__Snapshots__/AnyEncodableTests/iOS16-testNestedDictionary.1.json create mode 100644 Tests/UnitTests/Misc/__Snapshots__/AnyEncodableTests/iOS17-testNestedDictionary.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testCachesCustomerGetsForSameCustomer.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testDoesntCacheCustomerGetsForSameCustomer.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testDoesntCacheCustomerGetsForSameCustomer.2.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testEncodesCustomerUserID.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testGetCustomerCallsBackendProperly.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testGetCustomerInfoDoesNotMakeTwoRequests.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testGetCustomerInfoWithFailedVerification.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testGetCustomerInfoWithVerifiedResponse.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testGetsCustomerInfo.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testHandlesGetCustomerInfoErrors.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testHandlesInvalidJSON.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testSendsNonceWhenEnabled.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testUpdatesRequestDateFromResponseHeader.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetIntroEligibilityTests/iOS17-testEligibilityUnknownIfError.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetIntroEligibilityTests/iOS17-testEligibilityUnknownIfUnknownError.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetIntroEligibilityTests/iOS17-testPostsProductIdentifiers.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testGetEntitlementsDoesntCacheForMultipleUserID.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testGetEntitlementsDoesntCacheForMultipleUserID.2.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testGetOfferingsCachesForSameUserID.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testGetOfferingsCallsHTTPMethod.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testGetOfferingsCallsHTTPMethodWithRandomDelay.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testGetOfferingsFailSendsNil.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testGetOfferingsNetworkErrorSendsError.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testGetOfferingsOneOffering.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testRepeatedRequestsLogDebugMessage.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendInternalTests/iOS17-testHealthRequestIsNotAuthenticated.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendInternalTests/iOS17-testHealthRequestWithFailure.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendInternalTests/iOS17-testHealthRequestWithSuccess.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginCachesForSameUserIDs.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginCallsAllCompletionBlocksInCache.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginCallsCompletionWithCustomerInfoAndCreatedFalseIf200.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginCallsCompletionWithCustomerInfoAndCreatedFalseIf201.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginCallsCompletionWithErrorIfCustomerInfoIsEmpty.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginDoesntCacheForDifferentCurrentUserID.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginDoesntCacheForDifferentCurrentUserID.2.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginDoesntCacheForDifferentNewUserID.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginDoesntCacheForDifferentNewUserID.2.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginMakesRightCalls.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginPassesNetworkErrorIfCouldntCommunicate.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendOfflineEntitlementsTests/iOS17-testGetProductEntitlementMapping.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendOfflineEntitlementsTests/iOS17-testGetProductEntitlementMappingCachesForSameUserID.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostAdServicesTokenTests/iOS17-testPostAdServicesCallsHttpClient.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostAttributionDataTests/iOS17-testPostAttributesPutsDataInDataKey.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostOfferForSigningTests/iOS17-testOfferForSigningCorrectly.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostOfferForSigningTests/iOS17-testOfferForSigningEmptyOffersResponse.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostOfferForSigningTests/iOS17-testOfferForSigningNetworkError.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostOfferForSigningTests/iOS17-testOfferForSigningNoDataAndNoSignatureErrorResponse.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostOfferForSigningTests/iOS17-testOfferForSigningSignatureErrorResponse.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testCachesRequestsForSameReceipt.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesNotPostConsentStatus.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentCurrency.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentCurrency.2.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentDiscounts.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentDiscounts.2.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentOffering.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentOffering.2.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentOfferings.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentOfferings.2.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentReceipts.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentReceipts.2.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentRestore.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentRestore.2.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testErrorIsForwardedForCustomerInfoCalls.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testFreeTrialPostsCorrectly.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testGetsEntitlementsWithFailedVerification.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testGetsEntitlementsWithVerifiedResponse.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testGetsUpdatedSubscriberInfoAfterPost.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testGetsUpdatedSubscriberInfoAfterPost.2.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testIndividualParamsCanBeNil.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPayAsYouGoPostsCorrectly.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPayUpFrontPostsCorrectly.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPostingReceiptCreatesACustomerInfoObject.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPostingReceiptForSubscriptionAndServerErrorComputesOfflineUser.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPostingReceiptWithNoProductDataAndServerErrorComputesOfflineUser.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPostsReceiptDataCorrectly.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPostsReceiptDataWithDiscountInfoCorrectly.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPostsReceiptDataWithProductDataCorrectly.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPostsReceiptDataWithProductRequestDataCorrectly.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendSignatureVerificationTests/iOS17-testRequestContainsSignatureHeader.1.json create mode 100644 Tests/UnitTests/Networking/Backend/__Snapshots__/BackendSignatureVerificationTests/iOS17-testRequestFailsIfSignatureVerificationFails.1.json create mode 100644 Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostReceiptWithAdServicesToken.1.json create mode 100644 Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostReceiptWithSubscriberAttributesPassesCustomerInfoIfStatusCodeIsSuccess.1.json create mode 100644 Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostReceiptWithSubscriberAttributesPassesErrorIfStatusCodeIsNotSuccess.1.json create mode 100644 Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostReceiptWithSubscriberAttributesReturnsBadJson.1.json create mode 100644 Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostReceiptWithSubscriberAttributesSendsThemCorrectly.1.json create mode 100644 Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostReceiptWithoutSubscriberAttributesSkipsThem.1.json create mode 100644 Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostSubscriberAttributesCallsCompletionInNetworkErrorCase.1.json create mode 100644 Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostSubscriberAttributesCallsCompletionInSuccessCase.1.json create mode 100644 Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostSubscriberAttributesCallsCompletionWithErrorInBadRequestCase.1.json create mode 100644 Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostSubscriberAttributesSendsAttributesErrorsIfAny.1.json create mode 100644 Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostSubscriberAttributesSendsRightParameters.1.json diff --git a/Tests/UnitTests/Misc/AnyEncodableTests.swift b/Tests/UnitTests/Misc/AnyEncodableTests.swift index 2a798e4110..b2c5e3b42b 100644 --- a/Tests/UnitTests/Misc/AnyEncodableTests.swift +++ b/Tests/UnitTests/Misc/AnyEncodableTests.swift @@ -62,7 +62,12 @@ class AnyEncodableTests: TestCase { "d": nil ] - assertSnapshot(matching: AnyEncodable(dictionary), as: .json) + assertSnapshot( + matching: AnyEncodable(dictionary), + as: .json, + // Formatting `Double`s changed in iOS 17 + testName: CurrentTestCaseTracker.osVersionAndTestName + ) } func testEncodingInvalidDataFails() { diff --git a/Tests/UnitTests/Misc/__Snapshots__/AnyEncodableTests/testNestedDictionary.1.json b/Tests/UnitTests/Misc/__Snapshots__/AnyEncodableTests/iOS12-testNestedDictionary.1.json similarity index 100% rename from Tests/UnitTests/Misc/__Snapshots__/AnyEncodableTests/testNestedDictionary.1.json rename to Tests/UnitTests/Misc/__Snapshots__/AnyEncodableTests/iOS12-testNestedDictionary.1.json diff --git a/Tests/UnitTests/Misc/__Snapshots__/AnyEncodableTests/iOS13-testNestedDictionary.1.json b/Tests/UnitTests/Misc/__Snapshots__/AnyEncodableTests/iOS13-testNestedDictionary.1.json new file mode 100644 index 0000000000..de89828bd8 --- /dev/null +++ b/Tests/UnitTests/Misc/__Snapshots__/AnyEncodableTests/iOS13-testNestedDictionary.1.json @@ -0,0 +1,18 @@ +{ + "a" : 1, + "b" : { + "b1" : false, + "b2" : { + "b21" : 1, + "b22" : "https:\/\/google.com" + }, + "b3" : [ + 20.199999999999999, + 19.989999999999998, + 5 + ], + "b4" : 50000 + }, + "c" : "3", + "d" : null +} \ No newline at end of file diff --git a/Tests/UnitTests/Misc/__Snapshots__/AnyEncodableTests/iOS14-testNestedDictionary.1.json b/Tests/UnitTests/Misc/__Snapshots__/AnyEncodableTests/iOS14-testNestedDictionary.1.json new file mode 100644 index 0000000000..de89828bd8 --- /dev/null +++ b/Tests/UnitTests/Misc/__Snapshots__/AnyEncodableTests/iOS14-testNestedDictionary.1.json @@ -0,0 +1,18 @@ +{ + "a" : 1, + "b" : { + "b1" : false, + "b2" : { + "b21" : 1, + "b22" : "https:\/\/google.com" + }, + "b3" : [ + 20.199999999999999, + 19.989999999999998, + 5 + ], + "b4" : 50000 + }, + "c" : "3", + "d" : null +} \ No newline at end of file diff --git a/Tests/UnitTests/Misc/__Snapshots__/AnyEncodableTests/iOS15-testNestedDictionary.1.json b/Tests/UnitTests/Misc/__Snapshots__/AnyEncodableTests/iOS15-testNestedDictionary.1.json new file mode 100644 index 0000000000..de89828bd8 --- /dev/null +++ b/Tests/UnitTests/Misc/__Snapshots__/AnyEncodableTests/iOS15-testNestedDictionary.1.json @@ -0,0 +1,18 @@ +{ + "a" : 1, + "b" : { + "b1" : false, + "b2" : { + "b21" : 1, + "b22" : "https:\/\/google.com" + }, + "b3" : [ + 20.199999999999999, + 19.989999999999998, + 5 + ], + "b4" : 50000 + }, + "c" : "3", + "d" : null +} \ No newline at end of file diff --git a/Tests/UnitTests/Misc/__Snapshots__/AnyEncodableTests/iOS16-testNestedDictionary.1.json b/Tests/UnitTests/Misc/__Snapshots__/AnyEncodableTests/iOS16-testNestedDictionary.1.json new file mode 100644 index 0000000000..de89828bd8 --- /dev/null +++ b/Tests/UnitTests/Misc/__Snapshots__/AnyEncodableTests/iOS16-testNestedDictionary.1.json @@ -0,0 +1,18 @@ +{ + "a" : 1, + "b" : { + "b1" : false, + "b2" : { + "b21" : 1, + "b22" : "https:\/\/google.com" + }, + "b3" : [ + 20.199999999999999, + 19.989999999999998, + 5 + ], + "b4" : 50000 + }, + "c" : "3", + "d" : null +} \ No newline at end of file diff --git a/Tests/UnitTests/Misc/__Snapshots__/AnyEncodableTests/iOS17-testNestedDictionary.1.json b/Tests/UnitTests/Misc/__Snapshots__/AnyEncodableTests/iOS17-testNestedDictionary.1.json new file mode 100644 index 0000000000..f58e2a124e --- /dev/null +++ b/Tests/UnitTests/Misc/__Snapshots__/AnyEncodableTests/iOS17-testNestedDictionary.1.json @@ -0,0 +1,18 @@ +{ + "a" : 1, + "b" : { + "b1" : false, + "b2" : { + "b21" : 1, + "b22" : "https:\/\/google.com" + }, + "b3" : [ + 20.2, + 19.99, + 5 + ], + "b4" : 50000 + }, + "c" : "3", + "d" : null +} \ No newline at end of file diff --git a/Tests/UnitTests/Mocks/MockHTTPClient.swift b/Tests/UnitTests/Mocks/MockHTTPClient.swift index 3c94a7c398..83833ea5f0 100644 --- a/Tests/UnitTests/Mocks/MockHTTPClient.swift +++ b/Tests/UnitTests/Mocks/MockHTTPClient.swift @@ -84,13 +84,10 @@ class MockHTTPClient: HTTPClient { DispatchQueue.main.async { self.calls.append(call) - let osVersionEquivalent = OSVersionEquivalent.current - let testName = "iOS\(osVersionEquivalent.rawValue)/\(CurrentTestCaseTracker.sanitizedTestName)" - assertSnapshot(matching: call, as: .formattedJson, file: self.sourceTestFile, - testName: testName) + testName: CurrentTestCaseTracker.osVersionAndTestName) let mock = self.mocks[request.path] ?? .init(statusCode: .success) diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testCachesCustomerGetsForSameCustomer.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testCachesCustomerGetsForSameCustomer.1.json new file mode 100644 index 0000000000..9150079567 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testCachesCustomerGetsForSameCustomer.1.json @@ -0,0 +1,10 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : null, + "method" : "GET", + "url" : "https://api.revenuecat.com/v1/subscribers/user" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testDoesntCacheCustomerGetsForSameCustomer.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testDoesntCacheCustomerGetsForSameCustomer.1.json new file mode 100644 index 0000000000..9150079567 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testDoesntCacheCustomerGetsForSameCustomer.1.json @@ -0,0 +1,10 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : null, + "method" : "GET", + "url" : "https://api.revenuecat.com/v1/subscribers/user" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testDoesntCacheCustomerGetsForSameCustomer.2.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testDoesntCacheCustomerGetsForSameCustomer.2.json new file mode 100644 index 0000000000..7ea6dd164f --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testDoesntCacheCustomerGetsForSameCustomer.2.json @@ -0,0 +1,10 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : null, + "method" : "GET", + "url" : "https://api.revenuecat.com/v1/subscribers/user_id_2" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testEncodesCustomerUserID.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testEncodesCustomerUserID.1.json new file mode 100644 index 0000000000..d5c0e55a1b --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testEncodesCustomerUserID.1.json @@ -0,0 +1,10 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : null, + "method" : "GET", + "url" : "https://api.revenuecat.com/v1/subscribers/userid%20with%20spaces" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testGetCustomerCallsBackendProperly.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testGetCustomerCallsBackendProperly.1.json new file mode 100644 index 0000000000..9150079567 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testGetCustomerCallsBackendProperly.1.json @@ -0,0 +1,10 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : null, + "method" : "GET", + "url" : "https://api.revenuecat.com/v1/subscribers/user" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testGetCustomerInfoDoesNotMakeTwoRequests.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testGetCustomerInfoDoesNotMakeTwoRequests.1.json new file mode 100644 index 0000000000..9150079567 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testGetCustomerInfoDoesNotMakeTwoRequests.1.json @@ -0,0 +1,10 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : null, + "method" : "GET", + "url" : "https://api.revenuecat.com/v1/subscribers/user" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testGetCustomerInfoWithFailedVerification.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testGetCustomerInfoWithFailedVerification.1.json new file mode 100644 index 0000000000..9150079567 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testGetCustomerInfoWithFailedVerification.1.json @@ -0,0 +1,10 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : null, + "method" : "GET", + "url" : "https://api.revenuecat.com/v1/subscribers/user" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testGetCustomerInfoWithVerifiedResponse.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testGetCustomerInfoWithVerifiedResponse.1.json new file mode 100644 index 0000000000..9150079567 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testGetCustomerInfoWithVerifiedResponse.1.json @@ -0,0 +1,10 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : null, + "method" : "GET", + "url" : "https://api.revenuecat.com/v1/subscribers/user" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testGetsCustomerInfo.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testGetsCustomerInfo.1.json new file mode 100644 index 0000000000..9150079567 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testGetsCustomerInfo.1.json @@ -0,0 +1,10 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : null, + "method" : "GET", + "url" : "https://api.revenuecat.com/v1/subscribers/user" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testHandlesGetCustomerInfoErrors.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testHandlesGetCustomerInfoErrors.1.json new file mode 100644 index 0000000000..9150079567 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testHandlesGetCustomerInfoErrors.1.json @@ -0,0 +1,10 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : null, + "method" : "GET", + "url" : "https://api.revenuecat.com/v1/subscribers/user" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testHandlesInvalidJSON.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testHandlesInvalidJSON.1.json new file mode 100644 index 0000000000..9150079567 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testHandlesInvalidJSON.1.json @@ -0,0 +1,10 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : null, + "method" : "GET", + "url" : "https://api.revenuecat.com/v1/subscribers/user" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testSendsNonceWhenEnabled.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testSendsNonceWhenEnabled.1.json new file mode 100644 index 0000000000..9168b101f3 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testSendsNonceWhenEnabled.1.json @@ -0,0 +1,11 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret", + "X-Nonce" : "MTIzNDU2Nzg5MGFi" + }, + "request" : { + "body" : null, + "method" : "GET", + "url" : "https://api.revenuecat.com/v1/subscribers/user" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testUpdatesRequestDateFromResponseHeader.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testUpdatesRequestDateFromResponseHeader.1.json new file mode 100644 index 0000000000..9150079567 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetCustomerInfoTests/iOS17-testUpdatesRequestDateFromResponseHeader.1.json @@ -0,0 +1,10 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : null, + "method" : "GET", + "url" : "https://api.revenuecat.com/v1/subscribers/user" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetIntroEligibilityTests/iOS17-testEligibilityUnknownIfError.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetIntroEligibilityTests/iOS17-testEligibilityUnknownIfError.1.json new file mode 100644 index 0000000000..49bc3d6096 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetIntroEligibilityTests/iOS17-testEligibilityUnknownIfError.1.json @@ -0,0 +1,17 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "fetch_token" : "AQI=", + "product_identifiers" : [ + "producta", + "productb", + "productc" + ] + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/subscribers/user/intro_eligibility" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetIntroEligibilityTests/iOS17-testEligibilityUnknownIfUnknownError.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetIntroEligibilityTests/iOS17-testEligibilityUnknownIfUnknownError.1.json new file mode 100644 index 0000000000..49bc3d6096 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetIntroEligibilityTests/iOS17-testEligibilityUnknownIfUnknownError.1.json @@ -0,0 +1,17 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "fetch_token" : "AQI=", + "product_identifiers" : [ + "producta", + "productb", + "productc" + ] + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/subscribers/user/intro_eligibility" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetIntroEligibilityTests/iOS17-testPostsProductIdentifiers.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetIntroEligibilityTests/iOS17-testPostsProductIdentifiers.1.json new file mode 100644 index 0000000000..c780f7921c --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetIntroEligibilityTests/iOS17-testPostsProductIdentifiers.1.json @@ -0,0 +1,18 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "fetch_token" : "AQID", + "product_identifiers" : [ + "producta", + "productb", + "productc", + "productd" + ] + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/subscribers/user/intro_eligibility" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testGetEntitlementsDoesntCacheForMultipleUserID.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testGetEntitlementsDoesntCacheForMultipleUserID.1.json new file mode 100644 index 0000000000..a843f14b56 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testGetEntitlementsDoesntCacheForMultipleUserID.1.json @@ -0,0 +1,10 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : null, + "method" : "GET", + "url" : "https://api.revenuecat.com/v1/subscribers/user/offerings" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testGetEntitlementsDoesntCacheForMultipleUserID.2.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testGetEntitlementsDoesntCacheForMultipleUserID.2.json new file mode 100644 index 0000000000..6e4e7e539d --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testGetEntitlementsDoesntCacheForMultipleUserID.2.json @@ -0,0 +1,10 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : null, + "method" : "GET", + "url" : "https://api.revenuecat.com/v1/subscribers/user_id_2/offerings" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testGetOfferingsCachesForSameUserID.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testGetOfferingsCachesForSameUserID.1.json new file mode 100644 index 0000000000..a843f14b56 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testGetOfferingsCachesForSameUserID.1.json @@ -0,0 +1,10 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : null, + "method" : "GET", + "url" : "https://api.revenuecat.com/v1/subscribers/user/offerings" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testGetOfferingsCallsHTTPMethod.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testGetOfferingsCallsHTTPMethod.1.json new file mode 100644 index 0000000000..a843f14b56 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testGetOfferingsCallsHTTPMethod.1.json @@ -0,0 +1,10 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : null, + "method" : "GET", + "url" : "https://api.revenuecat.com/v1/subscribers/user/offerings" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testGetOfferingsCallsHTTPMethodWithRandomDelay.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testGetOfferingsCallsHTTPMethodWithRandomDelay.1.json new file mode 100644 index 0000000000..a843f14b56 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testGetOfferingsCallsHTTPMethodWithRandomDelay.1.json @@ -0,0 +1,10 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : null, + "method" : "GET", + "url" : "https://api.revenuecat.com/v1/subscribers/user/offerings" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testGetOfferingsFailSendsNil.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testGetOfferingsFailSendsNil.1.json new file mode 100644 index 0000000000..a843f14b56 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testGetOfferingsFailSendsNil.1.json @@ -0,0 +1,10 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : null, + "method" : "GET", + "url" : "https://api.revenuecat.com/v1/subscribers/user/offerings" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testGetOfferingsNetworkErrorSendsError.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testGetOfferingsNetworkErrorSendsError.1.json new file mode 100644 index 0000000000..a843f14b56 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testGetOfferingsNetworkErrorSendsError.1.json @@ -0,0 +1,10 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : null, + "method" : "GET", + "url" : "https://api.revenuecat.com/v1/subscribers/user/offerings" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testGetOfferingsOneOffering.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testGetOfferingsOneOffering.1.json new file mode 100644 index 0000000000..a843f14b56 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testGetOfferingsOneOffering.1.json @@ -0,0 +1,10 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : null, + "method" : "GET", + "url" : "https://api.revenuecat.com/v1/subscribers/user/offerings" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testRepeatedRequestsLogDebugMessage.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testRepeatedRequestsLogDebugMessage.1.json new file mode 100644 index 0000000000..a843f14b56 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendGetOfferingsTests/iOS17-testRepeatedRequestsLogDebugMessage.1.json @@ -0,0 +1,10 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : null, + "method" : "GET", + "url" : "https://api.revenuecat.com/v1/subscribers/user/offerings" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendInternalTests/iOS17-testHealthRequestIsNotAuthenticated.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendInternalTests/iOS17-testHealthRequestIsNotAuthenticated.1.json new file mode 100644 index 0000000000..ca86abb565 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendInternalTests/iOS17-testHealthRequestIsNotAuthenticated.1.json @@ -0,0 +1,10 @@ +{ + "headers" : { + + }, + "request" : { + "body" : null, + "method" : "GET", + "url" : "https://api.revenuecat.com/v1/health" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendInternalTests/iOS17-testHealthRequestWithFailure.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendInternalTests/iOS17-testHealthRequestWithFailure.1.json new file mode 100644 index 0000000000..ca86abb565 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendInternalTests/iOS17-testHealthRequestWithFailure.1.json @@ -0,0 +1,10 @@ +{ + "headers" : { + + }, + "request" : { + "body" : null, + "method" : "GET", + "url" : "https://api.revenuecat.com/v1/health" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendInternalTests/iOS17-testHealthRequestWithSuccess.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendInternalTests/iOS17-testHealthRequestWithSuccess.1.json new file mode 100644 index 0000000000..ca86abb565 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendInternalTests/iOS17-testHealthRequestWithSuccess.1.json @@ -0,0 +1,10 @@ +{ + "headers" : { + + }, + "request" : { + "body" : null, + "method" : "GET", + "url" : "https://api.revenuecat.com/v1/health" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginCachesForSameUserIDs.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginCachesForSameUserIDs.1.json new file mode 100644 index 0000000000..cc686809c1 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginCachesForSameUserIDs.1.json @@ -0,0 +1,13 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "old id", + "new_app_user_id" : "new id" + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/subscribers/identify" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginCallsAllCompletionBlocksInCache.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginCallsAllCompletionBlocksInCache.1.json new file mode 100644 index 0000000000..cc686809c1 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginCallsAllCompletionBlocksInCache.1.json @@ -0,0 +1,13 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "old id", + "new_app_user_id" : "new id" + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/subscribers/identify" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginCallsCompletionWithCustomerInfoAndCreatedFalseIf200.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginCallsCompletionWithCustomerInfoAndCreatedFalseIf200.1.json new file mode 100644 index 0000000000..cc686809c1 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginCallsCompletionWithCustomerInfoAndCreatedFalseIf200.1.json @@ -0,0 +1,13 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "old id", + "new_app_user_id" : "new id" + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/subscribers/identify" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginCallsCompletionWithCustomerInfoAndCreatedFalseIf201.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginCallsCompletionWithCustomerInfoAndCreatedFalseIf201.1.json new file mode 100644 index 0000000000..cc686809c1 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginCallsCompletionWithCustomerInfoAndCreatedFalseIf201.1.json @@ -0,0 +1,13 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "old id", + "new_app_user_id" : "new id" + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/subscribers/identify" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginCallsCompletionWithErrorIfCustomerInfoIsEmpty.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginCallsCompletionWithErrorIfCustomerInfoIsEmpty.1.json new file mode 100644 index 0000000000..cc686809c1 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginCallsCompletionWithErrorIfCustomerInfoIsEmpty.1.json @@ -0,0 +1,13 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "old id", + "new_app_user_id" : "new id" + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/subscribers/identify" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginDoesntCacheForDifferentCurrentUserID.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginDoesntCacheForDifferentCurrentUserID.1.json new file mode 100644 index 0000000000..cc686809c1 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginDoesntCacheForDifferentCurrentUserID.1.json @@ -0,0 +1,13 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "old id", + "new_app_user_id" : "new id" + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/subscribers/identify" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginDoesntCacheForDifferentCurrentUserID.2.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginDoesntCacheForDifferentCurrentUserID.2.json new file mode 100644 index 0000000000..f497f98c5b --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginDoesntCacheForDifferentCurrentUserID.2.json @@ -0,0 +1,13 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "old id 2", + "new_app_user_id" : "new id" + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/subscribers/identify" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginDoesntCacheForDifferentNewUserID.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginDoesntCacheForDifferentNewUserID.1.json new file mode 100644 index 0000000000..cc686809c1 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginDoesntCacheForDifferentNewUserID.1.json @@ -0,0 +1,13 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "old id", + "new_app_user_id" : "new id" + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/subscribers/identify" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginDoesntCacheForDifferentNewUserID.2.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginDoesntCacheForDifferentNewUserID.2.json new file mode 100644 index 0000000000..a98fe8b086 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginDoesntCacheForDifferentNewUserID.2.json @@ -0,0 +1,13 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "old id", + "new_app_user_id" : "new id 2" + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/subscribers/identify" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginMakesRightCalls.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginMakesRightCalls.1.json new file mode 100644 index 0000000000..cc686809c1 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginMakesRightCalls.1.json @@ -0,0 +1,13 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "old id", + "new_app_user_id" : "new id" + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/subscribers/identify" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginPassesNetworkErrorIfCouldntCommunicate.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginPassesNetworkErrorIfCouldntCommunicate.1.json new file mode 100644 index 0000000000..cc686809c1 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendLoginTests/iOS17-testLoginPassesNetworkErrorIfCouldntCommunicate.1.json @@ -0,0 +1,13 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "old id", + "new_app_user_id" : "new id" + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/subscribers/identify" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendOfflineEntitlementsTests/iOS17-testGetProductEntitlementMapping.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendOfflineEntitlementsTests/iOS17-testGetProductEntitlementMapping.1.json new file mode 100644 index 0000000000..84006123ce --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendOfflineEntitlementsTests/iOS17-testGetProductEntitlementMapping.1.json @@ -0,0 +1,10 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : null, + "method" : "GET", + "url" : "https://api.revenuecat.com/v1/product_entitlement_mapping" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendOfflineEntitlementsTests/iOS17-testGetProductEntitlementMappingCachesForSameUserID.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendOfflineEntitlementsTests/iOS17-testGetProductEntitlementMappingCachesForSameUserID.1.json new file mode 100644 index 0000000000..84006123ce --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendOfflineEntitlementsTests/iOS17-testGetProductEntitlementMappingCachesForSameUserID.1.json @@ -0,0 +1,10 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : null, + "method" : "GET", + "url" : "https://api.revenuecat.com/v1/product_entitlement_mapping" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostAdServicesTokenTests/iOS17-testPostAdServicesCallsHttpClient.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostAdServicesTokenTests/iOS17-testPostAdServicesCallsHttpClient.1.json new file mode 100644 index 0000000000..d3a2b02590 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostAdServicesTokenTests/iOS17-testPostAdServicesCallsHttpClient.1.json @@ -0,0 +1,12 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "aad_attribution_token" : "asdf" + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/subscribers/asdf/adservices_attribution" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostAttributionDataTests/iOS17-testPostAttributesPutsDataInDataKey.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostAttributionDataTests/iOS17-testPostAttributesPutsDataInDataKey.1.json new file mode 100644 index 0000000000..6843f2fb41 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostAttributionDataTests/iOS17-testPostAttributesPutsDataInDataKey.1.json @@ -0,0 +1,16 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "data" : { + "a" : "b", + "c" : "d" + }, + "network" : 1 + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/subscribers/user/attribution" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostOfferForSigningTests/iOS17-testOfferForSigningCorrectly.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostOfferForSigningTests/iOS17-testOfferForSigningCorrectly.1.json new file mode 100644 index 0000000000..bc14724581 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostOfferForSigningTests/iOS17-testOfferForSigningCorrectly.1.json @@ -0,0 +1,20 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "fetch_token" : "YW4gYXdlc29tZSBkaXNjb3VudA==", + "generate_offers" : [ + { + "offer_id" : "offerid", + "product_id" : "a_great_product", + "subscription_group" : "sub_group" + } + ] + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/offers" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostOfferForSigningTests/iOS17-testOfferForSigningEmptyOffersResponse.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostOfferForSigningTests/iOS17-testOfferForSigningEmptyOffersResponse.1.json new file mode 100644 index 0000000000..bc14724581 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostOfferForSigningTests/iOS17-testOfferForSigningEmptyOffersResponse.1.json @@ -0,0 +1,20 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "fetch_token" : "YW4gYXdlc29tZSBkaXNjb3VudA==", + "generate_offers" : [ + { + "offer_id" : "offerid", + "product_id" : "a_great_product", + "subscription_group" : "sub_group" + } + ] + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/offers" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostOfferForSigningTests/iOS17-testOfferForSigningNetworkError.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostOfferForSigningTests/iOS17-testOfferForSigningNetworkError.1.json new file mode 100644 index 0000000000..bc14724581 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostOfferForSigningTests/iOS17-testOfferForSigningNetworkError.1.json @@ -0,0 +1,20 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "fetch_token" : "YW4gYXdlc29tZSBkaXNjb3VudA==", + "generate_offers" : [ + { + "offer_id" : "offerid", + "product_id" : "a_great_product", + "subscription_group" : "sub_group" + } + ] + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/offers" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostOfferForSigningTests/iOS17-testOfferForSigningNoDataAndNoSignatureErrorResponse.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostOfferForSigningTests/iOS17-testOfferForSigningNoDataAndNoSignatureErrorResponse.1.json new file mode 100644 index 0000000000..bc14724581 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostOfferForSigningTests/iOS17-testOfferForSigningNoDataAndNoSignatureErrorResponse.1.json @@ -0,0 +1,20 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "fetch_token" : "YW4gYXdlc29tZSBkaXNjb3VudA==", + "generate_offers" : [ + { + "offer_id" : "offerid", + "product_id" : "a_great_product", + "subscription_group" : "sub_group" + } + ] + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/offers" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostOfferForSigningTests/iOS17-testOfferForSigningSignatureErrorResponse.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostOfferForSigningTests/iOS17-testOfferForSigningSignatureErrorResponse.1.json new file mode 100644 index 0000000000..bc14724581 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostOfferForSigningTests/iOS17-testOfferForSigningSignatureErrorResponse.1.json @@ -0,0 +1,20 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "fetch_token" : "YW4gYXdlc29tZSBkaXNjb3VudA==", + "generate_offers" : [ + { + "offer_id" : "offerid", + "product_id" : "a_great_product", + "subscription_group" : "sub_group" + } + ] + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/offers" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testCachesRequestsForSameReceipt.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testCachesRequestsForSameReceipt.1.json new file mode 100644 index 0000000000..cdb9f0197f --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testCachesRequestsForSameReceipt.1.json @@ -0,0 +1,22 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + } + }, + "fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0", + "initiation_source" : "purchase", + "is_restore" : true, + "observer_mode" : false + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesNotPostConsentStatus.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesNotPostConsentStatus.1.json new file mode 100644 index 0000000000..289ba0a3b6 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesNotPostConsentStatus.1.json @@ -0,0 +1,16 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0", + "initiation_source" : "queue", + "is_restore" : false, + "observer_mode" : false + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentCurrency.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentCurrency.1.json new file mode 100644 index 0000000000..74b3d51e71 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentCurrency.1.json @@ -0,0 +1,22 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + } + }, + "fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0", + "initiation_source" : "purchase", + "is_restore" : false, + "observer_mode" : true + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentCurrency.2.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentCurrency.2.json new file mode 100644 index 0000000000..2e1505873a --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentCurrency.2.json @@ -0,0 +1,26 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + } + }, + "currency" : "USD", + "fetch_token" : "YW4gYXdlc29tZWVyIHJlY2VpcHQ=", + "initiation_source" : "purchase", + "is_restore" : false, + "observer_mode" : true, + "price" : "15.99", + "product_id" : "product_id", + "store_country" : "ESP" + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentDiscounts.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentDiscounts.1.json new file mode 100644 index 0000000000..2b0ba68c58 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentDiscounts.1.json @@ -0,0 +1,22 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + } + }, + "fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0", + "initiation_source" : "queue", + "is_restore" : true, + "observer_mode" : false + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentDiscounts.2.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentDiscounts.2.json new file mode 100644 index 0000000000..c3cfc571f2 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentDiscounts.2.json @@ -0,0 +1,33 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + } + }, + "currency" : "UYU", + "fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0", + "initiation_source" : "queue", + "is_restore" : true, + "observer_mode" : false, + "offers" : [ + { + "offer_identifier" : "offerid", + "payment_mode" : 0, + "price" : "12" + } + ], + "price" : "15.99", + "product_id" : "product_id", + "store_country" : "ESP" + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentOffering.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentOffering.1.json new file mode 100644 index 0000000000..664eff34c7 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentOffering.1.json @@ -0,0 +1,23 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + } + }, + "fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0", + "initiation_source" : "queue", + "is_restore" : true, + "observer_mode" : false, + "presented_offering_identifier" : "offering_a" + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentOffering.2.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentOffering.2.json new file mode 100644 index 0000000000..0345210685 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentOffering.2.json @@ -0,0 +1,23 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + } + }, + "fetch_token" : "YW4gYXdlc29tZWVyIHJlY2VpcHQ=", + "initiation_source" : "queue", + "is_restore" : true, + "observer_mode" : false, + "presented_offering_identifier" : "offering_b" + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentOfferings.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentOfferings.1.json new file mode 100644 index 0000000000..78663b29b8 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentOfferings.1.json @@ -0,0 +1,22 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + } + }, + "fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0", + "initiation_source" : "queue", + "is_restore" : false, + "observer_mode" : true + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentOfferings.2.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentOfferings.2.json new file mode 100644 index 0000000000..0c6e770e6c --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentOfferings.2.json @@ -0,0 +1,23 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + } + }, + "fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0", + "initiation_source" : "queue", + "is_restore" : false, + "observer_mode" : true, + "presented_offering_identifier" : "offering_a" + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentReceipts.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentReceipts.1.json new file mode 100644 index 0000000000..dd5b0f3d3d --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentReceipts.1.json @@ -0,0 +1,22 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + } + }, + "fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0", + "initiation_source" : "queue", + "is_restore" : true, + "observer_mode" : true + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentReceipts.2.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentReceipts.2.json new file mode 100644 index 0000000000..9f240a3296 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentReceipts.2.json @@ -0,0 +1,22 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + } + }, + "fetch_token" : "YW4gYXdlc29tZWVyIHJlY2VpcHQ=", + "initiation_source" : "queue", + "is_restore" : true, + "observer_mode" : true + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentRestore.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentRestore.1.json new file mode 100644 index 0000000000..eb646018e3 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentRestore.1.json @@ -0,0 +1,22 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + } + }, + "fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0", + "initiation_source" : "purchase", + "is_restore" : false, + "observer_mode" : false + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentRestore.2.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentRestore.2.json new file mode 100644 index 0000000000..2b0ba68c58 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testDoesntCacheForDifferentRestore.2.json @@ -0,0 +1,22 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + } + }, + "fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0", + "initiation_source" : "queue", + "is_restore" : true, + "observer_mode" : false + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testErrorIsForwardedForCustomerInfoCalls.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testErrorIsForwardedForCustomerInfoCalls.1.json new file mode 100644 index 0000000000..2b0ba68c58 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testErrorIsForwardedForCustomerInfoCalls.1.json @@ -0,0 +1,22 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + } + }, + "fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0", + "initiation_source" : "queue", + "is_restore" : true, + "observer_mode" : false + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testFreeTrialPostsCorrectly.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testFreeTrialPostsCorrectly.1.json new file mode 100644 index 0000000000..946969a840 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testFreeTrialPostsCorrectly.1.json @@ -0,0 +1,27 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + } + }, + "currency" : "UYU", + "fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0", + "initiation_source" : "queue", + "is_restore" : false, + "observer_mode" : false, + "payment_mode" : 2, + "price" : "15.99", + "product_id" : "product_id", + "store_country" : "ESP" + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testGetsEntitlementsWithFailedVerification.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testGetsEntitlementsWithFailedVerification.1.json new file mode 100644 index 0000000000..eb646018e3 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testGetsEntitlementsWithFailedVerification.1.json @@ -0,0 +1,22 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + } + }, + "fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0", + "initiation_source" : "purchase", + "is_restore" : false, + "observer_mode" : false + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testGetsEntitlementsWithVerifiedResponse.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testGetsEntitlementsWithVerifiedResponse.1.json new file mode 100644 index 0000000000..eb646018e3 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testGetsEntitlementsWithVerifiedResponse.1.json @@ -0,0 +1,22 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + } + }, + "fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0", + "initiation_source" : "purchase", + "is_restore" : false, + "observer_mode" : false + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testGetsUpdatedSubscriberInfoAfterPost.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testGetsUpdatedSubscriberInfoAfterPost.1.json new file mode 100644 index 0000000000..9150079567 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testGetsUpdatedSubscriberInfoAfterPost.1.json @@ -0,0 +1,10 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : null, + "method" : "GET", + "url" : "https://api.revenuecat.com/v1/subscribers/user" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testGetsUpdatedSubscriberInfoAfterPost.2.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testGetsUpdatedSubscriberInfoAfterPost.2.json new file mode 100644 index 0000000000..78663b29b8 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testGetsUpdatedSubscriberInfoAfterPost.2.json @@ -0,0 +1,22 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + } + }, + "fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0", + "initiation_source" : "queue", + "is_restore" : false, + "observer_mode" : true + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testIndividualParamsCanBeNil.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testIndividualParamsCanBeNil.1.json new file mode 100644 index 0000000000..78e7b187ba --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testIndividualParamsCanBeNil.1.json @@ -0,0 +1,26 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + } + }, + "currency" : "UYU", + "fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0", + "initiation_source" : "queue", + "is_restore" : false, + "observer_mode" : false, + "price" : "15.99", + "product_id" : "product_id", + "store_country" : "ESP" + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPayAsYouGoPostsCorrectly.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPayAsYouGoPostsCorrectly.1.json new file mode 100644 index 0000000000..130a9765e5 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPayAsYouGoPostsCorrectly.1.json @@ -0,0 +1,27 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + } + }, + "currency" : "UYU", + "fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0", + "initiation_source" : "queue", + "is_restore" : false, + "observer_mode" : false, + "payment_mode" : 0, + "price" : "15.99", + "product_id" : "product_id", + "store_country" : "ESP" + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPayUpFrontPostsCorrectly.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPayUpFrontPostsCorrectly.1.json new file mode 100644 index 0000000000..ce31f50363 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPayUpFrontPostsCorrectly.1.json @@ -0,0 +1,27 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + } + }, + "currency" : "UYU", + "fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0", + "initiation_source" : "queue", + "is_restore" : false, + "observer_mode" : false, + "payment_mode" : 1, + "price" : "15.99", + "product_id" : "product_id", + "store_country" : "ESP" + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPostingReceiptCreatesACustomerInfoObject.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPostingReceiptCreatesACustomerInfoObject.1.json new file mode 100644 index 0000000000..eb646018e3 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPostingReceiptCreatesACustomerInfoObject.1.json @@ -0,0 +1,22 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + } + }, + "fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0", + "initiation_source" : "purchase", + "is_restore" : false, + "observer_mode" : false + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPostingReceiptForSubscriptionAndServerErrorComputesOfflineUser.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPostingReceiptForSubscriptionAndServerErrorComputesOfflineUser.1.json new file mode 100644 index 0000000000..2ba1af37ff --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPostingReceiptForSubscriptionAndServerErrorComputesOfflineUser.1.json @@ -0,0 +1,26 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + } + }, + "currency" : "UYU", + "fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0", + "initiation_source" : "purchase", + "is_restore" : false, + "observer_mode" : false, + "price" : "15.99", + "product_id" : "product_id", + "store_country" : "ESP" + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPostingReceiptWithNoProductDataAndServerErrorComputesOfflineUser.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPostingReceiptWithNoProductDataAndServerErrorComputesOfflineUser.1.json new file mode 100644 index 0000000000..eb646018e3 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPostingReceiptWithNoProductDataAndServerErrorComputesOfflineUser.1.json @@ -0,0 +1,22 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + } + }, + "fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0", + "initiation_source" : "purchase", + "is_restore" : false, + "observer_mode" : false + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPostsReceiptDataCorrectly.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPostsReceiptDataCorrectly.1.json new file mode 100644 index 0000000000..78663b29b8 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPostsReceiptDataCorrectly.1.json @@ -0,0 +1,22 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + } + }, + "fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0", + "initiation_source" : "queue", + "is_restore" : false, + "observer_mode" : true + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPostsReceiptDataWithDiscountInfoCorrectly.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPostsReceiptDataWithDiscountInfoCorrectly.1.json new file mode 100644 index 0000000000..2b38ca615a --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPostsReceiptDataWithDiscountInfoCorrectly.1.json @@ -0,0 +1,34 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + } + }, + "currency" : "BFD", + "fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0", + "initiation_source" : "queue", + "is_restore" : false, + "observer_mode" : false, + "offers" : [ + { + "offer_identifier" : "offerid", + "payment_mode" : 0, + "price" : "12.1" + } + ], + "price" : "15.99", + "product_id" : "a_great_product", + "store_country" : "ESP", + "subscription_group_id" : "sub_group" + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPostsReceiptDataWithProductDataCorrectly.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPostsReceiptDataWithProductDataCorrectly.1.json new file mode 100644 index 0000000000..925c511749 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPostsReceiptDataWithProductDataCorrectly.1.json @@ -0,0 +1,26 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + } + }, + "currency" : "USD", + "fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0", + "initiation_source" : "purchase", + "is_restore" : false, + "observer_mode" : true, + "price" : "15.99", + "product_id" : "product_id", + "store_country" : "ESP" + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPostsReceiptDataWithProductRequestDataCorrectly.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPostsReceiptDataWithProductRequestDataCorrectly.1.json new file mode 100644 index 0000000000..0488d8afc9 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendPostReceiptDataTests/iOS17-testPostsReceiptDataWithProductRequestDataCorrectly.1.json @@ -0,0 +1,28 @@ +{ + "headers" : { + "Authorization" : "Bearer asharedsecret" + }, + "request" : { + "body" : { + "app_user_id" : "user", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + } + }, + "currency" : "BFD", + "fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0", + "initiation_source" : "purchase", + "is_restore" : false, + "observer_mode" : false, + "presented_offering_identifier" : "a_offering", + "price" : "10.98", + "product_id" : "a_great_product", + "store_country" : "ESP", + "subscription_group_id" : "sub_group" + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendSignatureVerificationTests/iOS17-testRequestContainsSignatureHeader.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendSignatureVerificationTests/iOS17-testRequestContainsSignatureHeader.1.json new file mode 100644 index 0000000000..76e80c49f3 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendSignatureVerificationTests/iOS17-testRequestContainsSignatureHeader.1.json @@ -0,0 +1,10 @@ +{ + "headers" : { + "X-Nonce" : "MTIzNDU2Nzg5MGFi" + }, + "request" : { + "body" : null, + "method" : "GET", + "url" : "https://api.revenuecat.com/v1/health" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendSignatureVerificationTests/iOS17-testRequestFailsIfSignatureVerificationFails.1.json b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendSignatureVerificationTests/iOS17-testRequestFailsIfSignatureVerificationFails.1.json new file mode 100644 index 0000000000..76e80c49f3 --- /dev/null +++ b/Tests/UnitTests/Networking/Backend/__Snapshots__/BackendSignatureVerificationTests/iOS17-testRequestFailsIfSignatureVerificationFails.1.json @@ -0,0 +1,10 @@ +{ + "headers" : { + "X-Nonce" : "MTIzNDU2Nzg5MGFi" + }, + "request" : { + "body" : null, + "method" : "GET", + "url" : "https://api.revenuecat.com/v1/health" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostReceiptWithAdServicesToken.1.json b/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostReceiptWithAdServicesToken.1.json new file mode 100644 index 0000000000..2ef6718635 --- /dev/null +++ b/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostReceiptWithAdServicesToken.1.json @@ -0,0 +1,23 @@ +{ + "headers" : { + "Authorization" : "Bearer the api key" + }, + "request" : { + "body" : { + "aad_attribution_token" : "token", + "app_user_id" : "abc123", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + } + }, + "fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0", + "initiation_source" : "restore", + "is_restore" : false, + "observer_mode" : false + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostReceiptWithSubscriberAttributesPassesCustomerInfoIfStatusCodeIsSuccess.1.json b/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostReceiptWithSubscriberAttributesPassesCustomerInfoIfStatusCodeIsSuccess.1.json new file mode 100644 index 0000000000..ca3bae004a --- /dev/null +++ b/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostReceiptWithSubscriberAttributesPassesCustomerInfoIfStatusCodeIsSuccess.1.json @@ -0,0 +1,30 @@ +{ + "headers" : { + "Authorization" : "Bearer the api key" + }, + "request" : { + "body" : { + "app_user_id" : "abc123", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + }, + "a key" : { + "updated_at_ms" : 1678307200000, + "value" : "a value" + }, + "another key" : { + "updated_at_ms" : 1678307200000, + "value" : "another value" + } + }, + "fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0", + "initiation_source" : "queue", + "is_restore" : false, + "observer_mode" : false + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostReceiptWithSubscriberAttributesPassesErrorIfStatusCodeIsNotSuccess.1.json b/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostReceiptWithSubscriberAttributesPassesErrorIfStatusCodeIsNotSuccess.1.json new file mode 100644 index 0000000000..29d241ac83 --- /dev/null +++ b/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostReceiptWithSubscriberAttributesPassesErrorIfStatusCodeIsNotSuccess.1.json @@ -0,0 +1,30 @@ +{ + "headers" : { + "Authorization" : "Bearer the api key" + }, + "request" : { + "body" : { + "app_user_id" : "abc123", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + }, + "a key" : { + "updated_at_ms" : 1678307200000, + "value" : "a value" + }, + "another key" : { + "updated_at_ms" : 1678307200000, + "value" : "another value" + } + }, + "fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0", + "initiation_source" : "restore", + "is_restore" : false, + "observer_mode" : false + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostReceiptWithSubscriberAttributesReturnsBadJson.1.json b/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostReceiptWithSubscriberAttributesReturnsBadJson.1.json new file mode 100644 index 0000000000..ca3bae004a --- /dev/null +++ b/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostReceiptWithSubscriberAttributesReturnsBadJson.1.json @@ -0,0 +1,30 @@ +{ + "headers" : { + "Authorization" : "Bearer the api key" + }, + "request" : { + "body" : { + "app_user_id" : "abc123", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + }, + "a key" : { + "updated_at_ms" : 1678307200000, + "value" : "a value" + }, + "another key" : { + "updated_at_ms" : 1678307200000, + "value" : "another value" + } + }, + "fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0", + "initiation_source" : "queue", + "is_restore" : false, + "observer_mode" : false + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostReceiptWithSubscriberAttributesSendsThemCorrectly.1.json b/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostReceiptWithSubscriberAttributesSendsThemCorrectly.1.json new file mode 100644 index 0000000000..29d241ac83 --- /dev/null +++ b/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostReceiptWithSubscriberAttributesSendsThemCorrectly.1.json @@ -0,0 +1,30 @@ +{ + "headers" : { + "Authorization" : "Bearer the api key" + }, + "request" : { + "body" : { + "app_user_id" : "abc123", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + }, + "a key" : { + "updated_at_ms" : 1678307200000, + "value" : "a value" + }, + "another key" : { + "updated_at_ms" : 1678307200000, + "value" : "another value" + } + }, + "fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0", + "initiation_source" : "restore", + "is_restore" : false, + "observer_mode" : false + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostReceiptWithoutSubscriberAttributesSkipsThem.1.json b/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostReceiptWithoutSubscriberAttributesSkipsThem.1.json new file mode 100644 index 0000000000..eca3ab3347 --- /dev/null +++ b/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostReceiptWithoutSubscriberAttributesSkipsThem.1.json @@ -0,0 +1,22 @@ +{ + "headers" : { + "Authorization" : "Bearer the api key" + }, + "request" : { + "body" : { + "app_user_id" : "abc123", + "attributes" : { + "$attConsentStatus" : { + "updated_at_ms" : 1678307200000, + "value" : "authorized" + } + }, + "fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0", + "initiation_source" : "purchase", + "is_restore" : false, + "observer_mode" : false + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/receipts" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostSubscriberAttributesCallsCompletionInNetworkErrorCase.1.json b/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostSubscriberAttributesCallsCompletionInNetworkErrorCase.1.json new file mode 100644 index 0000000000..b39c50901f --- /dev/null +++ b/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostSubscriberAttributesCallsCompletionInNetworkErrorCase.1.json @@ -0,0 +1,21 @@ +{ + "headers" : { + "Authorization" : "Bearer the api key" + }, + "request" : { + "body" : { + "attributes" : { + "a key" : { + "updated_at_ms" : 1678307200000, + "value" : "a value" + }, + "another key" : { + "updated_at_ms" : 1678307200000, + "value" : "another value" + } + } + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/subscribers/abc123/attributes" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostSubscriberAttributesCallsCompletionInSuccessCase.1.json b/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostSubscriberAttributesCallsCompletionInSuccessCase.1.json new file mode 100644 index 0000000000..b39c50901f --- /dev/null +++ b/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostSubscriberAttributesCallsCompletionInSuccessCase.1.json @@ -0,0 +1,21 @@ +{ + "headers" : { + "Authorization" : "Bearer the api key" + }, + "request" : { + "body" : { + "attributes" : { + "a key" : { + "updated_at_ms" : 1678307200000, + "value" : "a value" + }, + "another key" : { + "updated_at_ms" : 1678307200000, + "value" : "another value" + } + } + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/subscribers/abc123/attributes" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostSubscriberAttributesCallsCompletionWithErrorInBadRequestCase.1.json b/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostSubscriberAttributesCallsCompletionWithErrorInBadRequestCase.1.json new file mode 100644 index 0000000000..b39c50901f --- /dev/null +++ b/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostSubscriberAttributesCallsCompletionWithErrorInBadRequestCase.1.json @@ -0,0 +1,21 @@ +{ + "headers" : { + "Authorization" : "Bearer the api key" + }, + "request" : { + "body" : { + "attributes" : { + "a key" : { + "updated_at_ms" : 1678307200000, + "value" : "a value" + }, + "another key" : { + "updated_at_ms" : 1678307200000, + "value" : "another value" + } + } + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/subscribers/abc123/attributes" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostSubscriberAttributesSendsAttributesErrorsIfAny.1.json b/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostSubscriberAttributesSendsAttributesErrorsIfAny.1.json new file mode 100644 index 0000000000..b39c50901f --- /dev/null +++ b/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostSubscriberAttributesSendsAttributesErrorsIfAny.1.json @@ -0,0 +1,21 @@ +{ + "headers" : { + "Authorization" : "Bearer the api key" + }, + "request" : { + "body" : { + "attributes" : { + "a key" : { + "updated_at_ms" : 1678307200000, + "value" : "a value" + }, + "another key" : { + "updated_at_ms" : 1678307200000, + "value" : "another value" + } + } + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/subscribers/abc123/attributes" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostSubscriberAttributesSendsRightParameters.1.json b/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostSubscriberAttributesSendsRightParameters.1.json new file mode 100644 index 0000000000..b39c50901f --- /dev/null +++ b/Tests/UnitTests/SubscriberAttributes/__Snapshots__/BackendSubscriberAttributesTests/iOS17-testPostSubscriberAttributesSendsRightParameters.1.json @@ -0,0 +1,21 @@ +{ + "headers" : { + "Authorization" : "Bearer the api key" + }, + "request" : { + "body" : { + "attributes" : { + "a key" : { + "updated_at_ms" : 1678307200000, + "value" : "a value" + }, + "another key" : { + "updated_at_ms" : 1678307200000, + "value" : "another value" + } + } + }, + "method" : "POST", + "url" : "https://api.revenuecat.com/v1/subscribers/abc123/attributes" + } +} \ No newline at end of file diff --git a/Tests/UnitTests/TestHelpers/CurrentTestCaseTracker.swift b/Tests/UnitTests/TestHelpers/CurrentTestCaseTracker.swift index 313f505f79..057191993c 100644 --- a/Tests/UnitTests/TestHelpers/CurrentTestCaseTracker.swift +++ b/Tests/UnitTests/TestHelpers/CurrentTestCaseTracker.swift @@ -42,6 +42,16 @@ final class CurrentTestCaseTracker: NSObject, XCTestObservation { } +extension CurrentTestCaseTracker { + + static var osVersionAndTestName: String { + let osVersionEquivalent = OSVersionEquivalent.current + + return "iOS\(osVersionEquivalent.rawValue)/\(Self.sanitizedTestName)" + } + +} + private extension XCTestCase { var sanitizedName: String { diff --git a/Tests/UnitTests/TestHelpers/OSVersionEquivalent.swift b/Tests/UnitTests/TestHelpers/OSVersionEquivalent.swift index 1e8d902972..dcd2f71674 100644 --- a/Tests/UnitTests/TestHelpers/OSVersionEquivalent.swift +++ b/Tests/UnitTests/TestHelpers/OSVersionEquivalent.swift @@ -26,6 +26,7 @@ enum OSVersionEquivalent: Int { case iOS14 = 14 case iOS15 = 15 case iOS16 = 16 + case iOS17 = 17 }