Display directories first in the tree view. Style file names at same indent as directory names (beyond disclosure arrow)

This commit is contained in:
Nathan Sobo
2012-04-23 14:59:54 -06:00
parent 55c78e9550
commit b23785f28f
4 changed files with 22 additions and 11 deletions

View File

@@ -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()