Permalink
Browse files

Modify test to check for inorder bookmarks traversal.

  • Loading branch information...
1 parent 3759eba commit 7d6b32056b1233a680c5d601f802673880771cb1 @int3 int3 committed Nov 2, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 tests/unit_tests/completion_test.coffee
@@ -6,16 +6,17 @@ global.chrome = {}
context "bookmark completer",
setup ->
+ @bookmark3 = { title: "bookmark3", url: "bookmark3.com" }
@bookmark2 = { title: "bookmark2", url: "bookmark2.com" }
@bookmark1 = { title: "bookmark1", url: "bookmark1.com", children: [@bookmark2] }
global.chrome.bookmarks =
getTree: (callback) => callback([@bookmark1])
@completer = new BookmarkCompleter()
- should "flatten a list of bookmarks", ->
- result = @completer.traverseBookmarks([@bookmark1])
- assert.arrayEqual [@bookmark1, @bookmark2], @completer.traverseBookmarks([@bookmark1])
+ should "flatten a list of bookmarks with inorder traversal", ->
+ result = @completer.traverseBookmarks([@bookmark1, @bookmark3])
+ assert.arrayEqual [@bookmark1, @bookmark2, @bookmark3], @completer.traverseBookmarks([@bookmark1])
should "return matching bookmarks when searching", ->
@completer.refresh()

0 comments on commit 7d6b320

Please sign in to comment.