mirror of
https://github.com/atom/atom.git
synced 2026-01-23 22:08:08 -05:00
a TreeView without a root path can be serialized
This commit is contained in:
@@ -58,6 +58,9 @@ describe "TreeView", ->
|
||||
it "does not create a root node", ->
|
||||
expect(treeView.root).not.toExist()
|
||||
|
||||
it "serializes without throwing an exception", ->
|
||||
expect(-> treeView.serialize()).not.toThrow()
|
||||
|
||||
it "creates a root view when the project path is created", ->
|
||||
rootView.open(require.resolve('fixtures/sample.js'))
|
||||
expect(treeView.root.getPath()).toBe require.resolve('fixtures')
|
||||
|
||||
@@ -60,7 +60,7 @@ class TreeView extends View
|
||||
@focus() if @focusAfterAttach
|
||||
|
||||
serialize: ->
|
||||
directoryExpansionStates: @root.serializeEntryExpansionStates()
|
||||
directoryExpansionStates: @root?.serializeEntryExpansionStates()
|
||||
selectedPath: @selectedEntry()?.getPath()
|
||||
hasFocus: @is(':focus')
|
||||
attached: @hasParent()
|
||||
|
||||
Reference in New Issue
Block a user