diff options
| author | Phil Crosby | 2014-05-27 23:27:05 -0700 |
|---|---|---|
| committer | Phil Crosby | 2014-05-27 23:27:05 -0700 |
| commit | f42690b1578de0b874048579354a17c251f567dd (patch) | |
| tree | 0121cc165833c377ea50d4d6b3156cda51eb3a39 /tests/unit_tests | |
| parent | f7828af81fd1cf6bd954ae64988ee532dc30cdff (diff) | |
| parent | d85686ac5e0c35a95d0dd17f08a2b6b269c9349c (diff) | |
| download | vimium-f42690b1578de0b874048579354a17c251f567dd.tar.bz2 | |
Merge pull request #1062 from smblott-github/bookmark-folders
Bookmark search by folder
Diffstat (limited to 'tests/unit_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 -> |
