mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-12-26 16:14:16 +03:00
28 lines
677 B
CoffeeScript
28 lines
677 B
CoffeeScript
Panel = require '../src/panel'
|
|
|
|
describe "Panel", ->
|
|
[panel] = []
|
|
|
|
class TestPanelItem
|
|
constructior: ->
|
|
|
|
beforeEach ->
|
|
panel = new Panel(item: new TestPanelItem())
|
|
|
|
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)
|