Skip to content

Commit

Permalink
Add additional test.
Browse files Browse the repository at this point in the history
  • Loading branch information
samsymons committed Nov 29, 2024
1 parent 7b6349d commit 2a7b6d3
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 2a7b6d3

Please sign in to comment.