mirror of
https://github.com/atom/atom.git
synced 2026-02-08 21:55:05 -05:00
Display directories first in the tree view. Style file names at same indent as directory names (beyond disclosure arrow)
This commit is contained in:
@@ -9,16 +9,21 @@ describe "TreeView", ->
|
||||
treeView = new TreeView(project)
|
||||
|
||||
describe ".initialize(project)", ->
|
||||
it "renders the root of the project and its contents, with subdirectories collapsed", ->
|
||||
it "renders the root of the project and its contents alphabetically with subdirectories first in a collapsed state", ->
|
||||
root = treeView.find('> li:first')
|
||||
expect(root.find('> .disclosure')).toHaveText('▾')
|
||||
expect(root.find('> .name')).toHaveText('fixtures/')
|
||||
|
||||
rootEntries = root.find('.entries')
|
||||
subdir = rootEntries.find('> li.directory:contains(dir/)')
|
||||
expect(subdir).toExist()
|
||||
expect(subdir.find('.disclosure')).toHaveText('▸')
|
||||
expect(subdir.find('.entries')).not.toExist()
|
||||
subdir1 = rootEntries.find('> li:eq(0)')
|
||||
expect(subdir1.find('.disclosure')).toHaveText('▸')
|
||||
expect(subdir1.find('.name')).toHaveText('dir/')
|
||||
expect(subdir1.find('.entries')).not.toExist()
|
||||
|
||||
subdir2 = rootEntries.find('> li:eq(1)')
|
||||
expect(subdir2.find('.disclosure')).toHaveText('▸')
|
||||
expect(subdir2.find('.name')).toHaveText('zed/')
|
||||
expect(subdir2.find('.entries')).not.toExist()
|
||||
|
||||
expect(rootEntries.find('> .file:contains(sample.js)')).toExist()
|
||||
expect(rootEntries.find('> .file:contains(sample.txt)')).toExist()
|
||||
|
||||
Reference in New Issue
Block a user