       expect(tabBar.find('.tab').length).toBe 3
 
       expect(tabBar.find('.tab:eq(0) .title').text()).toBe item1.getTitle()
-      expect(tabBar.find('.tab:eq(1) .title').text()).toBe editSession1.getTitle()
+      expect(tabBar.find('.tab:eq(1) .title').text()).toBe editor1.getTitle()
       expect(tabBar.find('.tab:eq(2) .title').text()).toBe item2.getTitle()
 
     it "highlights the tab for the active pane item", ->


  describe "when a tab item's modified status changes", ->
    it "adds or removes the 'modified' class to the tab based on the status", ->
      tab = tabBar.tabForItem(editSession1)
      expect(editSession1.isModified()).toBeFalsy()
      expect(tab).not.toHaveClass 'modified'

      editSession1.insertText('x')
      advanceClock(editSession1.buffer.stoppedChangingDelay)
      expect(editSession1.isModified()).toBeTruthy()
      expect(tab).toHaveClass 'modified'

      editSession1.undo()
      advanceClock(editSession1.buffer.stoppedChangingDelay)
      expect(editSession1.isModified()).toBeFalsy()
      expect(tab).not.toHaveClass 'modified'

  describe "when a pane item moves to a new index", ->

          tabBar.onDrop(dropEvent)

          expect(tabBar.getTabs().map (tab) -> tab.text()).toEqual ["Item 1", "Item 2", "sample.js"]
          expect(pane.getItems()).toEqual [item1, item2, editor1]
          expect(pane.activeItem).toBe item2
          expect(pane.focus).toHaveBeenCalled()

      describe "when it is dropped on itself", ->
        it "doesn't move the tab or item, but does make it the active item and focuses the pane", ->
          expect(tabBar.getTabs().map (tab) -> tab.text()).toEqual ["Item 1", "sample.js", "Item 2"]
          expect(pane.getItems()).toEqual [item1, editor1, item2]
          expect(pane.activeItem).toBe item2
          spyOn(pane, 'focus')

