aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Perry-Nguyen2018-09-14 15:36:51 -0400
committerRyan Perry-Nguyen2018-09-14 15:41:55 -0400
commit4ba071add3917bef54a0312065687bfd7a84f27d (patch)
tree14b266c5734db5abbbdef5b495d66bb2eae95ad1
parent4da579382e4c9e2429592cd8f947ab914875e44e (diff)
downloadvimium-4ba071add3917bef54a0312065687bfd7a84f27d.tar.bz2
Move and fix test for feature
-rw-r--r--tests/unit_tests/utils_test.coffee10
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/unit_tests/utils_test.coffee b/tests/unit_tests/utils_test.coffee
index 7439ddf7..0d1eeae2 100644
--- a/tests/unit_tests/utils_test.coffee
+++ b/tests/unit_tests/utils_test.coffee
@@ -50,6 +50,10 @@ context "convertToUrl",
assert.equal "https://www.google.com/search?q=go+ogle.com", Utils.convertToUrl("go ogle.com")
assert.equal "https://www.google.com/search?q=%40twitter", Utils.convertToUrl("@twitter")
+context "createSearchUrl",
+ should "replace %S without encoding", ->
+ assert.equal "https://www.github.com/philc/vimium/pulls", Utils.createSearchUrl "vimium/pulls", "https://www.github.com/philc/%S"
+
context "extractQuery",
should "extract queries from search URLs", ->
assert.equal "bbc sport 1", Utils.extractQuery "https://www.google.ie/search?q=%s", "https://www.google.ie/search?q=bbc+sport+1"
@@ -57,12 +61,6 @@ context "extractQuery",
assert.equal "bbc sport 3", Utils.extractQuery "https://www.google.ie/search?q=%s", "http://www.google.ie/search?q=bbc+sport+3"
assert.equal "bbc sport 4", Utils.extractQuery "https://www.google.ie/search?q=%s", "http://www.google.ie/search?q=bbc+sport+4&blah"
- should "replace %S without encoding", ->
- assert.equal "vimium/pulls", Utils.extractQuery "https://www.github.com/philc/%S", "https://www.github.com/philc/vimium/pulls"
-
- should "extract not queries from incorrect search URLs", ->
- assert.isFalse Utils.extractQuery "https://www.google.ie/search?q=%s&foo=bar", "https://www.google.ie/search?q=bbc+sport"
-
context "hasChromePrefix",
should "detect chrome prefixes of URLs", ->
assert.isTrue Utils.hasChromePrefix "about:foobar"