     it "caches tags until the buffer changes", ->
       editor = atom.workspaceView.openSync('sample.js')
       atom.workspaceView.getActiveView().trigger "symbols-view:toggle-file-symbols"
-      symbolsView = atom.workspaceView.find('.symbols-view').view()
+
+      waitsForPromise ->
+        activationPromise
+
+      runs ->
+        symbolsView = atom.workspaceView.find('.symbols-view').view()
 
       waitsFor ->
         setArraySpy.callCount > 0

        editor = atom.workspaceView.getActivePaneItem()
        editor.setCursorBufferPosition([8,14])
        atom.workspaceView.getActiveView().trigger 'symbols-view:go-to-declaration'
        symbolsView = atom.workspaceView.find('.symbols-view').view()
        expect(symbolsView.list.children('li').length).toBe 1
        expect(symbolsView.list.children('li:first').find('.primary-line')).toHaveText 'tagged.js'

  describe "project symbols", ->
    it "displays all tags", ->
      atom.workspaceView.openSync("tagged.js")
      expect(atom.workspaceView.find('.symbols-view')).not.toExist()
      atom.workspaceView.trigger "symbols-view:toggle-project-symbols"
      symbolsView = atom.workspaceView.find('.symbols-view').view()
      expect(symbolsView.loading).toHaveText 'Loading symbols...'

      waitsFor ->
        setArraySpy.callCount > 0

      editor = atom.workspaceView.getActivePaneItem()
      editor.setCursorBufferPosition([0,2])
      atom.workspaceView.getActiveView().trigger 'symbols-view:go-to-declaration'

      waitsForPromise ->
        activationPromise

      runs ->
        expect(editor.getCursorBufferPosition()).toEqual [0,2]

    it "moves the cursor to the declaration", ->
      atom.workspaceView.openSync("tagged.js")
