       it "scrolls to the top", ->
         treeView.height(100)
         treeView.attachToDom()
-        $(element).view().expand() for element in treeView.find('.directory')
+        element.expand() for element in treeView.find('.directory')
         expect(treeView.list.outerHeight()).toBeGreaterThan treeView.scroller.outerHeight()
 
         expect(treeView.scrollTop()).toBe 0

      describe "when a file entry is selected", ->
        it "does nothing", ->
          waitsForFileToOpen ->
            treeView.root.find('.file').click()

          runs ->
            treeView.trigger 'tree-view:expand-directory'

        runs ->
          treeView = atom.packages.getActivePackage("tree-view").mainModule.createView()
          expect(treeView.hasParent()).toBeTruthy()
          expect(treeView.root).toBeTruthy()

    describe "when the project is a .git folder", ->
      it "does not create the tree view", ->
