diff options
| author | Stephen Blott | 2014-05-18 12:16:41 +0100 |
|---|---|---|
| committer | Stephen Blott | 2014-05-18 12:16:41 +0100 |
| commit | f3f5d7b281fe561556132f22a6da3578e7d7a5a0 (patch) | |
| tree | 5888860720d014da6d72ee4a3942cbc864c955e2 /tests | |
| parent | 19e2bfe115cc34bc4fc59343ead4f40d075f7b20 (diff) | |
| download | vimium-f3f5d7b281fe561556132f22a6da3578e7d7a5a0.tar.bz2 | |
Import of bookmark-folder-search code and tests.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/unit_tests/completion_test.coffee | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/unit_tests/completion_test.coffee b/tests/unit_tests/completion_test.coffee index bba0a0f8..165bad46 100644 --- a/tests/unit_tests/completion_test.coffee +++ b/tests/unit_tests/completion_test.coffee @@ -23,6 +23,26 @@ context "bookmark completer", results = filterCompleter(@completer, ["mark2"]) assert.arrayEqual [@bookmark2.url], results.map (suggestion) -> suggestion.url + should "return *no* matching bookmarks when there is no match", -> + @completer.refresh() + results = filterCompleter(@completer, ["does-not-match"]) + assert.arrayEqual [], results.map (suggestion) -> suggestion.url + + should "construct bookmark paths correctly", -> + @completer.refresh() + results = filterCompleter(@completer, ["mark2"]) + assert.equal "/bookmark1/bookmark2", @bookmark2.pathAndTitle + + should "return matching bookmark *titles* when searching *without* the folder separator character", -> + @completer.refresh() + results = filterCompleter(@completer, ["mark2"]) + assert.arrayEqual ["bookmark2"], results.map (suggestion) -> suggestion.title + + should "return matching bookmark *paths* when searching with the folder separator character", -> + @completer.refresh() + results = filterCompleter(@completer, ["/bookmark1", "mark2"]) + assert.arrayEqual ["/bookmark1/bookmark2"], results.map (suggestion) -> suggestion.title + context "HistoryCache", context "binary search", setup -> |
