Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Add search URL scheme test
Browse files Browse the repository at this point in the history
  • Loading branch information
KacperWybranski authored and KacperWybranski committed May 2, 2021
1 parent a284191 commit 219c74b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ClientTests/NavigationRouterTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ class NavigationRouterTests: XCTestCase {
XCTAssertEqual(badNav, NavigationPath.url(webURL: URL(string: "blah"), isPrivate: false))
}

func testSearchScheme() {
let query = "Foo Bar".addingPercentEncoding(withAllowedCharacters: .alphanumerics)!
let appURL = "\(appScheme)://search?q="+query
let navItem = NavigationPath(url: URL(string: appURL)!)!

XCTAssertEqual(navItem, NavigationPath.text("Foo Bar"))
}

func testDefaultNavigationPath() {
let url = URL(string: "https://duckduckgo.com")!
let appURL = URL(string: "\(self.appScheme)://open-url?url=\(url.absoluteString.escape()!)")!
Expand Down

0 comments on commit 219c74b

Please sign in to comment.