 
   beforeEach ->
     workspaceElement = atom.views.getView(atom.workspace)
-    activationPromise = atom.packages.activatePackage('codewars')
+    activationPromise = atom.packages.activatePackage('atom-codewars')
 
   describe "when the codewars:toggle event is triggered", ->
     it "hides and shows the modal panel", ->

Codewars = require '../lib/codewars'

# Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
#

        expect(codewarsElement).toBeVisible()
        atom.commands.dispatch workspaceElement, 'codewars:toggle'
        expect(codewarsElement).not.toBeVisible()

    it "hides the view when blurred", ->
      jasmine.attachToDOM(workspaceElement)

      expect(workspaceElement.querySelector('.codewars')).not.toExist()

      atom.commands.dispatch workspaceElement, 'codewars:toggle'

      waitsForPromise ->
        activationPromise

      runs ->
        # Now we can test for view visibility
        codewarsElement = workspaceElement.querySelector('.codewars')
        expect(codewarsElement).toBeVisible()
        $(workspaceElement).triggerHandler('click')
        expect(codewarsElement).not.toBeVisible()

    it "hides the view when deactivated", ->
      jasmine.attachToDOM(workspaceElement)

      expect(workspaceElement.querySelector('.codewars')).not.toExist()

      atom.commands.dispatch workspaceElement, 'codewars:toggle'

      waitsForPromise ->
        activationPromise

      runs ->
        # Now we can test for view visibility
        codewarsElement = workspaceElement.querySelector('.codewars')
        expect(codewarsElement).toBeVisible()
        atom.commands.dispatch workspaceElement, 'core:cancel'
        expect(codewarsElement).not.toBeVisible()
