Files
atom/spec/panel-spec.coffee
2017-04-05 16:10:21 -07:00

28 lines
691 B
CoffeeScript

Panel = require '../src/panel'
describe "Panel", ->
[panel] = []
class TestPanelItem
constructior: ->
beforeEach ->
panel = new Panel({item: new TestPanelItem()}, atom.views)
describe "changing panel visibility", ->
it 'emits an event when visibility changes', ->
panel.onDidChangeVisible spy = jasmine.createSpy()
panel.hide()
expect(panel.isVisible()).toBe false
expect(spy).toHaveBeenCalledWith(false)
spy.reset()
panel.show()
expect(panel.isVisible()).toBe true
expect(spy).toHaveBeenCalledWith(true)
panel.destroy()
expect(panel.isVisible()).toBe false
expect(spy).toHaveBeenCalledWith(false)