 
       it "calls the dispose method on all panels", ->
         openWithCommand('settings-view:open')
+
+        waitsFor (done) -> process.nextTick(done)
+
         runs ->
           settingsView = atom.workspace.getActivePaneItem()
           panels = [

      atom.commands.dispatch(atom.views.getView(atom.workspace), command)
      waitsFor ->
        atom.workspace.getActivePaneItem()?

    beforeEach ->
      jasmine.attachToDOM(atom.views.getView(atom.workspace))

        waitsForPromise ->
          atom.workspace.open('atom://config').then (s) -> settingsView = s

        waitsFor (done) -> process.nextTick(done)
        runs ->
          expect(settingsView.activePanelName).toBe 'Settings'

