Last active
August 29, 2015 13:56
-
-
Save eddorre/9317307 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{WorkspaceView} = require 'atom' | |
MyPackage = require '../lib/my-package' | |
# Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs. | |
# | |
# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit` | |
# or `fdescribe`). Remove the `f` to unfocus the block. | |
describe "MyPackage", -> | |
activationPromise = null | |
beforeEach -> | |
atom.workspaceView = new WorkspaceView | |
activationPromise = atom.packages.activatePackage('my-package') | |
describe "when the my-package:toggle event is triggered", -> | |
it "attaches and then detaches the view", -> | |
expect(atom.workspaceView.find('.my-package')).not.toExist() | |
# This is an activation event, triggering it will cause the package to be | |
# activated. | |
atom.workspaceView.trigger 'my-package:toggle' | |
waitsForPromise -> | |
activationPromise | |
runs -> | |
expect(atom.workspaceView.find('.my-package')).toExist() | |
atom.workspaceView.trigger 'my-package:toggle' | |
expect(atom.workspaceView.find('.my-package')).not.toExist() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment