               expect(rootView.getActiveEditor().getPath()).not.toBe newPath
               expect(treeView).toMatchSelector(':focus')
               expect(rootView.getActiveEditor().isFocused).toBeFalsy()
-              expect(dirView.find('.directory.selected:contains(new/)').length).toBe(1)
+              expect(dirView.find('.directory.selected:contains(new)').length).toBe(1)
 
             it "selects the created directory", ->
               treeView.attachToDom()

      treeView.root.disclosureArrow.click()

      # previously expanded descendants remain expanded
      expect(treeView.root.find('> .entries > li:contains(dir1/) > .entries > li:contains(sub-dir1/) > .entries').length).toBe 1

      # collapsed descendants remain collapsed
      expect(treeView.root.find('> .entries > li.contains(dir2/) > .entries')).not.toExist()

    it "when collapsing a directory, removes change subscriptions from the collapsed directory and its descendants", ->
      child = treeView.root.entries.find('li:contains(dir1/)').view()
      child.disclosureArrow.click()

      grandchild = child.entries.find('li:contains(sub-dir1/)').view()
      grandchild.disclosureArrow.click()

      expect(treeView.root.directory.subscriptionCount()).toBe 1

      expect(subdir.find('.entries')).not.toExist()

    it "restores the expansion state of descendant directories", ->
      child = treeView.root.find('.entries > li:contains(dir1)').view()
      child.disclosureArrow.click()

      grandchild = child.find('.entries > li:contains(sub-dir1)').view()
      grandchild.disclosureArrow.click()

      treeView.root.disclosureArrow.click()
