diff options
| author | Stephen Blott | 2016-04-08 09:42:22 +0100 |
|---|---|---|
| committer | Stephen Blott | 2016-04-08 09:45:22 +0100 |
| commit | 1a71dc6c8f323cef31eb006a8a6299b4dfe71332 (patch) | |
| tree | 0fd8812199921216658e58fc0b6689a354c618e8 /tests | |
| parent | bee5ee8416be776f379beb1bf772665a19cd3fa4 (diff) | |
| download | vimium-1a71dc6c8f323cef31eb006a8a6299b4dfe71332.tar.bz2 | |
Filtered hints; ignore unmatched text.
When the user is typing a link's text, any mistyped character exits link
hints mode. This makes little sense. In practice, this usually happens
because the user mis-typed something.
Here, we ignore typed characters which do not match any hints.
(Also, add a test for this.)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/dom_tests/dom_tests.coffee | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/dom_tests/dom_tests.coffee b/tests/dom_tests/dom_tests.coffee index 3977d046..96d95902 100644 --- a/tests/dom_tests/dom_tests.coffee +++ b/tests/dom_tests/dom_tests.coffee @@ -282,6 +282,18 @@ context "Filtered link hints", sendKeyboardEvent "A" assert.equal "1", hintMarkers[3].hintString + # This test is the same as above, but with an extra non-matching character. + should "narrow the hints and ignore typing mistakes", -> + hintMarkers = getHintMarkers() + sendKeyboardEvent "T" + sendKeyboardEvent "R" + sendKeyboardEvent "X" + assert.equal "none", hintMarkers[0].style.display + assert.equal "3", hintMarkers[1].hintString + assert.equal "", hintMarkers[1].style.display + sendKeyboardEvent "A" + assert.equal "1", hintMarkers[3].hintString + context "Image hints", setup -> |
