       it "scrolls down a page", ->
         treeView.height(5)
         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 "tree-view:expand-directory", ->
      describe "when a directory entry is selected", ->
        it "expands the current directory", ->
          subdir = treeView.root.find('.directory:first').view()
          subdir.click()
          subdir.collapse()

          expect(subdir).not.toHaveClass 'expanded'
          treeView.trigger 'tree-view:expand-directory'

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

        expect(treeView.scrollTop()).toBe 0
        treeView.trigger 'core:move-to-bottom'
        expect(treeView.scrollBottom()).toBe root.outerHeight()

        treeView.root.collapse()
        treeView.trigger 'core:move-to-bottom'
