aboutsummaryrefslogtreecommitdiffstats
path: root/tests/dom_tests
diff options
context:
space:
mode:
authorStephen Blott2016-03-10 08:50:09 +0000
committerStephen Blott2016-03-10 08:50:11 +0000
commit511607806cdf6caace67a0a3ae323def768678bd (patch)
treef80f92945465862d4cc48e8fde61e913ea4cb806 /tests/dom_tests
parente4127fc8f779a5c784332e65b1322180c4381dd0 (diff)
downloadvimium-511607806cdf6caace67a0a3ae323def768678bd.tar.bz2
Tests; add alphabet-hint hint tests.
This adds tests for a couple of properties that are required of alphabet hint strings.
Diffstat (limited to 'tests/dom_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 3797a37b..024ea801 100644
--- a/tests/dom_tests/dom_tests.coffee
+++ b/tests/dom_tests/dom_tests.coffee
@@ -93,6 +93,21 @@ createGeneralHintTests = (isFilteredMode) ->
assertStartPosition document.getElementsByTagName("a")[1], hintMarkers[1]
linkHints.deactivateMode()
+ should "generate the correct number of alphabet hints", ->
+ alphabetHints = new AlphabetHints
+ for n in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+ hintStrings = alphabetHints.hintStrings n
+ assert.equal n, hintStrings.length
+
+ should "generate non-overlapping alphabet hints", ->
+ alphabetHints = new AlphabetHints
+ for n in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+ hintStrings = alphabetHints.hintStrings n
+ for h1 in hintStrings
+ for h2 in hintStrings
+ unless h1 == h2
+ assert.isFalse 0 == h1.indexOf h2
+
createGeneralHintTests false
createGeneralHintTests true