diff options
| author | Utkarsh Upadhyay | 2015-04-12 17:19:57 +0200 |
|---|---|---|
| committer | Utkarsh Upadhyay | 2015-04-12 17:19:57 +0200 |
| commit | aa083a7e985f7509d115d8a3f14f8a13314a4655 (patch) | |
| tree | ee9171696bf7210807e87bcf90e28615313e0435 | |
| parent | 3e1295516025d7ca29dea9fadc9ba75aa91f4bce (diff) | |
| download | vimium-aa083a7e985f7509d115d8a3f14f8a13314a4655.tar.bz2 | |
Add failing test case.
| -rw-r--r-- | tests/unit_tests/completion_test.coffee | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/unit_tests/completion_test.coffee b/tests/unit_tests/completion_test.coffee index 685758c5..56fcc456 100644 --- a/tests/unit_tests/completion_test.coffee +++ b/tests/unit_tests/completion_test.coffee @@ -152,8 +152,9 @@ context "domain completer", setup -> @history1 = { title: "history1", url: "http://history1.com", lastVisitTime: hours(1) } @history2 = { title: "history2", url: "http://history2.com", lastVisitTime: hours(1) } + @undef = { title: "history2", url: "http://undefined.net", lastVisitTime: hours(1) } - stub(HistoryCache, "use", (onComplete) => onComplete([@history1, @history2])) + stub(HistoryCache, "use", (onComplete) => onComplete([@history1, @history2, @undef])) global.chrome.history = onVisited: { addListener: -> } onVisitRemoved: { addListener: -> } @@ -174,6 +175,9 @@ context "domain completer", should "returns no results when there's more than one query term, because clearly it's not a domain", -> assert.arrayEqual [], filterCompleter(@completer, ["his", "tory"]) + should "not return any results for empty queries", -> + assert.arrayEqual [], filterCompleter(@completer, []) + context "domain completer (removing entries)", setup -> @history1 = { title: "history1", url: "http://history1.com", lastVisitTime: hours(2) } |
