diff options
| author | Stephen Blott | 2016-03-17 10:49:23 +0000 |
|---|---|---|
| committer | Stephen Blott | 2016-03-17 10:49:23 +0000 |
| commit | dfb18315f8806f0b86cc6db6ef0623ad283007f5 (patch) | |
| tree | f6fc3b0122d536723a94eac8f549a1c1fec80d76 /tests | |
| parent | 8390d54b0ccf201f54bdb69d302d7b4c3b75e29a (diff) | |
| download | vimium-dfb18315f8806f0b86cc6db6ef0623ad283007f5.tar.bz2 | |
Move alphabet hint tests...
... they were in the wrong place (and were being run twice).
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/dom_tests/dom_tests.coffee | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/tests/dom_tests/dom_tests.coffee b/tests/dom_tests/dom_tests.coffee index 7ad95a98..c58d75d6 100644 --- a/tests/dom_tests/dom_tests.coffee +++ b/tests/dom_tests/dom_tests.coffee @@ -95,21 +95,6 @@ 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 @@ -210,6 +195,21 @@ context "Alphabetical link hints", assert.equal "none", hintMarkers[1].style.display assert.equal "", hintMarkers[0].style.display + 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 + context "Filtered link hints", # Note. In all of these tests, the order of the elements returned by getHintMarkers() may be different from # the order they are listed in the test HTML content. This is because LinkHints.activateMode() sorts the |
