From c1ce80d7c54bf985f9175713f15788b802630336 Mon Sep 17 00:00:00 2001 From: Federico Cappelli Date: Mon, 2 Dec 2024 17:02:39 +0000 Subject: [PATCH] merge issue fixed --- ...aultRemoteMessagingSurveyURLBuilderTests.swift | 15 +++++++-------- .../Flows/Models/SubscriptionOptionsTests.swift | 11 +++++++---- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/Tests/RemoteMessagingTests/Mappers/DefaultRemoteMessagingSurveyURLBuilderTests.swift b/Tests/RemoteMessagingTests/Mappers/DefaultRemoteMessagingSurveyURLBuilderTests.swift index c6a490eae..0431f9c30 100644 --- a/Tests/RemoteMessagingTests/Mappers/DefaultRemoteMessagingSurveyURLBuilderTests.swift +++ b/Tests/RemoteMessagingTests/Mappers/DefaultRemoteMessagingSurveyURLBuilderTests.swift @@ -89,14 +89,13 @@ class DefaultRemoteMessagingSurveyURLBuilderTests: XCTestCase { daysSinceLastActive: vpnDaysSinceLastActive ) - let subscription = DDGSubscription(productId: "product-id", - name: "product-name", - billingPeriod: .monthly, - startedAt: Date(timeIntervalSince1970: 1000), - expiresOrRenewsAt: Date(timeIntervalSince1970: 2000), - platform: .apple, - status: .autoRenewable) - + let subscription = PrivacyProSubscription(productId: "product-id", + name: "product-name", + billingPeriod: .monthly, + startedAt: Date(timeIntervalSince1970: 1000), + expiresOrRenewsAt: Date(timeIntervalSince1970: 2000), + platform: .apple, + status: .autoRenewable) return DefaultRemoteMessagingSurveyURLBuilder( statisticsStore: mockStatisticsStore, vpnActivationDateStore: vpnActivationDateStore, diff --git a/Tests/SubscriptionTests/Flows/Models/SubscriptionOptionsTests.swift b/Tests/SubscriptionTests/Flows/Models/SubscriptionOptionsTests.swift index 133877dfe..7de77458e 100644 --- a/Tests/SubscriptionTests/Flows/Models/SubscriptionOptionsTests.swift +++ b/Tests/SubscriptionTests/Flows/Models/SubscriptionOptionsTests.swift @@ -41,10 +41,11 @@ final class SubscriptionOptionsTests: XCTestCase { let data = try? jsonEncoder.encode(subscriptionOptions) let subscriptionOptionsString = String(data: data!, encoding: .utf8)! - XCTAssertEqual(subscriptionOptionsString, """ + let result = subscriptionOptionsString.filter { !$0.isWhitespace && $0 != "\n" } + let expected = """ { "features" : [ - "Network Protection", + "Network Protection", "Data Broker Protection", "Identity Theft Restoration" ], @@ -66,7 +67,9 @@ final class SubscriptionOptionsTests: XCTestCase { ], "platform" : "macos" } -""") +""".filter { !$0.isWhitespace && $0 != "\n" } + + XCTAssertEqual(result, expected) } func testSubscriptionOptionCostEncoding() throws { @@ -86,7 +89,7 @@ final class SubscriptionOptionsTests: XCTestCase { let data = try? JSONEncoder().encode(subscriptionFeature) let subscriptionFeatureString = String(data: data!, encoding: .utf8)! - XCTAssertEqual(subscriptionFeatureString, "{\"name\":\"Identity Theft Restoration\"}") + XCTAssertEqual(subscriptionFeatureString, "\"Identity Theft Restoration\"") } func testEmptySubscriptionOptions() throws {