 
     describe "when a file is new", ->
       it "adds a custom style", ->
-        treeView.root.entries.find('.directory:contains(dir2)').expand()
+        $(treeView.root.entries).find('.directory:contains(dir2)')[0].expand()
         expect(treeView.find('.file:contains(new2)')).toHaveClass 'status-added'
 
     describe "when a directory is new", ->

        beforeEach ->
          dotFilePath = path.join(dirPath, ".dotfile")
          fs.writeFileSync(dotFilePath, "dot")
          dirView.collapse()
          dirView.expand()
          dotFileView = treeView.find('.file:contains(.dotfile)')

          waitsForFileToOpen ->


      runs ->
        atom.workspaceView.trigger 'tree-view:toggle'
        treeView = atom.workspaceView.find(".tree-view").view()
        root = $(treeView.root)
        dirView = $(treeView.root.entries).find('.directory:contains(test-dir):first')
        dirView[0].expand()
        fileView = treeView.find('.file:contains(test-file.txt)')
        dirView2 = $(treeView.root.entries).find('.directory:contains(test-dir2):last')
        dirView2[0].expand()
        fileView2 = treeView.find('.file:contains(test-file2.txt)')
        fileView3 = treeView.find('.file:contains(test-file3.txt)')

