               runs ->
                 dirView = $(treeView.root.entries).find('.directory:contains(test-dir)')
                 dirView[0].expand()
-                expect(dirView.entries.children().length).toBe 0
+                expect($(dirView[0].entries).children().length).toBe 0
 
           describe "when the directories along the new path don't exist", ->
             it "creates the target directory before moving the file", ->

              expect(atom.workspace.getActivePaneItem().getPath()).not.toBe newPath
              expect(treeView.find(".tree-view")).toMatchSelector(':focus')
              expect(atom.workspaceView.getActiveView().isFocused).toBeFalsy()
              expect(dirView.find('.directory.selected:contains(new)').length).toBe(1)

        describe "when the path with a trailing '/' is changed and confirmed", ->
          describe "when no directory exists at the given path", ->

          addDialog.cancel()
          root.click()
          root.removeClass('selected')
          expect(treeView.selectedEntry()).toBeNull()
          treeView.trigger "tree-view:add-file"
          addDialog = atom.workspaceView.find(".tree-view-dialog").view()

