     describe "core:move-up", ->
       describe "when there is an expanded directory before the currently selected entry", ->
         it "selects the last entry in the expanded directory", ->
-          lastDir = treeView.root.find('.directory:last').view()
-          fileAfterDir = lastDir.next().view()
-          lastDir.expand()
+          lastDir = root.find('.directory:last')
+          fileAfterDir = lastDir.next()
+          lastDir[0].expand()
           waitsForFileToOpen ->
             fileAfterDir.click()
 

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

        expect(treeView.scrollTop()).toBe 0


      describe "when a collapsed directory is selected", ->
        it "collapses and selects the selected directory's parent directory", ->
          directories = subdir.find('.directory')
          directories.click()
          directories[0].collapse()
          treeView.trigger 'tree-view:collapse-directory'

          expect(subdir).not.toHaveClass 'expanded'
