Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit c4e6e3e

Browse files
committed
Add specs to test folder git status colour after file delete
1 parent b6b80e2 commit c4e6e3e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

spec/tree-view-spec.coffee

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2166,6 +2166,26 @@ describe "TreeView", ->
21662166
it "adds a custom style", ->
21672167
expect(treeView.find('.file:contains(ignored.txt)')).toHaveClass 'status-ignored'
21682168

2169+
describe "when a file is selected in a directory", ->
2170+
beforeEach ->
2171+
jasmine.attachToDOM(workspaceElement)
2172+
treeView.focus()
2173+
element.expand() for element in treeView.find('.directory')
2174+
fileView = treeView.find('.file:contains(new2)')
2175+
expect(fileView).not.toBeNull()
2176+
fileView.click()
2177+
2178+
describe "when the file is deleted", ->
2179+
it "updates the style of the directory", ->
2180+
expect(treeView.selectedEntry().getPath()).toContain(path.join('dir2', 'new2'))
2181+
dirView = $(treeView.roots[0].entries).find('.directory:contains(dir2)')
2182+
expect(dirView).not.toBeNull()
2183+
spyOn(dirView[0].directory, 'updateStatus')
2184+
spyOn(atom, 'confirm').andCallFake (dialog) ->
2185+
dialog.buttons["Move to Trash"]()
2186+
atom.commands.dispatch(treeView.element, 'tree-view:remove')
2187+
expect(dirView[0].directory.updateStatus).toHaveBeenCalled()
2188+
21692189
describe "when the project is a symbolic link to the repository root", ->
21702190
beforeEach ->
21712191
symlinkPath = temp.path('tree-view-project')

0 commit comments

Comments
 (0)