Update status class when window gains focus

This will keep the tree view in sync when Git operations are
performed outside of the editor.
This commit is contained in:
Kevin Sawicki
2013-01-04 15:29:34 -08:00
parent 7228e270b0
commit cde4a567e7
2 changed files with 20 additions and 7 deletions

View File

@@ -887,6 +887,13 @@ describe "TreeView", ->
it "adds a custom style", ->
expect(treeView.find('.file:contains(tree-view.txt)')).toHaveClass 'modified'
describe "when the window gains focus after the contents are restored to a clean state", ->
it "removes the custom style", ->
expect(treeView.find('.file:contains(tree-view.txt)')).toHaveClass 'modified'
fs.write modifiedFile, originalFileContent
$(window).trigger 'focus'
expect(treeView.find('.file:contains(tree-view.txt)')).not.toHaveClass 'modified'
describe "when a file is new", ->
it "adds a custom style", ->
expect(treeView.find('.file:contains(.gitignore)')).toHaveClass 'new'