     describe "when the pane is empty", ->
       it "attaches the view after a delay", ->
         expect(atom.workspaceView.getActivePane().getItems().length).toBe 0
-        activatePackage()
 
-        expect(backgroundTipsView.parent()).not.toExist()
-        advanceClock BackgroundTipsView.startDelay + 1
-        expect(backgroundTipsView.parent()).toExist()
+        activatePackage ->
+          expect(backgroundTipsView.parent()).not.toExist()
+          advanceClock BackgroundTipsView.startDelay + 1
+          expect(backgroundTipsView.parent()).toExist()
 
     describe "when the pane is not empty", ->
       it "does not attach the view", ->
         atom.workspaceView.getActivePane().activateItem($("item"))
 
-        activatePackage()
-
-        advanceClock BackgroundTipsView.startDelay + 1
-        expect(backgroundTipsView.parent()).not.toExist()
+        activatePackage ->
+          advanceClock BackgroundTipsView.startDelay + 1
+          expect(backgroundTipsView.parent()).not.toExist()
 
     describe "when a second pane is created", ->
       it "detaches the view", ->
-        activatePackage()
-        advanceClock BackgroundTipsView.startDelay + 1
-        expect(backgroundTipsView.parent()).toExist()
+        activatePackage ->
+          advanceClock BackgroundTipsView.startDelay + 1
+          expect(backgroundTipsView.parent()).toExist()
 
-        atom.workspaceView.getActivePane().splitRight()
-        expect(backgroundTipsView.parent()).not.toExist()
+          atom.workspaceView.getActivePane().splitRight()
+          expect(backgroundTipsView.parent()).not.toExist()
 
   describe "when the package is activated when there are multiple panes", ->
     beforeEach ->

      expect(atom.workspaceView.getPanes().length).toBe 2

    it "does not attach the view", ->
      activatePackage()
      advanceClock BackgroundTipsView.startDelay + 1
      expect(backgroundTipsView.parent()).not.toExist()

    describe "when all but the last pane is destroyed", ->
      it "attaches the view", ->
        activatePackage()
        atom.workspaceView.getActivePane().remove()
        advanceClock BackgroundTipsView.startDelay + 1
        expect(backgroundTipsView.parent()).toExist()

  describe "when the view is attached", ->
    beforeEach ->
      atom.workspaceView = new WorkspaceView
      expect(atom.workspaceView.getPanes().length).toBe 1
      activatePackage()
      advanceClock BackgroundTipsView.startDelay + 1

    it "has text in the message", ->
      expect(backgroundTipsView.message.text()).toBeTruthy()

{WorkspaceView, $} = require 'atom'

BackgroundTipsView = require '../lib/background-tips-view'

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