aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Bernat2014-08-05 09:05:11 +0200
committerVincent Bernat2014-08-05 09:10:01 +0200
commitc27961a1700cdbcbf90d53420b1df304988d6c5d (patch)
tree47e15ee18a1398684563c62768cf4c5e84662878
parent0803fee554f1edcece6da4a082c1d8cb9bd1cdcf (diff)
downloadvimium-c27961a1700cdbcbf90d53420b1df304988d6c5d.tar.bz2
Add a test for "link rel='next'" kind of link.
While this is not strictly valid, we don't put the link markup into `<head>` to avoid adding more code just for those two new tests.
-rw-r--r--tests/dom_tests/dom_tests.coffee15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/dom_tests/dom_tests.coffee b/tests/dom_tests/dom_tests.coffee
index 04c81068..145b5866 100644
--- a/tests/dom_tests/dom_tests.coffee
+++ b/tests/dom_tests/dom_tests.coffee
@@ -215,6 +215,21 @@ 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
+
createLinks = (n) ->
for i in [0...n] by 1
link = document.createElement("a")