       waitsForPromise ->
         activationPromise
 
-      waitsForAnimationFrame()
+      waits()
       runs ->
         expect(textEditorElement.querySelector('.autocomplete')).toExist()
         atom.packages.deactivatePackage('autocomplete')
 
-      waitsForAnimationFrame()
+      waits()
       runs ->
         expect(textEditorElement.querySelector('.autocomplete')).not.toExist()
 
         atom.workspace.getActivePane().splitRight(copyActiveItem: true)
         atom.commands.dispatch atom.views.getView(atom.workspace.getActivePaneItem()), "autocomplete:toggle"
 
-      waitsForAnimationFrame()
+      waits()
       runs ->
         expect(workspaceElement.querySelector('.autocomplete')).not.toExist()
 

      waitsForPromise ->
        activationPromise

      waitsForAnimationFrame()

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


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

      waits()

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

      waits()

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