Skip to content

Commit

Permalink
merge issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
federicocappelli committed Dec 2, 2024
1 parent f2b8ca9 commit c1ce80d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
],
Expand All @@ -66,7 +67,9 @@ final class SubscriptionOptionsTests: XCTestCase {
],
"platform" : "macos"
}
""")
""".filter { !$0.isWhitespace && $0 != "\n" }

XCTAssertEqual(result, expected)
}

func testSubscriptionOptionCostEncoding() throws {
Expand All @@ -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 {
Expand Down

0 comments on commit c1ce80d

Please sign in to comment.