 
     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", ->


    describe "when a file is modified", ->
      it "adds a custom style", ->
        treeView.root.entries.find('.directory:contains(dir)').expand()
        expect(treeView.find('.file:contains(b.txt)')).toHaveClass 'status-modified'

    describe "when a directory if modified", ->


        runs ->
          treeView.trigger "tree-view:add-file"
          addDialog = atom.workspaceView.find(".tree-view-dialog").view()

      describe "when a file is selected", ->
        it "opens an add dialog with the file's current directory path populated", ->
