         codewarsElement = workspaceElement.querySelector('.codewars')
         expect(codewarsElement).toExist()
 
-        codewarsPanel = atom.workspace.panelForItem(codewarsElement)
-        expect(codewarsPanel.isVisible()).toBe true
+        codewarsView = $(codewarsElement).view()
+        expect(codewarsView).toBeInstanceOf(View)
+
+        expect(codewarsView.isVisible()).toBe true
         atom.commands.dispatch workspaceElement, 'codewars:toggle'
-        expect(codewarsPanel.isVisible()).toBe false
+        expect(codewarsView.isVisible()).toBe false
 
     it "hides and shows the view", ->
       # This test shows you an integration test testing at the view level.


  beforeEach ->
    workspaceElement = atom.views.getView(atom.workspace)
    activationPromise = atom.packages.activatePackage('codewars')

  describe "when the codewars:toggle event is triggered", ->
    it "hides and shows the modal panel", ->

Codewars = require '../lib/codewars'
{$, View} = require 'space-pen'

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