mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-22 00:19:24 +03:00
Add initial outline view specs
This commit is contained in:
parent
3152ab7219
commit
8acb37338d
29
spec/extensions/outline-view-spec.coffee
Normal file
29
spec/extensions/outline-view-spec.coffee
Normal file
@ -0,0 +1,29 @@
|
||||
RootView = require 'root-view'
|
||||
OutlineView = require 'outline-view'
|
||||
|
||||
describe "OutlineView", ->
|
||||
[rootView, outlineView] = []
|
||||
|
||||
beforeEach ->
|
||||
rootView = new RootView(require.resolve('fixtures/coffee.coffee'))
|
||||
rootView.activateExtension(OutlineView)
|
||||
outlineView = OutlineView.instance
|
||||
rootView.attachToDom()
|
||||
|
||||
afterEach ->
|
||||
rootView.deactivate()
|
||||
|
||||
it "displays both functions", ->
|
||||
expect(rootView.find('.outline-view')).not.toExist()
|
||||
rootView.trigger 'outline-view:toggle'
|
||||
expect(rootView.find('.outline-view')).toExist()
|
||||
expect(outlineView.list.children('li').length).toBe 2
|
||||
expect(outlineView.list.find("li:contains(sort)")).toExist()
|
||||
expect(outlineView.list.find("li:contains(noop)")).toExist()
|
||||
expect(outlineView.list.children().first()).toHaveClass 'selected'
|
||||
|
||||
it "doesn't display for unsupported languages", ->
|
||||
rootView.open(require.resolve('fixtures/sample.txt'))
|
||||
expect(rootView.find('.outline-view')).not.toExist()
|
||||
rootView.trigger 'outline-view:toggle'
|
||||
expect(rootView.find('.outline-view')).not.toExist()
|
Loading…
Reference in New Issue
Block a user