From 2a7b6d34829dfa6680e93e8c7d09600261667ee4 Mon Sep 17 00:00:00 2001 From: Sam Symons Date: Fri, 29 Nov 2024 11:23:28 -0800 Subject: [PATCH] Add additional test. --- .../DefaultRemoteMessagingSurveyURLBuilderTests.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Tests/RemoteMessagingTests/Mappers/DefaultRemoteMessagingSurveyURLBuilderTests.swift b/Tests/RemoteMessagingTests/Mappers/DefaultRemoteMessagingSurveyURLBuilderTests.swift index 1e7e839df..c6a490eae 100644 --- a/Tests/RemoteMessagingTests/Mappers/DefaultRemoteMessagingSurveyURLBuilderTests.swift +++ b/Tests/RemoteMessagingTests/Mappers/DefaultRemoteMessagingSurveyURLBuilderTests.swift @@ -64,6 +64,14 @@ class DefaultRemoteMessagingSurveyURLBuilderTests: XCTestCase { XCTAssertEqual(finalURL.absoluteString, "https://duckduckgo.com?vpn_first_used=10&vpn_last_used=5") } + func testAddingParametersToURLThatAlreadyHasThem() { + let builder = buildRemoteMessagingSurveyURLBuilder(vpnDaysSinceActivation: 10, vpnDaysSinceLastActive: 5) + let baseURL = URL(string: "https://duckduckgo.com?param=test")! + let finalURL = builder.add(parameters: [.vpnFirstUsed, .vpnLastUsed], to: baseURL) + + XCTAssertEqual(finalURL.absoluteString, "https://duckduckgo.com?param=test&vpn_first_used=10&vpn_last_used=5") + } + private func buildRemoteMessagingSurveyURLBuilder( atb: String = "v123-4", variant: String = "var",