@@ -1069,6 +1069,34 @@ describe "TreeView", ->
10691069 if atom .workspace .buildTextEditor ().isPending ?
10701070 expect (item .isPending ()).toBe false
10711071
1072+ if atom .workspace .buildTextEditor ().isPending ?
1073+ it " terminates pending state for items that are pending" , ->
1074+ jasmine .attachToDOM (workspaceElement)
1075+
1076+ file = root1 .find (' .file:contains(tree-view.js)' )[0 ]
1077+ treeView .selectEntry (file)
1078+
1079+ waitsForFileToOpen ->
1080+ atom .commands .dispatch (treeView .element , ' tree-view:expand-item' )
1081+
1082+ runs ->
1083+ item = atom .workspace .getActivePaneItem ()
1084+ expect (item .getPath ()).toBe atom .project .getDirectories ()[0 ].resolve (' tree-view.js' )
1085+ expect (item .isPending ()).toBe true
1086+ expect (atom .views .getView (item)).toHaveFocus ()
1087+
1088+ file = root1 .find (' .file:contains(tree-view.js)' )[0 ]
1089+ treeView .selectEntry (file)
1090+
1091+ waitsForFileToOpen ->
1092+ atom .commands .dispatch (treeView .element , ' tree-view:open-selected-entry' )
1093+
1094+ runs ->
1095+ item = atom .workspace .getActivePaneItem ()
1096+ expect (item .getPath ()).toBe atom .project .getDirectories ()[0 ].resolve (' tree-view.js' )
1097+ expect (atom .views .getView (item)).toHaveFocus ()
1098+ expect (item .isPending ()).toBe false
1099+
10721100 describe " when a directory is selected" , ->
10731101 it " expands or collapses the directory" , ->
10741102 subdir = root1 .find (' .directory' ).first ()
0 commit comments