aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPhil Crosby2014-08-12 08:17:42 -0700
committerPhil Crosby2014-08-12 08:17:42 -0700
commit5b53d69d2698e65204413711675770b017d02883 (patch)
tree70c2d6efea74214f3c165482725d620cbdc20b40 /tests
parent880a5d28ef9c3bb647b8f70e607e8e132d02a278 (diff)
parent17d7b88ee05ee940404fef5bb605c9b7665b15b8 (diff)
downloadvimium-5b53d69d2698e65204413711675770b017d02883.tar.bz2
Merge pull request #1116 from vincentbernat/fix/link-gonext
Match mixed-case relationship links in goNext/goPrevious
Diffstat (limited to 'tests')
-rw-r--r--tests/dom_tests/dom_tests.coffee23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/dom_tests/dom_tests.coffee b/tests/dom_tests/dom_tests.coffee
index 04c81068..0b2a9d89 100644
--- a/tests/dom_tests/dom_tests.coffee
+++ b/tests/dom_tests/dom_tests.coffee
@@ -215,6 +215,29 @@ context "Find prev / next links",
goNext()
assert.equal '#second', window.location.hash
+ should "find link relation in header", ->
+ document.getElementById("test-div").innerHTML = """
+ <link rel='next' href='#first'>
+ """
+ goNext()
+ assert.equal '#first', window.location.hash
+
+ should "favor link relation to text matching", ->
+ document.getElementById("test-div").innerHTML = """
+ <link rel='next' href='#first'>
+ <a href='#second'>next</a>
+ """
+ goNext()
+ assert.equal '#first', window.location.hash
+
+ should "match mixed case link relation", ->
+ document.getElementById("test-div").innerHTML = """
+ <link rel='Next' href='#first'>
+ """
+ goNext()
+ assert.equal '#first', window.location.hash
+
+
createLinks = (n) ->
for i in [0...n] by 1
link = document.createElement("a")