       waitsForPromise ->
         activationPromise
 
-      waitsForAnimationFrame()
+      waits()
 
       runs ->
         expect(leftEditorElement.querySelector('.autocomplete')).toExist()


        atom.commands.dispatch leftEditorElement.querySelector('.autocomplete'), 'core:cancel'

      waitsForAnimationFrame()

      runs ->
        expect(leftEditorElement.querySelector('.autocomplete')).not.toExist()
        atom.commands.dispatch rightEditorElement, 'autocomplete:toggle'

      waitsForAnimationFrame()

      runs ->
        expect(rightEditorElement.querySelector('.autocomplete')).toExist()

        atom.commands.dispatch document.activeElement, 'autocomplete:toggle'

      waitsForPromise -> activationPromise
      waits()

      runs ->
        expect(editor.lineTextForBufferRow(10)).toBe "extra:shift:extra"

        atom.commands.dispatch document.activeElement, 'core:confirm'

      waits()

      runs ->
        expect(editor.lineTextForBufferRow(10)).toBe "extra:shift:extra"
