-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathblock-comment-spec.coffee
30 lines (23 loc) · 1.06 KB
/
block-comment-spec.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{WorkspaceView} = require 'atom'
BlockComment = require '../lib/block-comment'
# 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 "BlockComment", ->
activationPromise = null
beforeEach ->
atom.workspaceView = new WorkspaceView
activationPromise = atom.packages.activatePackage('block-comment')
describe "when the block-comment:toggle event is triggered", ->
it "attaches and then detaches the view", ->
expect(atom.workspaceView.find('.block-comment')).not.toExist()
# This is an activation event, triggering it will cause the package to be
# activated.
atom.workspaceView.trigger 'block-comment:toggle'
waitsForPromise ->
activationPromise
runs ->
expect(atom.workspaceView.find('.block-comment')).toExist()
atom.workspaceView.trigger 'block-comment:toggle'
expect(atom.workspaceView.find('.block-comment')).not.toExist()